私は一種の視差ウェブデザインをしようとしています。私の質問は、もし誰かが私が赤色のdivをより速く動かすことができるのを知っていれば。私はそれがフォーミュラにあるとは思うが、確かに分かっていない。多分誰かが知っている?ここでdivのスクロール速度を上げるにはどうすればよいですか?
は私のコードです:http://jsfiddle.net/PvVdq/
$(document).ready(function() {
var $horizontal = $('#horizontal');
$(window).scroll(function() {
var s = $(this).scrollTop(),
d = $(document).height(),
c = $(this).height();
scrollPercent = (s/(d - c));
var position = (scrollPercent * ($(document).width() - $horizontal.width()));
$horizontal.css({
'left': position
});
});
});
の可能性のある重複[遅いスクロール速度ダウン(https://stackoverflow.com/questions/ 23950450 /スロースクロールスピードダウン) –
var position =(scrollPercent * 3 *($(document).width() - $ horizontal.width())); –