i need to get the increment loop based on max, so if the increment inside the iframe load is reach the max, the increment is back to 1 2 3 ... here's the code i've try
<script type="text/javascript">
var n = 1; //based on page access ex:1
var max = 8; //based on the array data ex:8
$('#iframe').on('load', function() {
var i = n++;
var l = ( (i-1) == max) ? 1 : i;
var el = $('div[id^="detail_'+l+'"]')
var k = el.attr('key')
});
</script>
the problem is when i've reach the max 8 and successfull back to 1, the next load is going to 10 not going to loop 1 to 8 again. it would be nice if you guys have a suggestion. thank