MDanz Posted February 20, 2010 Share Posted February 20, 2010 i'm trying to do this loop, don't know how to code it though. is it a loop? i'm thinking it's a for loop. 'for every 105px above 800px increase $max by 1. Link to comment https://forums.phpfreaks.com/topic/192690-help-with-loop/ Share on other sites More sharing options...
teamatomic Posted February 20, 2010 Share Posted February 20, 2010 800px of what? window.height? but whatever it looks more like simple math height>800 then over=height-800 round(over/105)+max HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/192690-help-with-loop/#findComment-1015095 Share on other sites More sharing options...
MDanz Posted February 20, 2010 Author Share Posted February 20, 2010 i don't know how to put it in code? e.g. $max=2 width = 920px every 105px>800px { $max= $max+1; } so $max would be 3. Link to comment https://forums.phpfreaks.com/topic/192690-help-with-loop/#findComment-1015101 Share on other sites More sharing options...
teamatomic Posted February 20, 2010 Share Posted February 20, 2010 No loop. simple math. $over=$width-800; $num=$over/105; $Rnum=round($num,0); $max=$max+$Rnum; if you dont like standard rounding up or down then look at ceil//rounds down floor//rounds down HTH Teamtomic Link to comment https://forums.phpfreaks.com/topic/192690-help-with-loop/#findComment-1015113 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.