scrolling v javascripte
scrolling v javascripte
napísal by mi niekto skrolovanie v js aby obrazky v nejakom ramci isli s lava do prava niečo take ako je na triko.sk (tie tricka ) ale nie z hora dole ale z lava do prava...dufam ze som to vysvetlil ako clovek
Originál toho skriptu je TU
Neviem či tam chceš to posúvanie keď si nad šípkou, alebo tam chceš automatické posúvanie. Upravil som ten skript, aby sa v ňom rolovalo horizontálne (takže sa pozri, ako to funguje):
Neviem či tam chceš to posúvanie keď si nad šípkou, alebo tam chceš automatické posúvanie. Upravil som ten skript, aby sa v ňom rolovalo horizontálne (takže sa pozri, ako to funguje):
- Prílohy
-
- scroll.rar
- (4.27 KiB) 63 stiahnutí
ale praveze mam jeden problem...ten web je v X-HTML Transitional a ked to dam do neho tak neviem ako vyriesit
Kód: Vybrať všetko
Error Line 21 column 25: there is no attribute "onMouseover".
<a href="#" onMouseover="moveleft()" onMouseout="clearTimeout(moveleftvar)"><im
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
Vyskúšaj:
Kód: Vybrať všetko
<a href="#" onmouseover="moveleft()" onmouseout="clearTimeout(moveleftvar)">dik...nevies mi poradit ostatok http://validator.w3.org/check?uri=http://test.dnw.sk
Keďže to má byť xhtml, odpadá podpora starších prehliadačov a teda sa môžu vyhodiť zastaralé tagy (layer a ilayer). Takisto sa môže ten javaskript zjednodušiť.
Ešte malá poznámka. Sú dva spôsoby, ako zmeniť rýchlosť:
1. zmeniť premennú speed (t.j. o koľko bodov sa ten obsah posunie)
2. zmeniť čas vo funkciách setTimeout (možno by sa pre to mala tiež urobiť premenná)
Ešte malá poznámka. Sú dva spôsoby, ako zmeniť rýchlosť:
1. zmeniť premennú speed (t.j. o koľko bodov sa ten obsah posunie)
2. zmeniť čas vo funkciách setTimeout (možno by sa pre to mala tiež urobiť premenná)
- Prílohy
-
- scroll.rar
- (4.27 KiB) 65 stiahnutí