Ajax Layer JavaScript DHTML

http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999


DynAPI Examples - Button


  dynapi.library.setPath('./dynapisrc/');
  dynapi.library.include('dynapi.api');
  dynapi.library.include('dynapi.gui.BorderManager');
  dynapi.library.include('Button');
  dynapi.library.include('ButtonFlatStyle'); // (optional)
  dynapi.library.include('ButtonImageStyle'); // (optional)


// Set BlueGel Image Path
// Styles.setImagePath('./dynapiexamples/images/bluegel/');
// Make all buttons use the Flat Style
//Styles.addStyle('Button',FlatButtonStyle);
//var btnStyle = Styles.getStyle('ButtonFlat');
//btnStyle.setStyleAttribute('backColor','#C0C0C0'); // set global style atribute
var btn = new Button('B',300,100,20,20);
var btn2 = new Button('Flat Button 2',300,170,100,30,'ButtonFlat');
var btn3 = new Button('I2',300,130,21,21,'ButtonImage');
dynapi.document.addChild(btn);
dynapi.document.addChild(btn2);
dynapi.document.addChild(btn3);
var cnt=0; // onbuttonclick gives better performance than onclick in IE
btn.onbuttonclick = function(e){
  window.status = cnt++;
}
function setButtonStyle(t){
  btn.setStyle(t||'Button')
  //btn.setLocalStyleAttribute('foreColor','red');
  //btn.setEnabled(false);
}
function flatbutton2(t){
  // set local back ground color
  btn2.setLocalStyleAttribute('backColor','Yellow');
  btn2.setLocalStyleAttribute('mOverBackColor','Lime');
  btn2.setLocalStyleAttribute('mDownBackColor','#FFCC00');
  btn2.setLocalStyleAttribute('fontBold',true);
};
function greenbutton(){
  btn3.setStyle('ButtonImage');
  btn3.setLocalStyleAttribute('imageOn',dynapi.functions.getImage('./dynapiexamples/images/btn_green_on.gif',22,22));
}



 


Standard Button

Flat Button

Image Button (Fixed Size)


Image Button #2 - Green


Flat Button #2 - Customized




           
       
dynapi.zip( 791 k)