Yaz's Blog

I am a php developer. I am a geek. I am a fiction reader. A movie and tv addict.
An XBOX360 player. A snowboarder. A cyclist. A Softball player. A Venezuelan-Canadian.

[tech] javascript events take two clicks to go through

I’m having an issue with jQuery that I can’t quite figure out. As usual, my tech woes have to do with javascript. But I’m not even sure how to describe this issue, so I’ll explain what I’m doing.

There are 5 sections of content. Each section has a heading image (with pressed/not pressed states) and a div with text in it that is by default hidden. The behaviour is like this:

1. Click on the heading, content div goes from hidden to displayed. The heading image is dynamically changed with jQuery to the pressed state.

2. Click on another heading, swap the headings that are pressed to not pressed, and hide all displayed divs, then repeat #1 on this heading.

It works like a charm… except that it takes often 2 clicks to get headings to display. It seems like the browser can’t keep up with the javascript event requests. There are no errors, there is nothing getting stuck, I can’t seem to track it down.

Until further notice… this stays unresolved. heh.

Blog comments powered by Disqus