开发者

how would i upgrade this code to work with jquery 1.6.2

how would i upgrade this code to work with jquery 1.6.2 as it only seems to work if i use Version 1.2.6.

<script type="text/javascript" charset="utf-8">
    window.onload = function () {
        var container = $('div.sliderGallery');
        var ul = $('ul', container);

        var itemsWidth = ul.innerWidth() - container.outerWidth();

        $('.slider', container).slider({
            min: 0,
            max: itemsWidth,
            handle: '.handle',
            stop: function (event, ui) {
                console.log(ui.value);
                ul.animate({
                    'left': ui.value * -1
                }, 500);
            },
            slide: function (event, ui) {
                ul.css('left', ui.value * -1);
                console.log(ui.value);
            }
        });
    };
</script>

link to my开发者_开发问答 issue: http://www.floodgateone.com/catering/index1.html

thanks for any help


If you're upgrading jQuery, then also upgrade to the latest jQuery UI where slider setup is much easier:

$(".slider").slider();

EDIT:

Working example, using latest jQuery and jQuery UI: Fiddle

Full-screen link: here

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜