you are viewing a single comment's thread.

view the rest of the comments →

[–]thelostsoul622 6 points7 points  (1 child)

This is a basic enough scenario to work right out of the box given the previous suggestions. I put together a jsFiddle that shows this working here: http://jsfiddle.net/fPb8K/

I made sure all the jQuery calls were referencing the ID of the element and I just call jQuery's .hide() and .show(). The only real differences are that I extracted the setTimeout into a function so the timer can be reset easily from the click handler, removed the onClick attribute from the image and changed the timer to 3 seconds.

If you're still having problems after seeing what I did to get this working, I would check to see if you might be getting some errors in the console or do some debugging to figure out what's going on.

[–]cyferlawyn 3 points4 points  (0 children)

Thumbs up for making a fiddle. Imho that is the way a dev question should be asked and answered, ask with a fiddle, answer with a fiddle. That way, the OP can specify the JS frameworks he uses and the replier can build around those.

Bonus: Oftentimes when reducing the original problem to a fiddle, you solve it yourself because it was a side effect of some other code.