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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:54:02+00:00 2026-05-22T19:54:02+00:00

I am trying to create a simple image slideshow that fades in and out

  • 0

I am trying to create a simple image slideshow that fades in and out the previous and next images that are wrapped in p tags because of how wordpress does it, I have managed to get it to move to the next image but I cannot get it to move to the previous image. I would also like it to stay in a continuous never ending loop when clicking previous or next.

Here is my html

<div>
  <div id="prev">Previous Image</div>
  <div id="next">Next Image</div>
  <div id="slides">
    <p class="slideWrap">
      <img src=""  alt="" title="Untitled-2" class="alignnone size-full wp-image-460" height="500" width="500" />
    </p>
    <p class="slideWrap">
      <img src=""  alt="" title="fishy" class="alignnone size-full wp-image-369" height="496" width="437" />
    </p>
  </div>
</div>

and here is my jquery

$('.slideWrap:not(:first)').hide();
$currentBox = $(".slideWrap");

$("#next").click(function() {
  $currentBox.fadeOut(function() {
    $currentBox = $currentBox.next();
    $currentBox.fadeIn('300');
  });
});
$("#prev").click(function() {
  $currentBox.fadeOut(function() {
    $currentBox = $currentBox.prev();
    $currentBox.fadeIn('300');
  });
});

heres the url http://satbulsara.com/luke-irwin/rugs/floral/testing-slide/

  • 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-22T19:54:03+00:00Added an answer on May 22, 2026 at 7:54 pm

    There’s quite a few ways to do this IMO, but this one should be pretty close to your existing code:

    $('.slideWrap:not(:first)').hide();
    var $boxes = $(".slideWrap"),
        $currentBox = $boxes.first().show();
    
    $("#next").click(function() {
        $currentBox.fadeOut(300, function() {
            $currentBox = $currentBox.next();
            if (!$currentBox.length) {
                $currentBox = $boxes.first();
            }
            $currentBox.fadeIn(300);
        });
    });
    $("#prev").click(function() {
        $currentBox.fadeOut(300, function() {
            $currentBox = $currentBox.prev();
            if (!$currentBox.length) {
                $currentBox = $boxes.last();
            }
            $currentBox.fadeIn(300);
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple image gallery, showing 16 images per page. I'm
I'm trying to create a simple Imgur app that will upload images to their
I am trying to create a simple Automator droplet that will take the style.less
Im trying to create a simple image resize feature, can you tell me where
I'm trying to create a fairly simple piece of JavaScript that displays a random
I'm trying to create a simple application that is only supposed to be called
I'm trying to create script, that will import keywords from images to database. Keywords
I am trying to create a tabBarItem image in Inkscape. I drew a simple
I would like to create a very simple image gallery. I am trying to
i'm trying to create a simple Opencv program in C that creates a file

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.