jquery - How do I add a fade effect to this slideshow? -


i have slideshow here love give fade effect. not sure how it, not familiar javascript, know how copy , paste code ( make mistakes) page here: http://lazlo.us/bw/getimages.html

i using php script pull images directory create slideshow.

the javascript creates slideshow straightforward ( found on the net):

var curimg = 0; function rotateimages() {     document.getelementbyid("slideshow").setattribute("src", "" + galleryarray[curimg]);     curimg = (curimg<galleryarray.length - 1)? curimg + 1 : 0; }  window.onload = function() {     setinterval("rotateimages()", 3500); } 

anyone me put fade effect it?

lazlo

instead of updating src of image, you'll need insert second element, , fade in.

here's simple fiddle threw uses css handle transitions on opacity.

basically, will:

  1. create image element
  2. insert before existing image element
  3. wait 100ms, , set opacity of old image 0

an image preloader helpful kick off animation well. luck!


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -