Autor Zpráva
tomas3333
Profil *
caute, mám tento kód, a potrebujem do neho nejakym sposobom vlozit, aby si zapamataval cookies. nasiel som nejaky navod v anglictine, ale javasriptu nerozumiem takze ... asi tak...


<html>

<head></head>
<body>
<script>
preloadm2 = new Image();
preloadm2.src = "../../file/web/buttons/m2-over.jpg";

preloadrtw = new Image();
preloadrtw.src = "../../file/web/buttons/rtw-over.jpg";

preloadmtw = new Image();
preloadmtw.src = "../../file/web/buttons/mtw-over.jpg";

preloadstw = new Image();
preloadstw.src = "../../file/web/buttons/stw-over.jpg";

preloadforum = new Image();
preloadforum.src = "../../file/web/buttons/forum-over.jpg";

m2 = "../../file/web/buttons/m2.jpg";
rtw = "../../file/web/buttons/rtw.jpg";
mtw = "../../file/web/buttons/mtw.jpg";
stw = "../../file/web/buttons/stw.jpg";
forum = "../../file/web/buttons/forum.jpg";

</script>

<div><img src="../../file/web/buttons/m2.jpg" onmouseover="this.src=preloadm2.src" onmouseout="this.src=m2" onclick="document.getElementById('m2').style.display='block';document. getElementById('rtw').style.display='none';document.getElementById('rt r').style.display='none';document.getElementById('mtw').style.display= 'none';document.getElementById('stw').style.display='none';" style="cursor:hand; border-top-width:2px; border-left-width:2px; border-right-width:2px; border-bottom-width:0px; border-color:#000000; border-style:solid"></div>
<div><img src="../../file/web/buttons/rtw.jpg" onmouseover="this.src=preloadrtw.src" onmouseout="this.src=rtw" onclick="document.getElementById('m2').style.display='none';document.g etElementById('rtw').style.display='block';document.getElementById('rt r').style.display='block';document.getElementById('mtw').style.display ='none';document.getElementById('stw').style.display='none';" style="cursor:hand; border-top-width:2px; border-left-width:2px; border-right-width:2px; border-bottom-width:0px; border-color:#000000; border-style:solid"></div>
<div><img src="../../file/web/buttons/mtw.jpg" onmouseover="this.src=preloadmtw.src" onmouseout="this.src=mtw" onclick="document.getElementById('m2').style.display='none';document.g etElementById('rtw').style.display='none';document.getElementById('rtr ').style.display='none';document.getElementById('mtw').style.display=' block';document.getElementById('stw').style.display='none';" style="cursor:hand; border-top-width:2px; border-left-width:2px; border-right-width:2px; border-bottom-width:0px; border-color:#000000; border-style:solid"></div>
<div><img src="../../file/web/buttons/stw.jpg" onmouseover="this.src=preloadstw.src" onmouseout="this.src=stw" onclick="document.getElementById('m2').style.display='none';document.g etElementById('rtw').style.display='none';document.getElementById('rtr ').style.display='none';document.getElementById('mtw').style.display=' none';document.getElementById('stw').style.display='block';" style="cursor:hand; border-top-width:2px; border-left-width:2px; border-right-width:2px; border-bottom-width:0px; border-color:#000000; border-style:solid"></div>
<div><a href="http://totalwar.herniweb.cz/forum" target="_blank"><img src="../../file/web/buttons/forum.jpg" onmouseover="this.src=preloadforum.src" onmouseout="this.src=forum" style="cursor:hand; border-top-width:2px; border-left-width:2px; border-right-width:2px; border-bottom-width:2px; border-color:#000000; border-style:solid"></a></div>

<div id="m2" style="display:none">m2</div>
<div id="rtw" style="display:none">rtw</div>
<div id="rtr" style="display:none">rtr</div>
<div id="mtw" style="display:none">mtw</div>
<div id="stw" style="display:none">stw</div>
</body>
</html>


thx
DJ Miky
Profil
A co chceš v tomto skriptu ukládat do cookies?
tomas3333
Profil *
tak na webe to mam urobene tak, ze po kliknuti na obrazok sa otvori iny panel. tak chcem, aby si to zapamatalo panel, ktory bol otvoreny aby sa nemuselo po kazdou loade stranky zase urcovat ten panel
peta
Profil
jakpsatweb - javascript - priklady - cookies
kekso
Profil *
Praca s cookies v JS:
www.kasman.sk/index.php?id_clanku=876&
tomas3333
Profil *
tutorialy si viem najst aj ja. ale co mi to pomoze, ked ten kod neviem zostavit dokopy? jednoducho klikanim na obrazky si zobrazujem divy. a chcem, aby sa naposledy zobrazeny div ulozil do cookies. pouzivam priblizne ten kod ktory som dal hore.
peta
Profil
tomas3333
jakpsatweb - javascript - priklady - cookies
http://www.volny.cz/peter.mlich/ - tam pouzivam presne neco podobne pro skiny
http://www.volny.cz/peter.mlich/www.htm#mssub11 - tam je nejaky priklad na cookies
http://www.volny.cz/peter.mlich/hry/hry.htm - nejaka hra ma zapisovani skore do cookies
http://www.volny.cz/peter.mlich/www.htm - a potom je tam spousta dalsich prikladu...
Toto téma je uzamčeno. Odpověď nelze zaslat.

0