Hi. I want to do so when you just entered index.php it will appear a text for 10 seconds, and then it will hide, how to do so? and hide like slowly fine i have jquery
+3
A:
Like this?
<p class="text">My text</p>
<script>
window.setTimeout(function() {
$('.text').fadeOut();
}, 10000);
</script>
David
2010-02-13 19:57:34
He wants to hide it after 10 seconds if i understand the question correctly... so the opposite of what you do :)
Gaby
2010-02-13 19:59:59
I don't think you can reference `$` within a setTimeout. Can you? Thought it was out of scope.
patrick dw
2010-02-13 20:03:14
@Patrick: $ and jQuery is in the global (window) scope, so yes, you can.
David
2010-02-13 20:52:03
@David - Right you are. Gave you a +1. For some reason it wasn't working that way when I was testing. Now it is. Thanks.
patrick dw
2010-02-13 20:57:15
+1
A:
$(document).ready(function() {
var mySectionToFade = $('#myFadingSection');
setTimeout(function(){ mySectionToFade.fadeOut() }, 10000);
})
patrick dw
2010-02-13 20:01:32