views:

58

answers:

2

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
He wants to hide it after 10 seconds if i understand the question correctly... so the opposite of what you do :)
Gaby
I don't think you can reference `$` within a setTimeout. Can you? Thought it was out of scope.
patrick dw
@Patrick: $ and jQuery is in the global (window) scope, so yes, you can.
David
@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
+1  A: 
$(document).ready(function() {

    var mySectionToFade = $('#myFadingSection');

    setTimeout(function(){ mySectionToFade.fadeOut() }, 10000);

})
patrick dw
thank you......
Karem