[jQuery] Re: jquery slider- make handle clickable

2009-01-30 Thread m...@fonolo.com

Ah- nice- that makes sense- changing it to values worked-

Now, is there a way to actually get the index of the handle that was
clicked on? short of just figuring it out based on the start value?

Thanks for all your help Richard,

Mike


On Jan 29, 8:22 pm, Richard D. Worth rdwo...@gmail.com wrote:
 On Thu, Jan 29, 2009 at 8:16 PM, m...@fonolo.com m...@fonolo.com wrote:

  So I grabbed a copy of ui.slider and ui.core from trunk, and it does
  indeed fix the issue with clicking on the handle; it is now clickable,
  and it doesn't shift around.

 Glad to hear it.



  BUT

  it seems when I have multiple handles on a slider (using values:
  [ array of integers ], but NOT using a range), while the handles are
  clickable, and both the start/stop events fire for each handle, the
  ui.value is 0?

  maybe it's the way I've implemented it? maybe because i've got
  multiple handles on a slider, without a range setting?

  I've also tried accessing value, not only from ui.value, but from

  $('#slider2').slider('value', 0), and I still get 0 back as the value

 If you have multiple handles (with or without a range) you need to use the
 'values' method instead of 'value'. It's similar to 'value' except that you
 need to pass an index as the first argument. For example

 //get the value of the 3rd handle
 var val = $(#slider).slider('values', 2);

 //set the value of the 1st handle to 5
 $(#slider).slider('values', 0, 5);

 - Richard


[jQuery] Re: jquery slider- make handle clickable

2009-01-29 Thread Richard D. Worth
I believe this may be related to an issue fixed in the trunk. You should be
able to test in 1.6rc6, which will be out today. If that doesn't fix it, you
may want to try either increasing your max by say a factor of 10 (depending
on how wide your slider is) or decreasing step from 1 (the default) to
something like 0.1 and see if that makes a difference.

Also note: there is a dedicated discussion list for jQuery UI plugins[*]:

http://groups.google.com/group/jquery-ui

Thanks.

- Richard

[*] http://rdworth.org/blog/2008/10/jquery-plugins-and-jquery-ui/

On Thu, Jan 29, 2009 at 1:42 PM, m...@fonolo.com m...@fonolo.com wrote:


 Hello,

 I'm using the ui slider plug-in as a time line for a javascript+flash
 mp3 player- so I'm setting the min value to 0, and the max value to
 the duration of the audio clip.

 Everything works as expected, and I can adjust the location of the
 handle based on the playback progress.

 Now I want to be able to click on the handle and fire off an event;
 unfortunately, and I'm guessing this is because of the large min/max
 range, if I click on the handle, it moves slightly, which causes the
 audio playback to shift.

 I'm not sure if this is a snap-to feature/bug of the slider?

 I tried playing with different step values, but couldn't get it to act
 as I wanted.

 Does anybody know how I can keep the slider from moving when I click
 on it? but I still want to be able to slide it? is that reasonable?

 I'm using jquery 1.3 (Revision: 6104), and ui.core and ui.slider
 v1.6rc5

 Thanks!

 Mike



[jQuery] Re: jquery slider- make handle clickable

2009-01-29 Thread m...@fonolo.com

Thanks Richard,

I tried both changing the max value, and setting the step value to
0.1, 0.01, etc- and it didn't make a difference.

I'll grab a copy of 1.6rc6 when it comes and see if that does it.

Cheers,

Mike

On Jan 29, 3:25 pm, Richard D. Worth rdwo...@gmail.com wrote:
 I believe this may be related to an issue fixed in the trunk. You should be
 able to test in 1.6rc6, which will be out today. If that doesn't fix it, you
 may want to try either increasing your max by say a factor of 10 (depending
 on how wide your slider is) or decreasing step from 1 (the default) to
 something like 0.1 and see if that makes a difference.

 Also note: there is a dedicated discussion list for jQuery UI plugins[*]:

 http://groups.google.com/group/jquery-ui

 Thanks.

 - Richard

 [*]http://rdworth.org/blog/2008/10/jquery-plugins-and-jquery-ui/

 On Thu, Jan 29, 2009 at 1:42 PM, m...@fonolo.com m...@fonolo.com wrote:

  Hello,

  I'm using the ui slider plug-in as a time line for a javascript+flash
  mp3 player- so I'm setting the min value to 0, and the max value to
  the duration of the audio clip.

  Everything works as expected, and I can adjust the location of the
  handle based on the playback progress.

  Now I want to be able to click on the handle and fire off an event;
  unfortunately, and I'm guessing this is because of the large min/max
  range, if I click on the handle, it moves slightly, which causes the
  audio playback to shift.

  I'm not sure if this is a snap-to feature/bug of the slider?

  I tried playing with different step values, but couldn't get it to act
  as I wanted.

  Does anybody know how I can keep the slider from moving when I click
  on it? but I still want to be able to slide it? is that reasonable?

  I'm using jquery 1.3 (Revision: 6104), and ui.core and ui.slider
  v1.6rc5

  Thanks!

  Mike


[jQuery] Re: jquery slider- make handle clickable

2009-01-29 Thread m...@fonolo.com

So I grabbed a copy of ui.slider and ui.core from trunk, and it does
indeed fix the issue with clicking on the handle; it is now clickable,
and it doesn't shift around.

BUT

it seems when I have multiple handles on a slider (using values:
[ array of integers ], but NOT using a range), while the handles are
clickable, and both the start/stop events fire for each handle, the
ui.value is 0?

maybe it's the way I've implemented it? maybe because i've got
multiple handles on a slider, without a range setting?

I've also tried accessing value, not only from ui.value, but from

$('#slider2').slider('value', 0), and I still get 0 back as the value

Looking the ui.slider.js source, the start/stop events only actually
return a value (no handle), so I'm assuming using ui.value is the
correct way of trying to get the values at start/stop.

I've put up an example here

http://mikepultz.com/player/

essentially, I want to be able to seek to different points on slider1,
by clicking on the handles for slider2 (like the seek to links at
the bottom).

Any thoughts would be greatly appreciated.

Thanks!,

Mike

On Jan 29, 3:25 pm, Richard D. Worth rdwo...@gmail.com wrote:
 I believe this may be related to an issue fixed in the trunk. You should be
 able to test in 1.6rc6, which will be out today. If that doesn't fix it, you
 may want to try either increasing your max by say a factor of 10 (depending
 on how wide your slider is) or decreasing step from 1 (the default) to
 something like 0.1 and see if that makes a difference.

 Also note: there is a dedicated discussion list for jQuery UI plugins[*]:

 http://groups.google.com/group/jquery-ui

 Thanks.

 - Richard

 [*]http://rdworth.org/blog/2008/10/jquery-plugins-and-jquery-ui/

 On Thu, Jan 29, 2009 at 1:42 PM, m...@fonolo.com m...@fonolo.com wrote:

  Hello,

  I'm using the ui slider plug-in as a time line for a javascript+flash
  mp3 player- so I'm setting the min value to 0, and the max value to
  the duration of the audio clip.

  Everything works as expected, and I can adjust the location of the
  handle based on the playback progress.

  Now I want to be able to click on the handle and fire off an event;
  unfortunately, and I'm guessing this is because of the large min/max
  range, if I click on the handle, it moves slightly, which causes the
  audio playback to shift.

  I'm not sure if this is a snap-to feature/bug of the slider?

  I tried playing with different step values, but couldn't get it to act
  as I wanted.

  Does anybody know how I can keep the slider from moving when I click
  on it? but I still want to be able to slide it? is that reasonable?

  I'm using jquery 1.3 (Revision: 6104), and ui.core and ui.slider
  v1.6rc5

  Thanks!

  Mike


[jQuery] Re: jquery slider- make handle clickable

2009-01-29 Thread Richard D. Worth
On Thu, Jan 29, 2009 at 8:16 PM, m...@fonolo.com m...@fonolo.com wrote:


 So I grabbed a copy of ui.slider and ui.core from trunk, and it does
 indeed fix the issue with clicking on the handle; it is now clickable,
 and it doesn't shift around.


Glad to hear it.




 BUT

 it seems when I have multiple handles on a slider (using values:
 [ array of integers ], but NOT using a range), while the handles are
 clickable, and both the start/stop events fire for each handle, the
 ui.value is 0?

 maybe it's the way I've implemented it? maybe because i've got
 multiple handles on a slider, without a range setting?

 I've also tried accessing value, not only from ui.value, but from

 $('#slider2').slider('value', 0), and I still get 0 back as the value


If you have multiple handles (with or without a range) you need to use the
'values' method instead of 'value'. It's similar to 'value' except that you
need to pass an index as the first argument. For example

//get the value of the 3rd handle
var val = $(#slider).slider('values', 2);

//set the value of the 1st handle to 5
$(#slider).slider('values', 0, 5);

- Richard