Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Golive: random image action and sliced images

Golive: random image action and sliced images
Thread Tools
TRF
Fresh-Faced Recruit
Join Date: Aug 2003
Location: Alabama
Status: Offline
Reply With Quote
Aug 23, 2003, 09:04 AM
 
I am using the random image action on my webpage. Three images in rotation.

Large images, though--both in file size and dimensions about 24-30 K each. I have compressed as low as image quality will allow.

I want to know if you can combine the action of the random image with the benifits of sliced images.

In other words, can I have rotating sliced images?

Part two: Can the random image action be expanded to rotate more than three images at a time? I found a six image action on the net, but it would only display the first three and it ignored the rest.

Thanks--


Tim
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Aug 23, 2003, 11:21 AM
 
i would imagine you could do something with php. let's say you have images a1-a6, b1-b6, etc., you could then have it load up all six... surely?

i'm sure some kind soul might be able to provide such a code
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Registered User
Join Date: Jul 2003
Location: San Jose
Status: Offline
Reply With Quote
Aug 23, 2003, 03:05 PM
 
for the one that i use, i place the html into an array and then call the script from the main page....

so the random_pic.js script would look like

[php]
function oneOf(arr) {
return arr[Math.floor(Math.random()*arr.length)];
}

newstuff = new Array("<a href=portfolio/stanford/stanford.htm><img src=portfolio/stanford/images/stanford_cutout.jpg border=0><br>Stanford Triathlon</a>",
"<a href=portfolio/pumatech/pumatech.htm><img src=portfolio/pumatech/images/pumatech_cutout.jpg border=0><br>Pumatech</a>",
"<a href=portfolio/esale/esale.htm><img src=portfolio/esale/images/esale_cutout.jpg border=0><br>eSale</a>");
oldstuff = new Array("<a href=portfolio/src/src.htm><img src=portfolio/src/images/src_cutout.jpg border=0><br>Arizona State University</a>",
"<a href=portfolio/buzz/buzz.htm><img src=portfolio/buzz/images/buzz_cutout.jpg border=0><br>Buzz Jensen's Sound Advice</a>",
"<a href=portfolio/apricot/apricot.htm><img src=portfolio/apricot/images/apricot_cutout.jpg border=0><br>Apricot Hosting Solutions</a>");

var page1 = oneOf(newstuff)
var page2 = oneOf(oldstuff)

document.write(page1);
document.write('<br>&nbsp;<br>');
document.write(page2);
[/php]

and then you would call it from the main page like this

[php]
<html>

<head></head>

<body>

<script language="JavaScript" src="random_pic.js" type="text/javascript"></script>

</body>

</html>
[/php]

so you can adapt this to place the html for the sliced images into the array and expand it to however many images you want to use...
(Last edited by mzllr; Aug 23, 2003 at 04:06 PM. )
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:20 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2