Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Simple Slideshow Keeps Jumping [Live Example]

Featured Replies

Hey guys,

 

Can anyone tell me why this simple slideshow keeps jumping? I'm sure it's something obvious that I'm missing. Thought it was the slideshow but tried 3 different ones and used the slider elsewhere where it's working.

 

It seems almost as if the first slide is taking too long to fade out? I've changed the speed settings numerous times though.

 

Help much appreciated :)

 

Cheers,

Chris

It seems to be because the replacement image is loaded before the transition/fade on the old one is complete, so at times you have two images (one fading in the other fading out) and others one image, resulting in jumping.

 

Debugging the JS is a bit beyond me I'm afraid, but the suggestions at http://stackoverflow.com/questions/15212748/fadeout-fadein-jquery-jump will hopefully be relevant and helpful to you.

It's the .fadeOut(1000) in the SetInterval thats causing the issue.

 

Change your code to this:

 

setInterval(function() { 
			  $('#slideshow > div:first')
			    .hide()
			    .next()
			    .fadeIn(1000)
			    .end()
			    .appendTo('#slideshow');
			},  3000);

I've placed a .hide() instead of fadeOut(1000).

 

Demo here: http://jsfiddle.net/4aaBv/

  • Author

Thanks guys & thanks Lyndsey that worked fantastic. Your a star! :)

 

Is there any way to stop the "gap" in the fade? http://hireboats2go.co.uk/phppcdemo/ so it was just one fade in to next? Sorry to pester :)

Edited by Crispy

Not sure if this is what your after ?

 

test

 

That does work much better, on the original version I noticed that if the page is slow to load the first image will jump and no fade in or out is working on any images when this happens. But on this test version that holds the first image longer while loading the issue is solved.

  • Author

Thanks that works brilliantly much smoother :)!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.