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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:37:29+00:00 2026-05-31T20:37:29+00:00

I am using a custom jQuery slider to display some images and fade through

  • 0

I am using a custom jQuery slider to display some images and fade through to the next.

Here is the Jquery Code:

 (function($){

var simpleslider = function () {

  //     var interval_id = null;

    var feature = {
            holder: null,
            speed: 2000,   // 2 seconds.
            delay: 6000,  // 6 seconds. 
            index: 1,
            total: 0
    };

var fadeFrontFeatures = function(){


            feature.holder = $('#gallery .simple-slider').hide(); //  This gets the DIV with the class slider and hides them initially. 
            feature.total = feature.holder.size();

             interval_id = setInterval(fadeFrontFeatureNext, feature.delay);
             fadeFrontFeatureNext();

    };

     var fadeFrontFeatureNext = function(){

             var previous = feature.holder.eq(feature.index-1);

             if(feature.index == feature.total){ feature.index = 0; }

             var current = feature.holder.eq(feature.index);

             if(previous){ previous.fadeOut(feature.speed); }

             current.fadeIn(feature.speed, function(){
                     feature.index++;
             });

     };

     this.init = function(){

             fadeFrontFeatures();
          //  $("#gallery").mouseenter(function(e){ if (interval_id) { clearInterval(interval_id); interval_id = null; }});
          //  $("#gallery").mouseleave(function(e){ if (!interval_id) { interval_id = setInterval(fadeFrontFeatureNext, feature.delay); }});
     };

     return this;



}();

$(simpleslider.init);
}(window.jQuery));

and here is the HTML that it uses:

<div id="gallery">
  <div class="simple-slider">
    <img src="img/testimage.jpg" />
  </div>
</div>

So basically what ever is in the ‘simple-slider’ div will fade in, delay and fade out to the following ‘simple-slider’ div. That part if great, however, some of the images are quite large in file size and sometimes they have not loaded before the slider fadesout.

nb. Not an option lowering the file size 🙂

How can I get the slider to not fade out to the next image, untill it has loaded. and then, once they have all loaded it can just loop through.

I hope this makes sense. 🙂

Thanks folks.

  • 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-31T20:37:30+00:00Added an answer on May 31, 2026 at 8:37 pm

    The imagesLoaded() Plugin would be perfect to help you out.

    It will allow you to load all the images in one call and use a callback function to then load your slider. If you follow the link I provided, it will show you a full use example of the plugin.

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

Sidebar

Related Questions

I am using jquery to create a custom dropdown with the code below. I
I am using a few custom jquery buttons with datatables to do some sorting.
I'm having some problems with a content slider. I am using the jQuery.Cycle plugin
Using custom jquery to create a stand alone slider and a stand alone accordion
I'm using a custom jScrollPane and dynamically populate it using jQuery from a returned
I am using the JQuery json plugin and trying to convert a custom object
We are using jQuery in our project. We have numerous custom javascript files in
I am using jquery validation plugin for form validation. I have added a custom
I've built a custom HTML5 audio player using jQUery according to the guide found
I am using Jquery Ui plugins jquery-1.3.2.min.js and jquery-ui-1.7.1.custom.min.js and now i want to

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.