Multiple sliders and last one doesnt work?? its baffling me
I am working in WordPress on an options page and everything is fine except one slider, which gets the ui-style applied, When I click on it jquey ui.js passes an undefined object on mouse move. The weird thing is all the others work fine, in fact the jquery is applied to 2 elements in the same declaration and one works but the other doesnt.
I have figured out that it must be because a new jquery object is created and its not in its list of dom objects. But why this only one slider when all the others work fine (7 in all)
#orientation-tool works fine and calls setPreview()
#bgorientation-tool gets styled etc but Does Not Work, wont slide and error is generated
jQuery( "#orientation-tool,#bgorientation-tool" ).slider({
min: 0,
max: 100,
value: 90,
slide: function( event, ui ) {
setPreview();
}
jQuery( ".gradient-tool" ).slider({
min: 0,
max: 100,
value: 50,
slide: function( event, ui ) {
setPreview();
}
});
<div id="bg-gradient-tools">
<div id="bg-gradient1" class="gradient-tool"></div>
<div id="bg-gradient2" class="gradient-tool"></div>
<div id="bg-gradient3" class="gradient-tool"></div>
<div id="bgorientation-tool" ></div>
</div>
the function it calls works fine and the problem persists without it. They both render the style from the ui-css and have the extra html link and css for the control, so in my thinking a jquery object knew about it but when I try to slide it calls a javascript error
Cannot call method 'addClass' of undefined
and the class is the mouse class. Sorry its on my localhost and unable to share a link but I'm hoping someone has come across it before. The other 3 gradient div layers all work as sliders as do the other 4 not in the snippet posted. Its annoying me as I have tried everything i can think of, Ive loaded all the scripts correctly in wordpress. There is definately not 2 src's to jquery and every other element in the form works. I'd really enjoy some sleep lol any ideas and thanks for yer help