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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:48:33+00:00 2026-06-16T01:48:33+00:00

Hi i use some piece of code for prototype slider but the code is

  • 0

Hi i use some piece of code for prototype slider but the code is not working.My first image excute first time for total no’s than other images start sliding.If there are 3 images than first image slide for 3 time and than the slider start working.
This is my code :

var i = 0;
var j=0;
var time = '';
var delay ='';
var item_id ='';



var child;
var image_slide = [];
var NumOfImages;    
var wait = 2000;        
      var container = document.getElementById("image-container");

    for (child = container.firstChild; child; child = child.nextSibling) {
        if (child.id && child.nodeName === "DIV") {
        image_slide.push(child.id);
        }
    }

    var NumOfImages = image_slide.length;

function SwapImage(x,y) {
    console.log(x);
    $(image_slide[x]).appear({ duration: 1.5 });
    $(image_slide[y]).fade({duration: 1.5});
}


function StartSlideShow() {
    play = setInterval('Play()',wait);


}

function Play() {
    var imageShow, imageHide;

    imageShow = i+1;
    imageHide = i;

    if (imageShow == NumOfImages) {
        SwapImage(0,imageHide); 
        i = 0;                  
    } else {
        SwapImage(i+1,imageHide);           
        i++;
    }
}

function Stop () {
    clearInterval(play);                

}.

This is my html

<div id="image-container"  class="protoshow"  onmouseover="javascript:StartSlideShow();" onmouseout="javascript:Stop();">

                <div class="fade-box" id="image-1"><img src="slide01.jpg" alt="" /></div>
                <div class="fade-box" id="image-2"><img src="slide01.jpg"  alt="" /></div>
                <div class="fade-box" id="image-3"><img src="slide01.jpg"  alt="" /></div>
                <div class="fade-box" id="image-4"><img  ssrc="slide01.jpg"  alt="" /></div>

        </div>

I try my best but don’t find why it happen.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-06-16T01:48:34+00:00Added an answer on June 16, 2026 at 1:48 am

    After debugging each line i find that on first loop it hide all lower elements with display:none property of css.After adding dispaly:none to every element other than first ,it will automatically change elements on first loop.So when working with custom slider other elements must be displayed none for slider effect except first one.
    Thanks

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

Sidebar

Related Questions

the following piece of code works fine when i use it among some code
I use some code to encrypt & decrypt string in C# but i want
Use case: I find a piece of code that I do not understand at
I have to use this piece of code to save some values in table
i found a piece of code that use ObservableCollection but they can use list
I have some piece of code where is use BigInteger.and operation and I am
I have a piece of code here that i really could use some help
I use some CSS styling to hide input buttton, images and so on but
i use some code for inline cell editing from Apples TaggedLocations Example and im
I often use java.lang.Integer as primary key. Here you can see some piece of

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.