PDA

View Full Version : Help with DHTML Window widget (v1.03)



chaos97
08-09-2007, 12:51 AM
1) DHTML Window widget (v1.03)

2) http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

3) I just need some guidance on how to use the onclose event of this script. The problem that I having is that after I close the popup window, mouseovers on the parent page no longer work, if I refresh the parent page, they do work. What I would like to know is how can I use the onclose event of this script to put focus back on the main window?

Please keep in mind, I know very little about javascript.

Thanks,
chaos.

ddadmin
08-09-2007, 04:31 AM
That most likely means some sort of error occured with your custom code you added within the DHTML window's onclose. You can confirm this by removing that code, and see if the problem persists.

chaos97
08-09-2007, 01:41 PM
Thanks for your reply. I haven't added anything to the onclose event. My code looks is shown below. Any help would be much appreciated.

Mouseover and popup

<area href="#" shape="rect" coords="199,362,214,381" onClick="ajaxwin=dhtmlwindow.open('ajaxbox', 'ajax', 'popup.aspx?id=10', '222', 'width=650px,height=400px,left=300px,top=100px,resize=0,scrolling=1'); return false" onMouseover="ddrivetip('<H1>222 - adfasdf</H1><img src=logos/blanklogo.gif />');" onMouseout="hideddrivetip()"/>

The onclose event of the widget looks like this:





// -------------------------------------------------------------------
close:function(t){
try{
var closewinbol=t.onclose()
}
catch(err){ //In non IE browsers, all errors are caught, so just run the below
var closewinbol=true
}
finally{ //In IE, not all errors are caught, so check if variable isn't defined in IE in those cases
if (typeof closewinbol=="undefined"){
alert("An error has occured somwhere inside your \"onclose\" event handler")
var closewinbol=true
}
}
if (closewinbol){ //if custom event handler function returns true
if (t.state!="minimized") //if this window isn't currently minimized
dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing
t.style.display="none"
}
return closewinbol
},

ddadmin
08-09-2007, 07:39 PM
At a glance I don't see anything wrong with your code. Try removing the ddtooptip code within your link:


onMouseover="ddrivetip('<H1>222 - adfasdf</H1><img src=logos/blanklogo.gif />');" onMouseout="hideddrivetip()"

There could be a conflict occuring somewhere. If you have a link to the problem page, it'd make things a lot easier.

chaos97
08-09-2007, 09:52 PM
Hello,

Thanks again for your help. You can see the page at

http://www.5gears.net/mjpa/


Thanks,
Chaos

ddadmin
08-09-2007, 10:39 PM
Ok, looks like the problem is with a conflict with the onmousemove event, used by both the DHTML Window widget and DHTML Tooltip script. Someone else had the exact problem a while ago, in which he posted his solution: http://www.dynamicdrive.com/forums/showthread.php?t=21832 If you can follow his logic (bottom of the thread), it should work for you as well.

Unfortunately until I have more time to examine the issue myself, I won't be able to provide a fix. The DHTML Window is a rather complex script, so I don't want to issue a quick fix to one issue that may cause some problems elsewhere within the script.

chaos97
08-10-2007, 02:03 AM
Thank you very much for your help!!