Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Jul 2008
    Posts
    113
    Plugin Contributions
    0

    Default Here's a Super Easy Slideshow

    I've been looking for a really easy slideshow for my front page. Here's some free code I found (the credits are in the code.)

    I pasted this into define_main_page.php (in the Admin area, go to Tools, and then Define Pages Editor and you'll see that page on the picklist.)

    With this slideshow code, you can link to images from anywhere. And you can specify an url for each individual image so the photos are linkable. You can link to specific pages or categories in your shop.

    Code:
    <div id="welcome">
    
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    
    /*
    Script by FPMC at http://jsarchive.8m.com
    Submitted to JavaScript Kit (http://javascriptkit.com)
    For this and 400+ free scripts, visit http://javascriptkit.com
    */
    
    //set image paths
    src = ["../images/slideshow/slides1.jpg", 
    "../images/slideshow/slides2.jpg", 
    "../images/slideshow/slides3.jpg", 
    "../images/slideshow/slides4.jpg", 
    "../images/slideshow/slides5.jpg"]
    
    
    //set corresponding urls
    url = ["http://freewarejava.com", 
    "http://javascriptkit.com", 
    "http://dynamicdrive.com", 
    "http://dynamicdrive.com", 
    "http://dynamicdrive.com"]
    
    //set duration for each image
    duration = 5;
    
    //Please do not edit below
    ads=[]; ct=0;
    function switchAd() {
    var n=(ct+1)%src.length;
    if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
    document["Ad_Image"].src = ads[ct=n].src;
    }
    ads[n=(ct+1)%src.length] = new Image;
    ads[n].src = src[n];
    setTimeout("switchAd()",duration*1000);
    }
    function doLink(){
    location.href = url[ct];
    } onload = function(){
    if (document.images)
    switchAd();
    }
    //-->
    </SCRIPT>
    
    <A HREF="javascript:doLink();" onMouseOver="status=url[ct];return true;" 
    onMouseOut="status=''">
    <IMG NAME="Ad_Image" SRC="image1.gif" BORDER=0>
    </A>
    
    <p align="center"><font face="arial" size="-2">This free script provided by <a href="http://javascriptkit.com">JavaScript Kit</a></font></p>
    
    <br>
    </div>
    You'll see that I added a DIV at the beginning of this code, so I could format a little with CSS. This is necessary, or else the slideshow sits on top of anything else that's on the page. My CSS looks like this:

    Code:
    #welcome {
    	height:500px;
    	width: 500px;
    	margin: auto;
    	margin-bottom: 10px;
    }
    I think that's about as easy as it gets, for a slideshow.

  2. #2
    Join Date
    Jul 2008
    Posts
    113
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    I might add, that if you have javascript, mootools, jquery, or ajax or other fancy stuff on your ZenCart template, then you may run into conflict with this code because it calls for javascript. My template doesn't have any of that fancy stuff so the slideshow works fine.

    I'm posting the code in case it helps somebody but I don't know how to sort out javascript conflicts if you run into that. This code is posted as-is. I hope it's helpful. It's working very well for me.

  3. #3
    Join Date
    Oct 2009
    Posts
    37
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    daffy thanks for tip easy to instal runs fine on my computer but when I upload to website, it inserts then deletes a line (below images and above following text) giving a jumpy appearance also images load to left not center as on my computer did you run into any inconsistancies?
    Thanks Nick

  4. #4
    Join Date
    Mar 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    Just wanted to say thanks, this works perfectly for me.

  5. #5
    Join Date
    Dec 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    Is there any way to get this script to work where the Header Images go? I tried to put the code in my tbl_header.php but it just deleted my entire header so I switched back to just using an anitmated gif.

    Any help is apreciated.

  6. #6
    Join Date
    Jul 2010
    Posts
    33
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    That's nice but you have to make new banner images all the time with other products. I found another way to make dynamic auto new or special or random product banners using javascript - sql - css.
    Take a look!!! http://www.e-matrix.gr

  7. #7
    Join Date
    Jan 2011
    Location
    Texas, USA
    Posts
    173
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    I cannot get this to work.

    I place the script in /public_html/catalog/includes/languages/english/html_includes/define_main_page.php
    I place the images in /public_html/catalog/images
    I set image path to "/public_html/catalog/images/imagename.jpg"

    but it will not work.

    Thank you
    Ivanna

  8. #8
    Join Date
    Jul 2008
    Posts
    113
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    I think the path to the images is not correct.
    This is what I have in my file:

    //set image paths
    src = ["../images/slideshow/slides1.jpg",
    "../images/slideshow/slides2.jpg",
    "../images/slideshow/slides3.jpg",
    "../images/slideshow/slides4.jpg",
    "../images/slideshow/slides5.jpg"]

    My pictures are in the "slideshow" folder.
    So just remove that much if you have yours in the images folder.

  9. #9
    Join Date
    Jan 2011
    Location
    Texas, USA
    Posts
    173
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    I tried that very first time. When it does not work I try relative and absolute paths.
    I know it must be a path problem.

    I do not want to use different folder (slideshow) because I do not want the owner to mess with copying files from one folder to another. When she change the slide show, she will only change the image name.

    Also I did not enter this from the admin because it just show up as script so I go directly to the file /public_html/catalog/includes/languages/english/html_includes/barebones/define_main_page.php

    Perhaps this is the problem?

    How do you make it in admin area so the script willl not show?

  10. #10
    Join Date
    Jan 2011
    Location
    Texas, USA
    Posts
    173
    Plugin Contributions
    0

    Default Re: Here's a Super Easy Slideshow

    I found how to add script on admin area.
    I paste the script and check results in the browser. - Nothing.
    I go back to Admin area to check the code and only thing here is <script language="JavaScript"></script>

    Where is all the script gone?
    I think I should be able to see the script to change necessary parameters such as fade and duration.

    Ok, I can still see the script if I go to /public_html/catalog/includes/languages/english/html_includes/barebones/define_main_page.php

    The code is there but does not work

    I think this is a path problem.
    The script is here /public_html/catalog/includes/languages/english/html_includes/define_main_page.php
    The images are here /public_html/catalog/images

    I assume /public_html is root ?? That is why I set image path to "/public_html/catalog/images/imagename.jpg"

    If /public_html is root and image path is ../images then my file structure is wrong. Do I need folder /catalog ??

    I need some help please.

    Thank you
    Ivanna

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. How to embed slideshow made from Visual Slideshow Maker?
    By muodi in forum General Questions
    Replies: 1
    Last Post: 6 Dec 2010, 03:21 AM
  2. Super Orders 2.0 postage marks with Super Orders
    By sketchhgal in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 22 Mar 2009, 03:05 PM
  3. Replies: 0
    Last Post: 21 Jan 2009, 09:49 PM
  4. Here's an easy way to get Flash running in your define pages
    By iciblues in forum Customization from the Admin
    Replies: 1
    Last Post: 11 Jul 2007, 02:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR