Pain Posted June 22, 2012 Share Posted June 22, 2012 Hi there. I want to make a sliding div which is hidden. Lets say there is a document and a button within a document. A new div slides down as soon as the button is clicked. I've tried using css visibility: hidden and then jquery: $(document).ready(function(){ $(".in_line2").click(function(){ $(".message_box").css("visibility", "visible"); $(".message_box").slideDown("slow"); }); }); however what happens is the box appears instantly and that's it, no sliding effect. Link to comment https://forums.phpfreaks.com/topic/264630-jquery-slidedown-a-hidden-div/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted June 23, 2012 Share Posted June 23, 2012 jQuery slide down uses display not visibility. I have created an example for your use. <style> .message_box { display:none; } </style> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $(".in_line2").click(function() { $(".message_box").slideDown("slow"); }); }); </script> <span class="in_line2">Click Me</span> <div class="message_box">And I'll slide down<> It's been tested to work. So everything should be fine. Link to comment https://forums.phpfreaks.com/topic/264630-jquery-slidedown-a-hidden-div/#findComment-1356378 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.