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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:46:33+00:00 2026-05-28T02:46:33+00:00

I have a Object Orientated Content/Image Slider I’m working on. I am having trouble

  • 0

I have a Object Orientated Content/Image Slider I’m working on.
I am having trouble with setInterval() just running once.
I’m passing a string value to my function cn.hero('','','','','',0,0,'yes'); which when matched should start triggering a click automatically.

Here is my code:

cn = {
    hero:function(r,rc,lx,rx,fx,fs,ss,auto){

        $(lx).click(...}
        if(auto.match('yes')){ setInterval($(lx).click(),7000); }
    }
}
$(function(){
    cn.hero('#reel', '#reel div', '#reel-left', '#reel-right', 'slide', 300, 500, 'yes');
}); 

Any Help would be greatly appreciated, thanks

  • 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-28T02:46:33+00:00Added an answer on May 28, 2026 at 2:46 am

    You need an anonymous function — what you have is executing immediately

    if(auto.match('yes')){ 
        setInterval( function() {
            $(lx).click()
        } ,7000); 
    }
    

    When you pass code to setInterval like

    setInterval($(lx).click(), 7000);
    

    the code is executed immediately; jQuery will parse that selector, and fire the click event right then and there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble with a C++ object-orientated script. When I create an object,
I have been working on keeping things object oriented for my project. Currently, I'm
I'm just starting with Object Oriented PHP and I have the following issue: I
New to the object orientated method of doing things and was just wondering what
I have recently started coding in php again and am learning Object Orientated PHP.
I think I read somewhere that some modules only have object oriented interfaces (
I have purchase Object-Oriented Analysis and Design with Applications , at page 64 paragraph
I have a clue about Object Oriented Programming: I need to have a parent
I understand object oriented programming, and have been writing OO programs for a long
There have been some questions about whether or not JavaScript is an object-oriented language.

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.