script - Slideshow in Rev using one page

Jim Ault jimaultwins at yahoo.com
Tue Dec 22 13:17:14 EST 2009


This uses
    <meta HTTP-EQUIV='refresh' CONTENT='10; URL=
tag to tell the browser to refresh after 10 seconds
and what url to send.

----------start here-----------
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Demo of Sequential Slide Show Using a Param<?title>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />

<?rev
# using (html & javascript)-legal single quotes makes things easier
put "slideShowParams" into thisPageName
get "<meta HTTP-EQUIV='refresh' CONTENT='10; URL="
get IT & thisPageName
get IT & ".irev?pImageNum=zNextImgNumberz'>"
put IT into refreshTag --keep this string for later

#Jacque's lists of copyrighted images (7)
         get "vinca.jpg thistleFluff.jpg pinkHoneysuckle2.jpg"
         get IT && "milkweed2.jpg lamiumClose2.jpg cosmos2.jpg  
clematis3.jpg"
         put IT into imageList

put $_GET["pImageNum"] into pImageNum
put "new $_GET[ pImageNum ]  equals " & pImageNum

#detect conditions and react
try
     if pImageNum is not a number then put 1 into pImageNum
catch errnum
     put 1 into pImageNum
end try
get the number of words in imageList
if pImageNum > IT then
    put 1 into pImageNum
end if
put word pImageNum of imageList into tFlower --for this page
put pImageNum + 1 into nextImgNumber  --for next time
replace "zNextImgNumberz" with nextImgNumber in refreshTag
put refreshTag --write this line in the head section
?>
</head>
<body>
     <div > <p>Seven of  Jacque's copyrighted images in sequence  
(looping)</p>
         <blockquote>
             <img src='<?rev  put tFlower ?> ' width='320'  
height='240' border='1' />
         </blockquote>
     </div>
<?rev put "(this, next) equals.. (" & pImageNum &", " && nextImgNumber  
& ")" ?>

</body>
</html>
---------------------------------

Working example running on a 10 second cycle.
           http://ampower.on-rev.com/slideshow/slideShowParams.irev

Many variations possible.

Hope this helps someone.

Jim Ault
Las Vegas






More information about the Use-livecode mailing list