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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:32:39+00:00 2026-06-03T02:32:39+00:00

I have to create a slideshow out of image paths that I store in

  • 0

I have to create a slideshow out of image paths that I store in a database and create the array using PHP, calling it with the JQuery ajax function. I can successfully call the array, however I am having trouble getting the Javascript slideshow to work. Here is my script:

window.onload = slideshow(0);

var i;

function slideshow(dir) {

var d = dir;
i =+ d;

$.ajax({
    url: "comiccheck.php",
    datatype: "json",
    success: function(data, textStatus, xhr) {
        data = JSON.parse(xhr.responseText);
        if(i < 0) {
            i = data.length - 1;
        }
        var comic = data[i];
        $('#comic').replaceWith("<img id='comic' src='" + comic + "' alt='comic' />");  
    }
});
}

The function slideshow(dir) is being called in the HTML when the user clicks on an arrow button, returning 1 or -1, depending on the direction. Right now the buttons will only advance the image once in each direction, but not any further. Please let me know of any questions or comments you might have on the issue, thank you.

  • 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-03T02:32:40+00:00Added an answer on June 3, 2026 at 2:32 am

    Is the i =+ d intended? Shouldn’t it be i += d ?

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

Sidebar

Related Questions

I'm using the jQuery Cycle plugin to create an image slideshow. It works great,
I am trying to create a simple image slideshow that fades in and out
I have created a slideshow widget, using jQuery.UI widgets that works with window.setInterval. I
I want to create a slideshow using jquery. But i have different size of
I have create a custom contextMenu using AS3 and can apply that to the
I want to create image slideshow in android. I have many images in android
I would like to create a gallery slideshow using Jquery Tools Scrollable plugin. But
I'm using the following to create a slide for a slideshow out of every
I have an ImageSwitcher and I'm using it to create a slideshow. I can
I'm building a simple slideshow using jQuery. I have the basics down, but as

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.