View Single Post
ישן 22-08-06, 13:49   # 2
Itay
חבר מתקדם
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 35
הודעות: 564

Itay לא מחובר  

משו שעשיתי מזמן.. איזה אחד ביקש פה משהו דומה לפני כמה חודשים
קוד:
<html>
<head>
<title>Image changer</title>
<script type="text/javascript">
var imgs = new Array
(
    "images/align-center.gif",
    "wysiwyg.jpg"
);
var id = 0;

function Next()
{
    id++;
    if(id >= imgs.length-1)
        id = imgs.length-1;
    document.getElementById('Images').src=imgs[id];
}

function Back()
{
    id--;
    if(id < 0)
        id = 0;
    document.getElementById('Images').src=imgs[id];
}
</script>
</head>

<body>
<img src="images/align-center.gif" id="Images" alt="" /><br />
<input type="button" value="<- Back" onclick="javascript:Back()" /> <input type="button" value="Forward ->" onclick="javascript:Next()" />
</body>
</html>
עובד ב-IE ו-FF..
  Reply With Quote