Paulinjsh Posted May 18, 2006 Report Share Posted May 18, 2006 (edited) Ir divs: <div id="scroller" style="overflow: hidden; width: 193px;"></div> kurā ir kkaut kāds saturs. Ir 2 pogas: <a href="java script:void(0)" onmouseover="scroll(-1);" onmouseout="stopScroll();"><img src="images/summer/rf-foto-open-prev-button.gif" alt="" /></a> viena scroll šo divu pa kreisi, otra pa labi. Ir sekojošs javascript, kas to dara: scrolltimer = null; function scroll(speed) { var page = document.getElementById("scroller"); page.scrollLeft += speed; if (!scrolltimer){ scrolltimer = window.setInterval("scroll("+speed+")", 5); } } function stopScroll(){ window.clearInterval(scrolltimer); scrolltimer = null } Problēma tāda, ka uz ie un ff darbojas, uz opera nē. Vajadzētu atrast risinājumu, lai darbotos uz visiem pārlūkiem. Edited May 18, 2006 by Paulinjsh Link to comment Share on other sites More sharing options...
Delfins Posted May 18, 2006 Report Share Posted May 18, 2006 Tev grūti notreisot? Vai ta mums te tagad jāsēž un jādara viss tavā vietā? Nāc ar konkrētu problēmu... Link to comment Share on other sites More sharing options...
v3rb0 Posted May 18, 2006 Report Share Posted May 18, 2006 vismaz varēja parādīt ko saka operas js conzole - gan jau ka kādu kļūdu. vai arī iedot gabalu kuru var copy/paste tukšā failā un apstīties kas tur nestrādā, bet lipināt pa rindām kopā un meklēt kļūdu - sorry, diez vai kāds gribēs šitādā pavasra laikā. Link to comment Share on other sites More sharing options...
Paulinjsh Posted May 18, 2006 Author Report Share Posted May 18, 2006 Problēma ir šeit page.scrollLeft += speed; Konsolē nekādu error nav. Link to comment Share on other sites More sharing options...
Delfins Posted May 18, 2006 Report Share Posted May 18, 2006 tad lasi Operas JS speceni... vai guglē... Link to comment Share on other sites More sharing options...
bubu Posted May 18, 2006 Report Share Posted May 18, 2006 Vai tik nevajag +"px" pielikt klāt, ne? Link to comment Share on other sites More sharing options...
Recommended Posts