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

  • Home
  • SEARCH
  • 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 3333116
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:45:40+00:00 2026-05-17T23:45:40+00:00

So I have this nice slider script that I want to use on this

  • 0

So I have this nice slider script that I want to use on this page: http://tuscaroratackle.com/rods for several instances on the page. (In other words each rod posting will have it’s own slider, a total of about 11 sliders on the page)

In order to run the script I have to include this function declaration:

$(document).ready(function(){   
    $("#rod-slider1").easySlider();
     $("#rod-slider2").easySlider();
     $("#rod-slider3").easySlider();
     $("#rod-slider4").easySlider();
     $("#rod-slider5").easySlider();
     $("#rod-slider6").easySlider();
     $("#rod-slider7").easySlider();
     $("#rod-slider8").easySlider();
     ...etc...
  });

So the question here (is a jQ noob question I know) is can I combine those lines into one by adding all the ID selectors into the first function? And if so, what would be the proper format for writing it that way?

  • 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-17T23:45:41+00:00Added an answer on May 17, 2026 at 11:45 pm

    You can also use a class:

    $(document).ready(function(){   
        $(".rod-slider").easySlider();
    });
    

    The slider will now be applied to all/any elements having the class rod-slider.

    If you want/need to use ids, you can do so by separating them with a comma:

    $(document).ready(function(){   
        $("#rod-slider1, #rod-slider2, #rod-slider3, #etc").easySlider();
    });
    

    Or you can use the add method.

    If you don’t want to modify you current html, you can use the starts with selector:

    $(document).ready(function(){   
        $("[id^='rod-slider']").easySlider();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this test slider http://jsfiddle.net/dUyLY/2/ In Chrome it works nice, but in firefox
I have this nice little MSBuild-based daily build setup that I use on my
I'm actualilly trying tu use this nice widget : http://quasipartikel.at/multiselect_next/ I have two of
I have a string input = "maybe (this is | that was) some ((nice
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
I have this restfull service that I want to be able to call for
I have a toolbar, which is next to a slider (screenshot: http://i54.tinypic.com/w2n6ag.jpg ) and
I have a web page and I want to add a nice turning page
I just got this wordpress theme: http://meezio.pixelworkshop.fr/ Very nice, the problem is that since
So I have this nice spiffy MVC-architected application in Java Swing, and now I

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.