Jump to content

Jquery


Spunky

Recommended Posts

the thing I was trying to tell you with that link was that the height will always equal it's height because jquery cache's that value, which is why I had originally suggested trying to test for display (i.e. 'none').re-read my post one more time.

as for the misleading height values, it appears it's the way jquery cache's the height value when using hidehttp://api.jquery.com/hide/
With no parameters, the .hide() method is the simplest way to hide an element:
$('.target').hide();

The matched elements will be hidden immediately, with no animation. This is roughly equivalent to calling .css('display', 'none'), except that the value of the display property is saved in jQuery's data cache so that display can later be restored to its initial value. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

I would suggest trying to go back to checking for hidden, i.e. using
.is(':hidden');

I'm not sure if we ever verified the code you used for that, but I have a feeling it would work better

$("h4#thirdTitle").click(function(){  $("h4#thirdTitle").css("border-bottom","0px");  $("p#thirdPanel").slideToggle("slow", function(){	if($("p#thirdPanel").is(':hidden') {	  alert('p#thirdPanel is hidden');	  $("h4#thirdTitle").css("border-bottom","2px solid #000");	};  });});

sorry for confusing you, but it's all part of the fun, right?

Link to comment
Share on other sites

Oh. My. Goodness. IT WORKS. Yea, using hidden definetely works, haha. You're right, in that jquery linky you gave me it did say it sets the display to none, making it hidden. So, yea. I'm so glad this works. And this code is still simple enough for me to understand, lol.Thank you so so much thescientist for helping me with this! You were a great help.check out our hard work :) Smooth and friendly.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...