Jump to content

Recommended Posts

$b=0;
$c=0;
$d=200;
$e=3000;
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{ ?>
<script>$(document).ready(function(){
setTimeout(function () {$(".p<?php print $b++?>").fadeIn("slow");}, <?php print $d ?>;
setTimeout(function () {$(".p<?php print $c++?>").fadeOut("fast");}, <?php print $e ?>);
});</script>

 

I want $d to go 200,400,600,800,1000, etc.

and $e to go 3000,6000,9000,12000, etc.

 

$b=0;
$c=0;
$d=0;
$e=0;
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{ 
$d += 200;
$e += 3000;?>
<script>$(document).ready(function(){
setTimeout(function () {$(".p<?php print $b++?>").fadeIn("slow");}, <?php print $d ?>;
setTimeout(function () {$(".p<?php print $c++?>").fadeOut("fast");}, <?php print $e ?>);
});</script>

oh.. i guess i had the wrong thing in my head as to what  i needed, as those do print out the correct numbers as i asked for i made a mistake i need the array to end up looking similar to this:

 

$(document).ready(function(){
setTimeout(function () {$(".p1").fadeIn("slow");}, 100);
setTimeout(function () {$(".p1").fadeOut("fast");}, 5100);
setTimeout(function () {$(".p2").fadeIn("slow");}, 5300);
setTimeout(function () {$(".p2").fadeOut("fast");}, 8300);
setTimeout(function () {$(".p3").fadeIn("slow");}, 8500);
setTimeout(function () {$(".p3").fadeOut("fast");}, 11500);
setTimeout(function () {$(".p4").fadeIn("slow");}, 11700);
setTimeout(function () {$(".p4").fadeOut("fast");}, 14700);
setTimeout(function () {$(".p5").fadeIn("slow");}, 14900);
setTimeout(function () {$(".p5").fadeOut("fast");}, 17900);
setTimeout(function () {$(".p6").fadeIn("slow");}, 18100);
setTimeout(function () {$(".p6").fadeOut("fast");}, 21100);
setTimeout(function () {$(".p1").fadeIn("slow");}, 21300);
});

 

so i would need to add 200, then 3000, then 200, then 3000 to the same number.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.