Jump to content

executing function on page load.


Vivid Lust

Recommended Posts

Hi all,

 

How could I execute the following function on page load? Thanks

 

minimize:function(button, t){
dhtmlwindow.rememberattrs(t)
button.setAttribute("src", dhtmlwindow.imagefiles[2])
button.setAttribute("title", "Restore")
t.state="minimized" //indicate the state of the window as being "minimized"
t.contentarea.style.display="none"
t.statusarea.style.display="none"
if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows
	dhtmlwindow.minimizeorder++ //increment order
	t.minimizeorder=dhtmlwindow.minimizeorder
}
t.style.left="10px" //left coord of minmized window
t.style.width="300px"
var windowspacing=t.minimizeorder*10 //spacing (gap) between each minmized window(s)
t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px"
},
...
...
...
document.write('<div id="dhtmlwindowholder"><span style="display:none">.</span></div>') //container that holds all dhtml window divs on page
window.onunload=dhtmlwindow.cleanup

Link to comment
https://forums.phpfreaks.com/topic/145561-executing-function-on-page-load/
Share on other sites

you can do this:

<body onload="functionName();">

or

<script type="text/javascript">
window.onload = function () {
  functionName();
}
</script>

where functionName is the name of your function. i was going to put minimize() in there, but it looks like it's inside an object, in which you would need to use:

objectName.functionName()

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.