views:

77

answers:

2

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
        }
    });
    $(".myslider3").slider({
        animate: "true",
        step: 1,
        min: -1350,
        max: 1350,
        value: 0,
        slide: function(event, ui) {
               // magic happens here
        }
    });

So, myslider5 and myslider3 are the two classes. But their background images need to be different. How do I go about doing this?

+1  A: 

UPDATED:

DEMO http://jsbin.com/itivu3

SOURCE http://jsbin.com/itivu3/edit

NOTE: taking in mind what you have asked, change image dinamically on slide!!!

aSeptik
This is the opposite of what I want to achieve. Sorry for the poor explanation. I am trying to use different backgrounds for each slider class.
publicRavi
this is just a proof of concept! it does just what you want! just use separately! see my update!
aSeptik
A: 

I figured it out. For some reason, aSeptik's suggestion was not working. It had to be tweaked in the CSS section and not in the JS.

.myslider5.ui-widget-content {background: transparent url(../img/slider5.png);}
.myslider3.ui-widget-content {background: transparent url(../img/slider3.png);}
publicRavi
it is working fine dude! the problem is that i have used the css you have provided to me! just use `url(../img/myslider5.png)` instead of`url(../img/myslider5.png) no-repeat;` see the updates!
aSeptik
and pls check the answer! ;-) thank's!
aSeptik
@aSeptik No, I had to update the CSS file with the above lines, and not the JS file.
publicRavi
I have update with a demo so you can understand what i mean! ;-) and peraphs can learn something more!
aSeptik