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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:55:36+00:00 2026-06-15T09:55:36+00:00

I am inserting images through a for loop into a section of html to

  • 0

I am inserting images through a for loop into a section of html to be displayed on a slider. I am trying to get this to display on my browser, but my developer tools keeps throwing me a weird error. I think I am inserting a character somewhere and the jquery library is not liking it.

Uncaught Error: Syntax error, unrecognized expression: [object Object]:eq(0)

Here is my code.

var theImgHTML = "<div class='slides_container portfolio-img'>";

for (i = 0; i < imgList.length; i++) {
    theImgHTML += "<img src='images/portfolio/" + imgList[i] + "' alt='Slide " + (i + 1) + "' />";
}

theImgHTML += "</div>";

$("#slides").html(theImgHTML);

$("#slides").slides({
    preload: true,
    preloadImage: 'img/loading.gif',
    play: 5000,
    pause: 2500,
    hoverPause: true
});​

Here is what comes out as a result in the html.

<div class="slides_container portfolio-img" style="overflow: hidden; position: relative; display: block; background-image: url(loading.gif); background-position: 50% 50%; background-repeat: no-repeat no-repeat;">
    <div class="slides_control" style="position: relative; width: 0px; height: 0px; left: 0px;">
        <img src="images/portfolio/one.jpg?1354641162837" alt="Slide 1" style="position: absolute; top: 0px; left: 0px; z-index: 0; display: none;">
        <img src="images/portfolio/two.jpg" alt="Slide 2" style="position: absolute; top: 0px; left: 0px; z-index: 0; display: none;">
        <img src="images/portfolio/three.jpg" alt="Slide 3" style="position: absolute; top: 0px; left: 0px; z-index: 0; display: none;">
    </div>
</div>

Thoughts?

  • 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-15T09:55:38+00:00Added an answer on June 15, 2026 at 9:55 am

    The problem end up being was that when adding the variable “theImgHTML” (contains the markup for my images) into the slides, I needed to encompass each image with a div. I was not doing that. According to the slides plugin when having images to display..each div needs to have an encompassing div surround each image.

    I tried it without the div’s and just had the image by themselves and the plugin did not accept it (thus the error above). Hopefully, this helps someone out in the future.

    Here is an example of what will work.

    <div id="slides">
         <div class="slides_container">
              <div>
                 <img src="http://placehold.it/570x270">
              </div>
              <div>
                 <img src="http://placehold.it/570x270">
              </div>
          </div>
    </div>
    

    For further info go to the link below and go to basic markup.

    http://www.slidesjs.com/

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

Sidebar

Related Questions

i am successfully inserting images into my jar file but all images go to
After inserting new html to DOM,I need to add some listeners to it. But
I sneaked through similar posts, but found no solution. I am getting this Exception
I have a foreach statement looping through JSON data and inserting the contents into
Possible Duplicates: Inserting images into a database Store images in database or on file
I am attempting to automate the insertion of JPEG images into Powerpoint. I have
I use this function for transforming URLs to images on output. function InsertLink(T){ var
I have come a across a few different methods for inserting data into SQL
I'm inserting some data into a div container via ajax. When its just straight
I am trying to display content of two sequences on web page. First one

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.