html - jquery simple slideshow -


I'm trying to create a simple jquery slideshow ... but I'm unable.

i am using the following code but I do not get another image for the first time, first

  $ (document) .ready (function () {$ (" $ ("# Slide1"). Attr ("src", "resource / image / slide_1.jpg"); $ ("# slide1"). Feedout (1000); $ ("# slide1"). Delay (1000). Attr ("src", "resource / image / slide_2 .jpg"); $ ("# slide1"). Feedin (1000). Dislay (1000);});   

What am I doing wrong?

Slides ID = "Slide 1" with

The following code still does not work (500) .attr ("src", "resources / images / slide_2 .jpg "). Delay (1000) .Fedaut ( 1000) .Dele (1000) .attr ("src", "Resource / Image / Slide_1.jpg"). Feedine (1000);

You src attr to slide_2.jpg < After the delay of / code> 500, right? If so, then what you are doing is wrong You work with .delay jQuery fxQueue , which is a queue of the function that affects, Such as fadeOut etc., and does not affect calls like .attr etc., which do not affect affected / animation. You can pass the callback function on .fadeOut and set the src attribute in it, like

  $ ("# slides1 ") .attr (" src "," resources / images / slide_1.jpg ") // show slide 1 .500ms for the delay (500) // ... // Show Slide 2 for FadeOut (1000, function () {// DOTS Animation 1000ms $ (this) .attr ("src", "resources / images / slide_2.jpg") .Feden (1000) // .. Fading for 1000ms. Dellay (500) // ... for 500ms}});   

Not tested, but work should tell me that this is not what you are trying to achieve.

Comments