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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:58:43+00:00 2026-05-29T22:58:43+00:00

I need to do a slideshow, with the follow code: <div id=galerry-one class=gallery> <div

  • 0

I need to do a slideshow, with the follow code:

<div id="galerry-one" class="gallery">
    <div class="content">
        <ul>
            <li id="content-1"><img src="image1.jpg" /></li>
            <li id="content-2"><img src="image2.jpg" /></li>
            <li id="content-3"><iframe src="http://www.youtube.com/..."></iframe></li>
            <li id="content-4"><img src="image3.jpg" /></li>
            <li id="content-5"><iframe src="http://www.youtube.com/..."></iframe></li>
        </ul>
    </div>
    <div class="thumbnails">
        <span class="prev"> « </span>
        <ul>
            <li id="go-content-1"><img src="image1_thumbnai.jpg" /></li>
            <li id="go-content-2"><img src="image2_thumbnai.jpg" /></li>
            <li id="go-content-3"><img src="youtube1_thumbnai.jpg" /></li>
            <li id="go-content-4"><img src="image3_thumbnai.jpg" /></li>
            <li id="go-content-5"><img src="youtube2_thumbnai.jpg" /></li>
        </ul>
        <span class="next"> » </span>
    </div>
</div>

Ok, when I click the a with go-content-1 id, all others slideshows hide and the 1 show, etc..

What I have started:

$(document).ready(function() {
    $('.gallery').each(function(index, element) {
        var id = $(this).attr('id');
        var images = $('#' + id + ' .content li').index() -1;

        $('#' + id + ' .prev').click(function(e) {
            e.preventDefault();

            if($('#' + id + ' .content .current').prev().length == 0 ) {
                $('#' + id + ' .content .current').removeClass('current').hide();
                $('#' + id + ' .content li:last').addClass('current').show();
            } else {
                $('#' + id + ' .content .current').removeClass('current').fadeOut(1000).hide().prev().fadeIn(1000).addClass('current').show();
            }

            return false;
        });

        $('#' + id + ' .next').click(function(e) {
            e.preventDefault();

            if($('#' + id + ' .content .current').next().length == 0 ) {
                $('#' + id + ' .content .current').removeClass('current').hide();
                $('#' + id + ' .content li:first').addClass('current').show();
            } else {
                $('#' + id + ' .content .current').removeClass('current').fadeOut(1000).hide().next().fadeIn(1000).addClass('current').show();
            }

            return false;
        });

        $('#' + id + ' .thumbnails li').click(function(e) {
            e.preventDefault();

            $('#' + id + ' .content .current').removeClass('current').hide();
            $('#' + id + ' .content .thumbnails').removeClass('current');
            $('#' + id + ' .content li').eq($(this).index()).fadeIn(1000).addClass('current').show();

            return false;
        });

        $('#' + id + ' .content li:first').addClass('current').show();
    });
});

The problem now is show only 4 thumbnails every time.
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-29T22:58:45+00:00Added an answer on May 29, 2026 at 10:58 pm

    Do not hardcode numbers in id’s. Use next and prev.

    Also I suggest reading about delegate, it will increase performance in client-side and make code cleaner. Hint: use delegate instead of the second line of what you wrote.

    Happy learning! 🙂

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

Sidebar

Related Questions

I need to create slideshow for gallery. And one thing that I don't know
i need one more thing i have function show_image() { document.write(<img src=+this.link+ ,alt=+this.alt+ ,width=600,
I need a jquery slideshow with div popup i want to show my image
I need to show a DIV containing a slideshow only when the DOM is
With asp.net-4.0 I did this: slideshow.aspx <div class=wrapCarousel> <div class=Carousel> <% foreach(var image in
I need to hide or show a div that have a slideshow inside. The
I need something like this http://jonraasch.com/blog/a-simple-jquery-slideshow but w/o the absolute positioning. Is it possible?
Need some help about with Memcache. I have created a class and want to
I need some sort of slideshow, with text (something like moving boxes would be
I need to make a css background image fade slideshow. For several reasons, 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.