[Jquery][1.4.2][hover] different behavior in firefox and Opera
I'm using this code with jquery 1.4.2.
The code works correctly in IE 6,7,8 and Chrome build #(who knows).....
But it doesn't work in Firefox 3.6.3 or Opera 10
The page validates 100% perfect to the dtd and there are no client errors.
The desired behavior is that the gallery will scroll to the right or left when I hover over the respective arrow divs, and when I take the mouse off the div the scrolling should stop. In Chrome and IE the behavior is perfect. In Firefox, there is no scrolling at all, it just stays still.
Can anyone help me out?
thanks,
- scrollStep=3
- timerLeft=""
- timerRight=""
- function toLeft(id){
- document.getElementById(id).scrollLeft=0
- }
- function scrollDivLeft(id){
- clearTimeout(timerRight)
- document.getElementById(id).scrollLeft+=scrollStep
- timerRight=setTimeout("scrollDivLeft('"+id+"')",10)
- }
- function scrollDivRight(id){
- clearTimeout(timerLeft)
- document.getElementById(id).scrollLeft-=scrollStep
- timerLeft=setTimeout("scrollDivRight('"+id+"')",10)
- }
- function toRight(id){
- document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
- }
- function stopMe(){
- clearTimeout(timerRight)
- clearTimeout(timerLeft)
- }
- $(document).ready(function(){
- $(function(){
- $('#left_scroll').hover(
- function(){
- scrollDivRight('gallery_container');
- },
- function(){
- stopMe();
- }
- );
- });
- $(function(){
- $('#right_scroll').hover(
- function(){
- scrollDivLeft('gallery_container');
- },
- function(){
- stopMe();
- }
- );
- });
- }
Here is the relevant HTML