使用live()制作jQuery UI Slider [英] Making a jQuery UI Slider with live()

查看:103
本文介绍了使用live()制作jQuery UI Slider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在jQuery UI中编写一个Slider以使其生效?

How can I code a Slider in jQuery UI to make it Live?

这是代码:

    //scrollpane parts
var scrollPane = $('.scroll-pane');
var scrollContent = $('.scroll-content');

//build slider
var scrollbar = $(".slider-vertical").slider({
    orientation: "vertical",
    value: "100",
    slide:function(e, ui){
        if( scrollContent.height() > scrollPane.height() ){ scrollContent.css('margin-top', Math.round( (100 - ui.value) / 100 * ( scrollPane.height() - scrollContent.height() )) + 'px'); }
        else { scrollContent.css('margin-top', 0) }
    }
});

我需要让它成为live()

I need to make it live()

推荐答案

查看 livequery插件为此.直接.live在这里不起作用.

Check out the livequery plugin for this. Straight .live won't work here.

这篇关于使用live()制作jQuery UI Slider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆