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 7064299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:49:02+00:00 2026-05-28T04:49:02+00:00

I have a function that advances a slideshow image when a user clicks a

  • 0

I have a function that advances a slideshow image when a user clicks a link:

jQuery("a.next").click(function(e) {
    return ngg_ajax_navigation(e, this);
});

I’d like to have this happen automatically every 3 seconds in addition to when the user clicks the link. What’s the best way to accomplish this?

Broader code:

function ngg_ajax_browser_navigation(e, obj) {


// try to find gallery number
if ("ngg-prev-" == jQuery(obj).attr("id").substr(0, 9) || "ngg-next-" == jQuery(obj).attr("id").substr(0, 9)) {

    // extract the image-id
    var imageNumber = jQuery(obj).attr("id").substr(9);

    // find the image-browser-container
    var currentNode = obj;
    while (null != currentNode.parentNode && !jQuery.nodeName(currentNode.parentNode, "body") && !jQuery(currentNode.parentNode).hasClass("ngg-imagebrowser")) {
        currentNode = currentNode.parentNode;
    }

    if (jQuery(currentNode.parentNode).hasClass("ngg-imagebrowser")) {
        var gallery = jQuery(currentNode.parentNode);

        // let's extract the post id & gallery id
        var payload = gallery.attr("id").substring(17);
        var separatorPosition = parseInt(payload.indexOf("-"));

        var galleryId = payload.substr(0, separatorPosition);
        var postId = payload.substr(separatorPosition + 1);

        if ( (galleryId.length == 0) || (postId.length == 0) ) {
            return true;
        }

        ngg_show_loading(e);

        // get content
        jQuery.get(ngg_ajax.callback, {p: postId, galleryid: galleryId, pid: imageNumber, type: "browser"}, function (data, textStatus) {
            // delete old content
            gallery.children().remove();

            // add new content
            gallery.replaceWith(data);

            // add ajax-navigation, again
            jQuery("document").ready(function(){
                // remove old listeners to avoid double-clicks
                jQuery("a.ngg-browser-next").unbind("click");
                jQuery("a.ngg-browser-prev").unbind("click");

                // add shutter-listeners again
                shutterReloaded.init('sh');

                // register ajax browser-navigation listeners
                jQuery("a.ngg-browser-next").click(function(e) {
                    return ngg_ajax_browser_navigation(e, this);
                });
                jQuery("a.ngg-browser-prev").click(function(e) {
                    return ngg_ajax_browser_navigation(e, this);
                });

                setInterval(function(){
                    jQuery("a.ngg-browser-next").click();
                }, 3000);

                ngg_remove_loading();
            });
        });

        // deactivate HTML link
        return false;
    }
}

return true;

}

  • 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-05-28T04:49:03+00:00Added an answer on May 28, 2026 at 4:49 am

    Try this

    jQuery("a.next").click(function(e) {
        return ngg_ajax_navigation(e, this);
    });
    
    setInterval(function(){
        jQuery("a.next").click();
    }, 3000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that looks like this class NSNode { function insertAfter(NSNode $node)
I have a function that would fetch a remote image via CURL, returning a
I have a jQuery function that does a .clone() on an object, and then
I have this function here that assembles an API call to eBay. It used
So I have some function that expand and collaps based on hover and click.
I have a function that can be used to redirect the user to different
I have this function that loads an specific .log file: function loadTracks():void { tracksLoader.load(new
So I have function that formats a date to coerce to given enum DateType{CURRENT,
In my Java code I have function that gets file from the client in
I have a function that gives me the following warning: [DCC Warning] filename.pas(6939): W1035

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.