views:

77

answers:

1

Hi

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

Here´s the code:

    //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) }
    }
});

I need to make it live()

Thanks

A: 

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

x1a4
Thanks friend. It´s awesome.
Deryck