0

basically I am looking for a way to slideDown a div in jquery after the page has loaded. I've found few ways how to do it with a click button like this but less luck in finding a solution to load it without a button. I've tried to work with this previous topic but no luck.

Community
  • 1
  • 1

3 Answers3

0

this solution http://jsfiddle.net/XqqtN/ is doing it on load

for your code you will need to wrap it in

$(function(){

... code ...

});
eiu165
  • 6,101
  • 10
  • 41
  • 59
0
$(document).ready(function() {
  $('#div').slideDown();
}
Kyle Macey
  • 8,074
  • 2
  • 38
  • 78
  • `.ready` is triggered when the dom is ready, not when the page is loaded. – Marcelo Diniz Jan 20 '12 at 19:38
  • Have u checked this works? To me, the entire point of this post he gave the link for was that this does not work: http://stackoverflow.com/questions/2647137/how-to-jquery-slidedown-once-page-has-already-been-loaded – Ninja Jan 20 '12 at 19:39
0

One thing you can do is to trigger the click event in the JS, so that the div slide down works on document ready, without the user having to press the buttton. code here: http://jsfiddle.net/7VpPu/

You can set the button element opacity to 0, so that it remains invisible to user

Ninja
  • 5,082
  • 6
  • 37
  • 59