[jQuery] Re: Argh!! IE8!
Yeah, sorry for that, I've compressed the code, then changed the HTML when It suddenly stopped working, thats why JS is like this. d is event, $(document).click(function(event){ var a="_menu"; What this does is that it checks if any of the popups are open, if one of them is open, b will be sett to the name of the div that is open, then I add the "_menu" and see if click came outside the, for example, #acc_menu, (which is open), If it came outside this, the pop up will close itself. I've upgraded the code to addClass, removeClass and hasClass like you said, it works better. In IE the menu starts opening and the start closing, I guess its because In my code there is 2 triggers, 1 when you click the button it starts showing, and then there is a function that analyses each click. Whats weird is that it again works in all browsers but IE. This is the JS at this point: http://ferok.com/labs/global.js I thought it was enough to add this return false for it to stop reading? On Jan 12, 5:43 pm, MorningZ wrote: > What makes it hard to follow your code, > > what is "d"? $(document).click(function(d){ > > why is is about clicking on the document? > > what is "a"? if($("#acc"+a).is(":visible")){ > > also, have you considered moving away from :visible? it's got it's > quirks and niches going across browsers... maybe using CSS classes > and "hasClass", "addClass", "removeClass" instead? > > On Jan 12, 11:31 am, Valerij wrote: > > > > > Alright, I've changed the s that are not links to divs, page is > > fully valid now, but same thing happens! Just that nows its totally > > impossible to open ANY of popup while it works in all other browsers! > > > On Jan 12, 9:19 am, "Jonathan Vanherpe (T & T NV)" > > wrote: > > > > RobG wrote: > > > > > On Jan 12, 5:51 am, Valerij wrote: > > > >> Hey guys, I have this popup menu that works.. great! In Chrome, > > > >> Safari, Firefox AND it USED to work in IE8, until I added just 1 div. > > > > [...] > > > > >> This works in all the browsers great even after I added this div, but > > > >> in IE8 it suddenly stopped. > > > > >> > > >> class="textup">My Account > > > > > Your markup is invalid, div elements don't belong inside a elements. > > > > > [...] > > > >> Is there a fix for this? > > > > > Start with valid markup:http://validator.w3.org/> > > > > Also, if it's not a link, don't use an element. > > > > Jonathan > > > -- > > > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
[jQuery] Re: Argh!! IE8!
What makes it hard to follow your code, what is "d"?$(document).click(function(d){ why is is about clicking on the document? what is "a"?if($("#acc"+a).is(":visible")){ also, have you considered moving away from :visible? it's got it's quirks and niches going across browsers... maybe using CSS classes and "hasClass", "addClass", "removeClass" instead? On Jan 12, 11:31 am, Valerij wrote: > Alright, I've changed the s that are not links to divs, page is > fully valid now, but same thing happens! Just that nows its totally > impossible to open ANY of popup while it works in all other browsers! > > On Jan 12, 9:19 am, "Jonathan Vanherpe (T & T NV)" > wrote: > > > RobG wrote: > > > > On Jan 12, 5:51 am, Valerij wrote: > > >> Hey guys, I have this popup menu that works.. great! In Chrome, > > >> Safari, Firefox AND it USED to work in IE8, until I added just 1 div. > > > [...] > > > >> This works in all the browsers great even after I added this div, but > > >> in IE8 it suddenly stopped. > > > >> > >> class="textup">My Account > > > > Your markup is invalid, div elements don't belong inside a elements. > > > > [...] > > >> Is there a fix for this? > > > > Start with valid markup:http://validator.w3.org/> > > > Also, if it's not a link, don't use an element. > > > Jonathan > > -- > > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
[jQuery] Re: Argh!! IE8!
Alright, I've changed the s that are not links to divs, page is fully valid now, but same thing happens! Just that nows its totally impossible to open ANY of popup while it works in all other browsers! On Jan 12, 9:19 am, "Jonathan Vanherpe (T & T NV)" wrote: > RobG wrote: > > > On Jan 12, 5:51 am, Valerij wrote: > >> Hey guys, I have this popup menu that works.. great! In Chrome, > >> Safari, Firefox AND it USED to work in IE8, until I added just 1 div. > > [...] > > >> This works in all the browsers great even after I added this div, but > >> in IE8 it suddenly stopped. > > >> >> class="textup">My Account > > > Your markup is invalid, div elements don't belong inside a elements. > > > [...] > >> Is there a fix for this? > > > Start with valid markup:http://validator.w3.org/> > > Also, if it's not a link, don't use an element. > > Jonathan > -- > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
Re: [jQuery] Re: Argh!! IE8!
RobG wrote: On Jan 12, 5:51 am, Valerij wrote: Hey guys, I have this popup menu that works.. great! In Chrome, Safari, Firefox AND it USED to work in IE8, until I added just 1 div. [...] This works in all the browsers great even after I added this div, but in IE8 it suddenly stopped. My Account Your markup is invalid, div elements don't belong inside a elements. [...] Is there a fix for this? Start with valid markup:http://validator.w3.org/> Also, if it's not a link, don't use an element. Jonathan -- Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
[jQuery] Re: Argh!! IE8!
On Jan 12, 5:51 am, Valerij wrote: > Hey guys, I have this popup menu that works.. great! In Chrome, > Safari, Firefox AND it USED to work in IE8, until I added just 1 div. [...] > This works in all the browsers great even after I added this div, but > in IE8 it suddenly stopped. > > class="textup">My Account Your markup is invalid, div elements don't belong inside a elements. [...] > Is there a fix for this? Start with valid markup: http://validator.w3.org/ > -- Rob