Thanks Mitch I found your function helpful. I was having trouble with the slide as the percent value or the xProc in your equation was inaccurate and changed if I click the slider a second time. I did however fine tune your equation for my own purposes. Here's my result:
var fraction = x / this.dragCfg.containerMaxx; var expected = (100 * fraction) / (100/f) + 1; The expected value now becomes in a fraction 4 = 1,2,3,4 or 5. Hope this might help someone. On Jun 22, 4:10 am, Gordon <[EMAIL PROTECTED]> wrote: > I have been having some trouble with the interface sliders as well, it > has been suggested to me when I posted about it that the sliders code > simply needs a rework as it stands, and that certain things just don't > work very well currently. Sorry I can't be mroe help than that, it's > pretty much all I've been told on the subject. > > On Jun 21, 12:18 am, Mitch <[EMAIL PROTECTED]> wrote: > > > I have aSliderwith fractions and an onSlide handler. Sometimes when > > the handler is invoked, the reported value for xProc seems to be > > "lagging" -- it seems to be the value from just before theslider > > jumped to its current position. Has anyone else seen this problem? > > > I'd like to post an example but am not sure how Google Groups will > > handle the formatting. So for now, here's a fragment to demonstrate > > the problem. > > > <div id="slider_frame"> > > <div id="bar"> > > <div id="indicator" class="Indicator"></div> > > </div> > > </div> > > <p id="msg"></p> > > ... > > var f = 5; > > varslider= $("#bar").Slider({ > > accept: "#indicator", > > fractions: f, > > onSlide: function(xProc, yProc, x, y) { > > var fraction = x / this.dragCfg.containerMaxx; > > var expected = Math.round(100 * fraction / (f - > > 1)) * (f - 1); > > $("#msg").html("Expected " + expected + ", got " + > > xProc); > > > In the web app where I've encountered this problem, I've been able to > > work around it by recomputing the xProc value in my onSlide function: > > var fraction = x / this.dragCfg.containerMaxx; > > var f = this.dragCfg.fractions; > > xPercent = Math.round(100 * fraction / (f - 1)) * (f - 1); > > > A more complete example is available > > at:http://bottledtext.blogspot.com/2007/06/bug-with-jquery-112-interface...