开发者

How can I stop jquery animation in my slideshow

开发者 https://www.devze.com 2023-02-05 02:11 出处:网络
I am using a jquery photo slid开发者_开发知识库eshow feature I found online. It contains a div which uses the accordian effect to display the name of the photo currently being shown. The client howeve

I am using a jquery photo slid开发者_开发知识库eshow feature I found online. It contains a div which uses the accordian effect to display the name of the photo currently being shown. The client however does not want the div to "slide" down. He wants it static while still loading the current photos title as they advance. I have an example here.

I tried going into the js file and commenting out the parts that I thought cause the animation to the div, but it had no effect. Any ideas on how I could achieve stopping jquery animation on one particular div in my example?


I'm not sure where you'd put this, but this is how you do it.

$('#divName').stop()


try changing this:

$(items[currNo]).fadeIn((timeOut / 6), function() {
    if ($(itemsSpan[currNo]).css('bottom') == 0) {
        $(itemsSpan[currNo]).slideUp((timeOut / 6), function() {
            faderStat = false;
            current = items[currNo];
            if (!mOver) {
                fadeElement(false);
            }
        });
    } else {
        $(itemsSpan[currNo]).slideDown((timeOut / 6), function() {
            faderStat = false;
            current = items[currNo];
            if (!mOver) {
                fadeElement(false);
            }
        });
    }
});

to this:

$(items[currNo]).fadeIn((timeOut / 6), function() {
            faderStat = false;
            current = items[currNo];
            if (!mOver) {
                fadeElement(false);
            }
});


Okay. I found a work around that works for me if you're using the s3Slider.js I think it has to do with the timeOut calculation in s3Slider.js... on the page with the images do the following:

$(document).ready(function() { $('#s3slider').s3Slider({ timeOut: 12000 // --> make it a multiple of 6000 and it will be smooth. only tested with 6000 & 12000 }); });


With the help of both Andy and Diodeus, I think I'm a lot closer than I was :) I managed to learn that I can give different commands to function lines in jquery files such as

$(itemsSpan[currNo]).fadeIn((timeOut/6), function() {

I know now that I can replace .slideDown with things like .fadeIn and get different effects. While I was able to change the imageSpan (which is just a box with the photos title in it) from sliding to fading, I still have not been able to make it just "sit" there and do nothing. I'm hoping the client likes the fade and leave it at that :)

0

精彩评论

暂无评论...
验证码 换一张
取 消