CGI for Slide show
Mark Wieder
mwieder at ahsoftware.net
Thu Oct 12 14:00:33 EDT 2006
Viktoras-
Thursday, October 12, 2006, 2:47:28 AM, you wrote:
> This is how your image tag might look like for a slideshow of 15 images:
> img src="im1.jpg"
> name="thisIm"
> alt="Click to change image"
> galleryimg="no"
> onclick="if (i<=15) {i++}; else {i=1}; thisIm.src='im'+i+'.jpg';"
> The script still has to be adjusted for Non MSIE browsers, current version
> works on MSIE.
The reason it doesn't work on non-msie browsers is that it's
badly-formed javascript. I really don't understand why people have a
reluctance to declare variables. Here's the same thing working on any
javascript-enabled browser. All I did was declare the variable.
<script language=javascript>
var i;
function changeImage()
{
if (i < 15)
i++;
else
i = 1;
thisIm.src='Assets/im'+i+'.jpg';
}
</script>
<img src="Assets/im15.jpg"
name="thisIm"
alt="click to change image"
galleryimg="no"
onclick=changeImage()>
--
-Mark Wieder
mwieder at ahsoftware.net
More information about the use-livecode
mailing list