slwr: smooth slider scroll, mobile style
This commit is contained in:
parent
a371dca36b
commit
47e12e1080
@ -51,3 +51,20 @@ div.controlpoint{
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--- MOBILE ---*/
|
||||||
|
@media only screen
|
||||||
|
and (max-width : 1024px) {
|
||||||
|
|
||||||
|
div#sliders {
|
||||||
|
position: absolute;
|
||||||
|
top: -50px;
|
||||||
|
left: -50px;
|
||||||
|
transform: scale(0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
#curve {
|
||||||
|
padding-top: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -55,12 +55,12 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#slider').bind('slide.pathslider', function(event, slider){
|
$('#slider').bind('slide.pathslider', function(event, slider){
|
||||||
var scrollPos = slider.percent * ( $('#curve')[0].scrollHeight - $(window).height() ) / 100
|
var scrollPos = slider.percent * ( $('#curve')[0].scrollHeight - $(window).height() ) / 100
|
||||||
$('#curve').scrollTop(scrollPos);
|
$('#curve').stop().animate({scrollTop: scrollPos}, 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#slider2').bind('slide.pathslider', function(event, slider){
|
$('#slider2').bind('slide.pathslider', function(event, slider){
|
||||||
var scrollPos = slider.percent * ( $('#curve')[0].scrollHeight - $(window).height() ) / 100
|
var scrollPos = slider.percent * ( $('#curve')[0].scrollHeight - $(window).height() ) / 100
|
||||||
$('#curve').scrollTop(scrollPos);
|
$('#curve').stop().animate({scrollTop: scrollPos}, 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user