Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

90
Views
increment loop based on iframe load

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!