Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

position:fixed sliders not reacting correctly to mouse events #16

Closed
freqdec opened this issue Feb 20, 2012 · 4 comments
Closed

position:fixed sliders not reacting correctly to mouse events #16

freqdec opened this issue Feb 20, 2012 · 4 comments
Labels

Comments

@freqdec
Copy link
Owner

freqdec commented Feb 20, 2012

If a slider is position:fixed, clicking on the range bar will not animate the drag-handle to the click-point. The code needs updated to correctly calculate the click position when fixed positioning is used.

@ghost
Copy link

ghost commented Sep 14, 2012

Any idea on how to fix this? I'm using the slider inside a Twitter Bootstrap modal and although dragging the handle works, clicking on the range bar doesn't.

@padraicm
Copy link

padraicm@35efc37

@ghost
Copy link

ghost commented Jan 21, 2013

Can you please merge @padraicm's code in in? At the moment you have a broken implementation, you need to remove this line - https://github.com/freqdec/fd-slider/blob/master/js/fd-slider.js#L785
Otherwise you are stepping up 2 levels at a time (once inside the loop, then once inside the condition).
If you want to keep the obj = obj.offsetParent in the loop, just check for while(obj) instead of doing the assignment. e.g

                do {
                    curleft += obj.offsetLeft;
                    curtop  += obj.offsetTop;
                    obj      = obj.offsetParent;
                } while(obj);

@ghost
Copy link

ghost commented Jan 21, 2013

I've created a pull request - #39 which removes the unnecessary assignment that should fix this bug.

freqdec added a commit that referenced this issue Jan 21, 2013
Remove unnecessary assignment from `locate` loop #16
@freqdec freqdec closed this as completed Mar 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants