Closing opened div with jQuery slideToggle?

You have to do some more controls in order to make the external link work.

You have to do some more controls in order to make the external link work. Here is my solution, actually I don't know if it is what you are looking for but maybe it could help you jsfiddle.net/gb9M7/1/ if($("#"+$(this). Attr("class")).

Length &&! $("#"+$(this). Attr("class")).

Is(':visible')) the condition here checks if the div which correspond to the a element exists and, if so, it checks if that div is not already opened. When the state of the page meets those constraint than the if block is executed. UPDATE 1 here is the code with slide time: jsfiddle.net/gb9M7/2/ var time = 1200; .

SlideUp(time); . SlideDown(time); UPDATE 2 and here is the improved version which prevend a link to '#' from scrolling the page: jsfiddle.net/gb9M7/3/ if($(this). Attr('href') == '#') return false.

Not exactly what I was looking for, but close enough. Thanks Dalen. – Pieter Aug 4 at 20:59.

Take a look at this jsfiddle.net/NkX2Z/2.

This doesn't seems to work, you missed a ) on the last if condition – Dalen Aug 1 at 20:39 @Dalen - It works as expected. The other links work fine – ShankarSangoli Aug 1 at 20:41.

You are using 'a' selector to select ALL links in your page. And you return false, which makes all those links disabled. I suggest wrapping the links with div element and give it id or class and then attach the event to just those links.

What you are building is quite close to Accordion jqueryui.com/demos/accordion/ . Maybe thats what you want?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions