I am using this code to trigger on click button .How can I change this when page load?
$(document).ready(function() {
$('#slideleft button').click(function() {
var $lefty = $(this).next();
$lefty.animate({left: parseInt($lefty.css('left'),10) == 0 ? -$lefty.outerWidth() : 0});
});
}
My html
<div id="slideleft" class="slide">
<button>slide it</button>
<div class="inner" style="left: -350px;">Animate this element's left style property</div>
</div>
I want to slide in when the page load not clicking the button.
animatecall directly in the.ready()function, not in theclickfunction.