Kód: Vybrať všetko
function imageSize(mode,cas,obr,imgSize) {
growImg = document.getElementById(obr).style;
growImg.width=window['img_width'+obr];// chybu hlasi tuKód: Vybrať všetko
function imageSize(mode,cas,obr,imgSize) {
growImg = document.getElementById(obr).style;
growImg.width=window['img_width'+obr];// chybu hlasi tu
Kód: Vybrať všetko
<script language="JavaScript">
//dynamic image resizing
timer = null;
img_widthimageResize = 352; //image starting width and height goes here
img_heightimageResize = 277;
img_widthimageResize2 = 313; //image starting width and height goes here
img_heightimageResize2 = 246;
img_widthimageResize3 = 313; //image starting width and height goes here
img_heightimageResize3 = 246;
function imageSize(mode,cas,obr,imgSize) {
//document.getElementById("demo").innerHTML=window['img_width'+obr];
growImg = document.getElementById(obr).style
growImg.width=window['img_width'+obr];
growImg.height= window['img_height'+obr];
if(mode == 1)
{
if(sessionStorage['grow'+obr] == 1 && cas == 0)
{
return;
}
if(cas == 0)
{
sessionStorage['grow'+obr] = 1;
sessionStorage['shrink'+obr] = 0;
}
}
else
{
if(sessionStorage['shrink'+obr] == 1 && cas == 0)
{
return;
}
if(cas == 0)
{
sessionStorage['shrink'+obr] = 1;
sessionStorage['grow'+obr] = 0;
}
}
cas++;
if((window['img_width'+obr] != imgSize) && (mode == 1) && (sessionStorage['grow'+obr] == 1)) {
window['img_width'+obr] += 1*mode;
window['img_height'+obr] += 1*mode;
timer = setTimeout('imageSize('+mode+','+cas+',\''+obr+'\','+imgSize+')', 10);
}
else if((window['img_width'+obr] != imgSize) && (mode == -1) && ((sessionStorage['shrink'+obr] == 1) )) {
window['img_width'+obr] += 1*mode;
window['img_height'+obr] += 1*mode;
timer = setTimeout('imageSize('+mode+','+cas+',\''+obr+'\','+imgSize+')', 10);
}
else {
if(mode==1)
{
//sessionStorage.shrink = 1;
sessionStorage['grow'+obr] = 0;
}
else if(sessionStorage['shrink'+obr] == 0)
{
timer = setTimeout('imageSize('+mode+','+cas+',\''+obr+'\','+imgSize+')', 1);
}
clearTimeout('timer');
}
}
</script>Kód: Vybrať všetko
<img src="nove.png" alt="" width="352" height="277" id="imageResize" onmouseover="imageSize(1,0,'imageResize',392);" onmouseout="imageSize(-1,0,'imageResize',352);" />Kód: Vybrať všetko
$(".element").bind("mouseover", funkcia_ked_prejde);
$(".element").bind("mouseout", funkcia_ked_odide);Kód: Vybrať všetko
<img src="nove.png" alt="" width="352" height="277" id="imageResize" onmouseover="this.width=xxx; this.height=xxx;" onmouseout="this.width=xxx; this.height=xxx" />Kód: Vybrať všetko
<!DOCTYPE html>Kód: Vybrať všetko
growImg = document.getElementById(obr).style;Kód: Vybrať všetko
growImg.width=window['img_width'+obr]+'px';
growImg.height= window['img_height'+obr]+'px';