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

Slider not updated when hidden #11

Closed
sowdri opened this issue Aug 24, 2013 · 3 comments
Closed

Slider not updated when hidden #11

sowdri opened this issue Aug 24, 2013 · 3 comments

Comments

@sowdri
Copy link

sowdri commented Aug 24, 2013

When the slider is hidden while initializing, the markers are not in the correct position.
Refer the following fiddle for the problem:
http://jsfiddle.net/sowdri/8vbyD/2/

Thanks,

@sowdri
Copy link
Author

sowdri commented Aug 24, 2013

This happens because of jquery returning width=0; when element is hidden.

#352
var getSize = function(){
normalWidth = $rangeSlider.width(); // this line returns 0
if($singleSlider) {
sliderWidth = $singleSlider.width();
} else {
sliderWidth = $fromSlider.width();
}
fullWidth = normalWidth - sliderWidth;
};

Workaround, is to render the slider only when the parent is visible. Checkout a modified fiddle:
http://jsfiddle.net/sowdri/8vbyD/5/

Thanks,

@IonDen
Copy link
Owner

IonDen commented Aug 24, 2013

Hi, @sowdri , is it really need? I think it is quite hard to trace the visibility of slider. But it is quite easy to do that on your side. For example you may call "update" method on slider, than making it visible.

@sowdri
Copy link
Author

sowdri commented Aug 26, 2013

Oh, I'vent tried update method. I'll try that, and will let you know. Thank you for the wonderful widget, hopefully this is the only one that works on all devices.

@IonDen IonDen closed this as completed Oct 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants