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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:45:36+00:00 2026-05-21T22:45:36+00:00

Hello Guys! I have been trying to create a cool Image Slider using Jquery!

  • 0

Hello Guys!

I have been trying to create a cool Image Slider using Jquery! I have created it’s framework but I was starting with the basics in creating the plugins. My following code is not seems to be working at all! Can anyone suggest where I’m going wrong?

<html>
      <head>
             <title>Content Slider</title>
             <script src="jquery-1.5.2.min.js"></script>
             <script src="ajax.jquery.1.8.11.js"></script>
             <script src="img.slider.plugin.js"></script>
             <script>

              jQuery.fn.imgSlider = function () {
                var element = this;
                var imgArray = [];
                $(element+" img").each(function() {
                    var imgId = $(this).attr("id");
                    var imgDesc = $(this).attr("desc");
                    var imgSrc = $(this).attr("src");
                    imgArray.push({
                                   'id':imgId,
                                   'desc':imgDesc,
                                   'src':imgSrc
                                  });
                });
                $.each(imgArray,function( i, v ){
                    element.append($( "<p> Image ID - " + v.id + " | Image Desc - " + v.desc + " | Image Source - " + v.src + "</p>" ));
                });
              }

              $(document).ready(function () {
                    $('div.frame').imgSlider();
              });
             </script>
      </head>
      <body>
             <div class="frame">
                   <img id="1" desc="This Image One!" src="bg-1.jpg" />
                   <img id="2" desc="This Image One!" src="bg-2.jpg" />
                   <img id="3" desc="This Image One!" src="bg-3.jpg" />
                   <img id="4" desc="This Image One!" src="bg-4.jpg" />
                   <img id="5" desc="This Image One!" src="bg-5.jpg" />
             </div>
      </body>
</html>

THANKS IN ADVANCE

  • 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-21T22:45:36+00:00Added an answer on May 21, 2026 at 10:45 pm

    the problem lies with var element = this; and $(element+" img")

    this refers to the current jquery object. it is not a string to concatenate to.

    use

    $("img", element).each(function(){/*your code here*/})
    

    for the second part.


    Or more useful if you want to have multiple sliders in the page

    element.each(function(){
       $('img', this).each(function(){/*your code here*/});
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello guys i have a problem streaming PDF files with php, i'm using this
Hello Guys, I was just trying to create a plugin, and I needed it
Hello guys: I've loaded my DLL in my project but whenever I use the
Hello guys and thanks for your help as always. I am stuck on Asp.NET
Hello I am trying to use regular expressions in a java program. I would
Hello i am trying to implement a database-object(connection) pooler for BerkeleyDB... I decided to
hello im a bit confused here. lets say we are making a simple page
hello is there a way to import data from excel 2007 file? it is
Hello I want to make my site displayed in different languages. I had idea
Possible Duplicate: How can I write a Java application that can update itself at

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.