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.

有帮助吗?

解决方案

$(document).ready(function() {
  $('#div').slideDown();
}

其他提示

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

for your code you will need to wrap it in

$(function(){

... code ...

});

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top