문제

Im trying to work out the way to find the source of the current slide using JQuery cycle. I will be taking the source and using it to match the background image of another div using the 'after' method, it will change with each slide. This is what I have so far, all I need is to correct the var slideURL:

$('.home-slider').cycle({ pager: '.slider-pager', pause: '1', after: onSlideAfter });

        function onSlideAfter() {

            var slideURL = currSlide.content.find('img').attr('src');

Thanks in advance!

도움이 되었습니까?

해결책

you can get the current source like this

$('.home-slider').cycle({ pager: '.slider-pager', pause: '1', after: onSlideAfter });
function onSlideAfter() {
    var slideURL =this.src;
}        

http://jsfiddle.net/dWstA/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top