Provide your callback function as the value of the slide option:
$('#slider').slider({
orientation: 'horizontal',
step: 5,
value: 50,
animate: true,
slide: function(event, ui) {
changeVolume(ui.value);
}
});
In the function, the value of the handle can be found in ui.value.
- Richard
On Thu, Nov 5, 2009 at 3:12 PM, John <[email protected]> wrote:
> I am pretty new to jQuery.
> I have got the slider working and I am trying to create a volume
> control.
> I have got the control so far that I have a function which takes a
> value and changes the volume.
> Now I need to find a way to call that function when the handle of the
> slider changes, passing the value of the handle.
>
> <script>
> $(function(){
> // Slider
> $('#slider').slider({
> orientation: 'horizontal', step: 5, value: 50,
> animate: true
> });
> });
> </script>
>
> Tha'ts how far I have got. The function call is for example:
> "changeVolume(number 1-100);"
>
> Any help very much appreciated.
>
> Thanks
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "jQuery UI" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<jquery-ui%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/jquery-ui?hl=en.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en.