Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8983167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:46:17+00:00 2026-06-15T20:46:17+00:00

My Script : function pagination(id) { $(#article_load_destacados).load(indexer_destacados_news.php?pg_d=+id); if (id+1>2) { pagination(0); setInterval(function() { pagination(0);

  • 0

My Script :

function pagination(id)
    {

    $("#article_load_destacados").load("indexer_destacados_news.php?pg_d="+id);


    if (id+1>2)
    {        
       pagination(0);

       setInterval(function() 
       {
          pagination(0);
        }, 4000);        
    }
    else
    {        
       setInterval(function() 
       {
         pagination(id+1);
       }, 4000);        
    }
    }

    </script>

    <div id="article_load_destacados"></div>

    <script>
    pagination(0);
    </script>

Create this script for show pagination, the script call PHP file and load this with pagination, for this send different ids and when load PHP file load the same time different elements of pagination. With this script I want run all pagination based on id. If I have for example 5 pages, the script run from 0 to 5, I use for setInterval for it with jQuery.

I want get the script paginate and send different id each 4 seconds.
The problem when run the script the navigator doesn’t work, and generates an infinite loop.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:46:19+00:00Added an answer on June 15, 2026 at 8:46 pm

    As pointed out you want setTimeout not setInterval, you can also simplify your code http://jsfiddle.net/rayBt/

    var imax = 3;
    var time = 500;
    function pagination(id){
      $("#article_load_destacados").load("indexer_destacados_news.php?pg_d="+id);
      id = (id + 1) % imax;
      setTimeout(function () {
          pagination(id);
          }, time);        
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(.paginate li).click(function(){ $(this).attr('class','current'); $(#ajax_results).load(test.php?page= + $(this).attr('rel')).fadeIn(); }); The above code is for a pagination
The JS script: function ShowUploadingAnimation() { $('#info_msg').html(<div style=\padding-top: 15px; height: 50px;\ align=\center\><img id=\uploading-img\ /></div>);
I have a java script function that i have called on body load mousemove()
Linux bash script: function Print() { echo $1 } Print OK This script runs
I'm placing an entire pagination script into a function so I can use it
I have a pagination script, which can be seen here: http://www.automotori6282.tk/phpsandbox/ This is the
I want to create a pagination script using jquery UI's slider widget. So far
I executing a function like this, <script type=text/javascript> $(document).ready(function() { getEntities(Clients/GetClients, 0, formatClientsResult); var
<a class=source href=jquery-lead.php?source=<?=$src;?>>3</a> <script type=text/javascript> $(a.source).live('click', function() { $(#results).load(this.href, { page: $(this).text() }); return
Found this script: function stopRKey(evt) { var evt = (evt) ? evt : ((event)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.