Pergunta

I have this code:

<script type="text/javascript">

$(".faded1").each(function(i) {
  $(this).delay(i * 100).fadeIn();
});

</script>

and i want this function to be activated after page load..

with: $( window ).load(function()

how can i do this?

Thanks!

Foi útil?

Solução

    function run(){
    $(".faded1").each(function(i) {
      $(this).delay(i * 100).fadeIn();
    });

    }
$( window ).load(function(){
run();
});

call the above function after page load r include in $( window ).load(function()});

Outras dicas

Why dont you simply do

$(document).ready(function(){
$(".faded1").each(function(i) {
  $(this).delay(i * 100).fadeIn();
});
});

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top