DDAdmin here are the codes for the button dynamics to use with maximize option...
Code:
//--- replaces (t.state) in init function ---//
t.previousState="normal"
t.currentState="normal"
//-----------------------------------------------//
enablecontrols:function(e){
var d=dhtmlwindow
var sourceobj=window.event? window.event.srcElement : e.target //Get element within "handle" div mouse is currently on (the controls)
if (/Minimize/i.test(sourceobj.getAttribute("title"))) //if this is the "minimize" control
d.minimize(sourceobj, this._parent)
else if (/Maximize/i.test(sourceobj.getAttribute("title"))) //if this is the "maximize" control
d.maximize(sourceobj, this._parent)
else if (/Restore/i.test(sourceobj.getAttribute("title"))) //if this is the "restore" control
d.restore(sourceobj, this._parent)
else if (/Close/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control
d.close(this._parent)
return false
},
minimize:function(button,t){
dhtmlwindow.rememberattrs(t)
/*--- [(Button Dynamics) Edited By: DH Creation Station - 2012.02.11 - DO NOT EDIT!] -----*/
var buttons=t.controls.getElementsByTagName("img")
if(t.currentState=='maximize' && t.previousState=='normal'){
t.previousState='maximize'
t.currentState='minimize'
for (var cs=0; cs<buttons.length; cs++){
if (/Restore/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[5])
buttons[cs].setAttribute("title", "Maximize")
}
if (/Minimize/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[3])
buttons[cs].setAttribute("title", "Restore")
}
}
}
if(t.currentState=='normal' && t.previousState=='normal'){
t.previousState='normal'
t.currentState='minimize'
for (var cs=0; cs<buttons.length; cs++){
if (/Minimize/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[3])
buttons[cs].setAttribute("title", "Restore")
}
}
}
/*----------------------------------------------------------------------------------------*/
//--- minimize coding goes here ---//
},
maximize:function(button,t){
dhtmlwindow.rememberattrs(t)
/*--- [(Button Dynamics) Edited By: DH Creation Station - 2012.02.11 - DO NOT EDIT!] -----*/
var buttons=t.controls.getElementsByTagName("img")
if(t.currentState=='minimize' && t.previousState=='maximize'){
t.previousState='normal'
t.currentState='maximize'
for (var cs=0; cs<buttons.length; cs++){
if (/Restore/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[4])
buttons[cs].setAttribute("title", "Minimize")
}
if (/Maximize/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[3])
buttons[cs].setAttribute("title", "Restore")
}
}
}
if(t.currentState=='normal' && t.previousState=='normal'){
t.previousState='normal'
t.currentState='maximize'
for (var cs=0; cs<buttons.length; cs++){
if (/Maximize/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[3])
buttons[cs].setAttribute("title", "Restore")
}
}
}
if(t.currentState=='minimize' && t.previousState=='normal'){
t.previousState='normal'
t.currentState='maximize'
for (var cs=0; cs<buttons.length; cs++){
if (/Restore/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[4])
buttons[cs].setAttribute("title", "Minimize")
}
if (/Maximize/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[3])
buttons[cs].setAttribute("title", "Restore")
}
}
}
/*----------------------------------------------------------------------------------------*/
//--- maximize coding goes here ---//
},
restore:function(button,t){
dhtmlwindow.getviewpoint()
/*--- [(Button Dynamics) Edited By: DH Creation Station - 2012.02.11 - DO NOT EDIT!] -----*/
var buttons=t.controls.getElementsByTagName("img")
if(t.currentState=='maximize' && t.previousState=='normal'){
t.previousState='normal'
t.currentState='normal'
//alert( t.previousState +'\n\n'+ t.currentState);
for (var cs=0; cs<buttons.length; cs++){
if (/Restore/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[5])
buttons[cs].setAttribute("title", "Maximize")
}
}
}
if(t.currentState=='minimize' && t.previousState=='maximize'){
t.previousState='normal'
t.currentState='maximize'
for (var cs=0; cs<buttons.length; cs++){
if (/Restore/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[4])
buttons[cs].setAttribute("title", "Minimize")
}
if (/Maximize/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[3])
buttons[cs].setAttribute("title", "Restore")
}
}
}
if(t.currentState=='minimize' && t.previousState=='normal'){
t.previouseState='normal'
t.currentState='normal'
for (var cs=0; cs<buttons.length; cs++){
if (/Restore/i.test(buttons[cs].getAttribute("title"))){
buttons[cs].setAttribute("src", dhtmlwindow.imagefiles[4])
buttons[cs].setAttribute("title", "Minimize")
}
}
}
/*----------------------------------------------------------------------------------------*/
//--- restore coding goes here ---//
},
don't forget to change 'dhtmlwindow.imagefiles[*]' to match your images array that's the only editing that needs to be done within the markers. How you work your maximize and normal functions are up to you!!
Bookmarks