PDA

View Full Version : 2 script doesn't works together, any fix?



xJack
11-24-2009, 01:16 PM
1) Script Title: Cool DHTML Tooltip II and DHTML Window widget (v1.1)

2) Script URL (on DD):

http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip2.htm
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

3) Describe problem:

Added both script to my web page but after opening a popup window (dhtmlwindow), dhtmltooltip won't works when hovering over a div anymore. Really need them to be working, is there any fix to this? :(

jscheuer1
11-24-2009, 01:42 PM
There is no obvious conflict (such as an onload conflict), but there may be an error or something that can be detected from your live page that may help resolve this:

Please post a link to the page on your site that contains the problematic code so we can check it out.

xJack
11-24-2009, 01:48 PM
Thanks for your reply, jscheuer1. Here's the link to the page on my site: http://habboemotion.com/?go=rares/showrares.php

jscheuer1
11-24-2009, 02:44 PM
As near as I can tell:

Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

As a result, I can't see where on the page that either script is. But I was able to determine that they both were associated with the page somehow, and to find the problem. But I don't even know what filenames you are using for these scripts. So I'll just refer to the one where change would be most beneficial by its descriptive title, "Cool DHTML Tooltip II". In that script there is (at the end):


document.onmousemove=positiontip

Change that to:


if (document.addEventListener)
document.addEventListener('mousemove', positiontip, false);
else if (document.attachEvent)
document.attachEvent('onmousemove', positiontip);

That should do it!

xJack
11-24-2009, 04:14 PM
Thanks a lot for your reply, every script on that site was passed down since a year ago thus didn't notice the violation, really sorry. Those two scripts are located at the bottom:

http://habboemotion.com/scripts/xtra.js (dhtml window)
http://habboemotion.com/scripts/hover.js (dhtml tooltip)

Your code above didn't solve this, and I just found out that it's after you clicked on the "close" of dhtml window, dhtml tooltip then stopped working. I'm thinking it could be part of this code being the same as the tooltop making them crashing with each other (Not sure if that's the case):


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
if (window.frames["_iframe-"+t.id]) //if this is an IFRAME DHTML window
window.frames["_iframe-"+t.id].location.replace("about:blank")
else
t.contentarea.innerHTML=""
t.style.display="none"
t.isClosed=true //tell script this window is closed (for detection in t.show())
}
return closewinbol
},

EDIT: Placed credits for scripts just below them.

jscheuer1
11-24-2009, 04:34 PM
Works here, perhaps you need to clear the browser's cache.

xJack
11-24-2009, 05:24 PM
Yes, it's working already. Thanks a lot for your help, really appreciated it! :D