Firefox reacting to JQuery setTimeout that doesn't apply -
& lt; - Only note the first image.
I think some jquery is not working in Firefox, where there seems to be a problem ... but there is IE (I know, I know) < / P>
var hover = $ ('# par1'), box = $ ('.sq1'); Hover.hover (function () {box.toggleClass ('index2');});
and
var linkloc = $ ('# par1'), link = $ ('# frnt1'); Linkloc.on ('mouseenter', function () {function linkadd () {link.html ("& lt; a target = _blank href = http: //www.google.co.uk> & lt; img src = small1 .JPG / & gt; & lt; / a & gt; ");} Set Timeout (linkAD, 1500)}); Linkloc.on ('mouseleave', function () {link.html ("& lt; img src = small1.JPG />");});
I appreciate that the code can be a bit messy, but I'm still learning as I go.
The problem now is that the top slice of the code is reacting down to the setout. (It revolves around time with setTimeout repeatedly) even though the name of the function is called in it though it does not happen in IE.
If I remove setTimeout, then the top piece of code works fine, but I need a piece below it
I would have included more code (and if necessary) but it would be very confused and due to missing images JSFold would not load well.
I also have the issue that when removing my mouse, the bottom piece removes the href correctly from the HTML ... but then it is added back after the time period. Does not happen.
When you release DIV, you have to clear the timer:
var linkloc = $ ('# Par1 '), link = $ (' # frnt1 '), timer = null; Linkloc.on ('mouseenter', function () {function linkadd () {link.html ("& lt; a target = _blank href = http: //www.google.co.uk> & lt; img src = small1 .JPG / & gt; & lt; / a & gt; ");} timer = settimeout (link ad, 1500)}); Linkloc.on ('mouseleave', function) (if (timer) {clear timeout} timer = null;} link.html ("& lt; img src = small1.JPG />");}) ;
Comments
Post a Comment