zrobiłem sobie scroll-a informacji i teraz bym jeszcze chciał dodać aby jak się najedzie myszką na div w którym jest scroll aby się mi zatrzymało przewijanie
kokmbinuje z onMouseOver, onBlur i nie wiem czemu mi nie chce działaś lub nie wiem czego użyć
proszę o podpowiedzi
Kod
var i = 0;
var j = 250;
var k = 500;
var l = 750;
var m = 1000;
var n = 1250;
var speed = 25;
function imgScroll(){
document.getElementById("scroll_div_1").style.left = i + "px";
document.getElementById("scroll_div_2").style.left = j + "px";
document.getElementById("scroll_div_3").style.left = k + "px";
document.getElementById("scroll_div_4").style.left = l + "px";
document.getElementById("scroll_div_5").style.left = m + "px";
document.getElementById("scroll_div_5").style.left = m + "px";
i--;
j--;
k--;
l--;
m--;
if (i < -250) { i = 1000; }
if (j < -250) { j = 1000; }
if (k < -250) { k = 1000; }
if (l < -250) { l = 1000; }
if (m < -250) { m = 1000; }
//alert(document.getElementById('scroll_container'));
if (document.getElementById('scroll_div_1').onmouseover || document.getElementById('scroll_div_2').onmouseover){
speed = 0;
}
scroller = setTimeout("imgScroll()", speed);
}
onload = imgScroll;
var j = 250;
var k = 500;
var l = 750;
var m = 1000;
var n = 1250;
var speed = 25;
function imgScroll(){
document.getElementById("scroll_div_1").style.left = i + "px";
document.getElementById("scroll_div_2").style.left = j + "px";
document.getElementById("scroll_div_3").style.left = k + "px";
document.getElementById("scroll_div_4").style.left = l + "px";
document.getElementById("scroll_div_5").style.left = m + "px";
document.getElementById("scroll_div_5").style.left = m + "px";
i--;
j--;
k--;
l--;
m--;
if (i < -250) { i = 1000; }
if (j < -250) { j = 1000; }
if (k < -250) { k = 1000; }
if (l < -250) { l = 1000; }
if (m < -250) { m = 1000; }
//alert(document.getElementById('scroll_container'));
if (document.getElementById('scroll_div_1').onmouseover || document.getElementById('scroll_div_2').onmouseover){
speed = 0;
}
scroller = setTimeout("imgScroll()", speed);
}
onload = imgScroll;
obecnie działa to tak ze na starcie widać 3 całe div-y później w miarę przesuwania 1 się chowa a 4 pokazuje a ogólnie jak widać jest 6 div-ów