This came from another topic, so I thought I'd post it in this section and link to it.
If you are looking to do a rotating product image, you can create an animated .gif with several products. However, that doesn't give you a big bang for the buck, as you can only link one URL to an image. If someone likes the product they just saw in one of the image frames, they still have to track it down. So, another solution? Here you go.
Let me start by giving credit where due. I came on this script at HecticDMC's site. It comes from Dynamic Drive, but I got Daniel's permission to post as well, since it's part of his site design.
Copy the script below and paste it anywhere you want the rotating images to appear. You will need to make the following changes:
Change each of the "fadeimages[n]" array items to your images.
Change each of the "linkimages[n]" array items to be the url corresponding to each of your images.
That's it!
You *can* make these changes as well:
Change the "slideshow_width" and "slideshow_height" if you are going to use different sized images. I've set it up so that you can just use the ones created by cafepress at 150 x 150.
Change the time for the "pause" if you want it shorter or longer.
Here's the script. Don't be skeered by code.
(Ahhh, forget it. I'm going to just post a text file.)
Part of the reason I'm hesitant to post code myself sometimes is that the message board messes up HTML If you look in there, you'll see where it changed instances of anchor code to the BBCode equivilent.
Try this:
Edit the post, then re-paste the script back in, as it should be. Click the Options link in the left hand side of the posting form, and disable HTML conversion. That should work. I hope. If not, maybe you could post a plain text file somewhere for peeps to download
Thanks, Daniel. I did the "code" tags, thinking that would basically put it up as formatted text, and I did a quick check and it looked fine. Strange how it BB'd the first two items in the array, but not the rest. Spawn of the Devil, computers are.
So, reposted with HTML off. Post here if you have problems. Someone should be able to fix them.
FYI, I'm working on tweaking it so that it can also rotate text along with the image and link. If successful, I'll post the new code and what changes to make.
Looks good - one last thing though - there are a few places where you see this:
****
what that's supposed to be is this:
<img
but the boards don't allow it. I typed it in by using the &code for the left angle brace - & l t ; without the spaces. This message board is weird sometimes Don't worry about reformatting the post again, it can be a pain, I know... if anyone doesn't read my explanation here.... well, we can point people to it later if they have issues
There. I just broke down and posted the text file link. You can also just look at my site and do a view source. Daniel's has an added javascript call that won't work on your site, so use mine if you "have to". Just buy some swag, willya?
I love it! I tried to add in my store but I get an error in frontpage. I visited Dynamic Drive and was able to 'get' a similar one Thanks so much. Could you check it out? I was thinking if I should put the rotation lower (below the 'browse products'.
What error were you getting? The one your using is nice with the sliding effect, and you could probably put in a text block below each image by putting a break tag and some short text at the end of each of your array list items.
It worked the first time I loaded your page, but then it came up with blank images and "undefined" scrolling through over and over. It didn't repeat. Then I reloaded, and it stuck on the first image. I closed the browser and clicked the link again, and it still froze on the first one.
When you say it gave you an error in frontpage, do you mean the software program, or your front page? If it's the software program, try putting the code inside as an html block. Frontpage is notorious for determining that you don't want some code snippet where you think you do, and it moves it.
I'm using this script as well and have noticed a problem of similar type mentioned here
quote:
came up with blank images and "undefined" scrolling through over and over. It didn't repeat. Then I reloaded, and it stuck on the first image. I closed the browser and clicked the link again, and it still froze on the first one.
I'm using the MSIE browser, most of my customers use this browser so... Just like the quoted above sometimes image sort of sticks, it often jumps over an image or skips a few, sometime it runs them all no problem. often you can click where the image doesn't show and you still go to the correct URL of image that should have shown. I figure it's just not always loading quite right. Occurences are very intermittent
Originally posted by Carl Humor: I love it! I tried to add in my store but I get an error in frontpage. I visited Dynamic Drive and was able to 'get' a similar one Thanks so much. Could you check it out? I was thinking if I should put the rotation lower (below the 'browse products'.
When you say it gave you an error in frontpage, do you mean the software program, or your front page? If it's the software program, try putting the code inside as an html block.
yes.. it's in the frontpage software. that's when i decided to check out the site and found a similar rotation. it worked the first time i tried. now when i checked the posts, aha! i saw the problem! it's the **** that should've been "<" and "img" anyway, i'm so happy with the current rotation though at times yes, it skips and does funny stuff (like what Jayce said) coz my sister has a different browser yet she sees it fine.