jQuery slider widget background -- change dynamicaly

Posted by publicRavi on Stack Overflow See other posts from Stack Overflow or by publicRavi
Published on 2010-05-02T23:43:45Z Indexed on 2010/05/02 23:48 UTC
Read the original article Hit count: 237

Filed under:
|
|

I use a custom background for my slider by overriding the CSS:

.ui-widget-content {background: transparent url(../img/bg.png) no-repeat;}

Slider's behavior is controlled by:

$(document).ready(function() {
    $(".myslider5").slider({
        animate: "true",
        step: 1,
        min: -1950,
        max: 1950,
        value: 0,
        slide: function(event, ui) {
               // magic happens here
        }
    });

There is a need for me to use 2 different classes for my slider DIV, based on some logic. So, myslider5 and myslider3 are the two classes. But their background images need to change too. How do I go about doing this?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui