Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
46
rated 0 times [  49] [ 3]  / answers: 1 / hits: 24428  / 11 Years ago, sun, october 20, 2013, 12:00:00

Hopefully it will be a quick and easy question,



I am creating a simple function, but need to trigger it about 3-4 seconds after the page is loaded, just do not know how.



Here is my script



$(function () {
var slideout = $('#slideout');
slideout.animate({
right: '-200px'
}, 1000, function () {});
$(.out).toggle(function () {
$(this).addClass('in');
slideout.animate({
right: '0px'
}, {
queue: false,
duration: 500
});
}, function () {
$(this).removeClass('in');
slideout.animate({
right: '-200px'
}, {
queue: false,
duration: 500
});
});
$(.close).click(function () {
$(this).removeClass('out');
slideout.animate({
right: '-200px'
}, {
queue: false,
duration: 1000
});
slideout.fadeOut({
duration: 1000
});
});
});


Any help is highly appreciated.


More From » jquery

 Answers
10
$(document).ready(function(){
setTimeout(function(){

//YOUR CODE

},4000);
});

[#74852] Saturday, October 19, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sergiobrayanc

Total Points: 162
Total Questions: 97
Total Answers: 94

Location: Lesotho
Member since Wed, Jun 2, 2021
3 Years ago
sergiobrayanc questions
;