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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:08:09+00:00 2026-06-11T20:08:09+00:00

Could I write this into a loop? $(document).ready(function(){ $(‘#slideItems1’).bxSlider(); $(‘#slideItems2’).bxSlider(); $(‘#slideItems3’).bxSlider(); $(‘#slideItems4’).bxSlider(); $(‘#slideItems5’).bxSlider(); });

  • 0

Could I write this into a loop?

$(document).ready(function(){
    $('#slideItems1').bxSlider();
    $('#slideItems2').bxSlider();
    $('#slideItems3').bxSlider();
    $('#slideItems4').bxSlider();
    $('#slideItems5').bxSlider();
});

I am using bxSlider and for using multiple galleries you need to call the slider and associate it to each item. I have over 200 products sometimes per page.

  • 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-11T20:08:10+00:00Added an answer on June 11, 2026 at 8:08 pm

    You could use an attribute starts-with selector to select all elements with an ID that starts with “slideItems”:

    $('[id^="slideItems"]').bxSlider();
    

    This is the case with the majority of jQuery methods (and most plugins will allow it too). The method is applied to every element in the matched set, so there’s no need for a loop. You can see how the plugin you’re using implements this functionality in its source (notice the call to each, and note that this refers to the jQuery object containing the matched set of elements):

    this.each(function(){
        // make sure the element has children
        if($(this).children().length > 0){
            base.initShow();
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sure I could write this myself, but before I go reinventing the wheel is
Probably really easy for a pro, but could someone re-write this from it's PHP
I was hoping someone could give me a hand on how I write this
I'm trying to write a code that could print something like this -xv -xvv
If you have a C function which returns an integer, you could write a
i'm using DbSimple, but there is some code which i could write into another
In C++0x I would like to write a function like this: template <typename... Types>
I want to write an import function for importing data from a website into
I could not figure out how to get the white fill for this ggplot2
Is there a piece of code I could write to be notified when a

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.