Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Location
    Vegas Baby!
    Posts
    332
    Plugin Contributions
    0

    Default Javascript on Main Page

    This is kind of a dumb-dumb question

    I want to use a dhtml slideshow from dynamic drive on my main page.

    Code:
    Step 1: Insert the below style sheet in the HEAD section of your page:
    
    <style type="text/css">
    
    /*set CSS for SPAN tag surrounding each image*/
    .seqslidestyle{
    margin-right: 15px;
    }
    </style>
    On WHICH page am I inserting this code (includes/languages/english/index.php???) , and WHERE exactly does it go? Do I put it before the opening <?php on the page or somewhere else?

    This is the script I'm looking at using:
    http://www.dynamicdrive.com/dynamici...frameslide.htm
    Completed: BellaFavori.com
    In Progress: WeddingDivasLV.com
    Coming Soon: ???

  2. #2
    Join Date
    Jan 2009
    Location
    Vegas Baby!
    Posts
    332
    Plugin Contributions
    0

    Default Re: Javascript on Main Page

    Ok, I think I got but it's not working very well. Guess it just needs some tweaking.
    Last edited by CharInLasVegas; 22 Oct 2009 at 05:16 AM.
    Completed: BellaFavori.com
    In Progress: WeddingDivasLV.com
    Coming Soon: ???

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Javascript on Main Page

    Try just adding the style rule to your stylesheet:
    Code:
    /*set CSS for SPAN tag surrounding each image*/
    .seqslidestyle{
    margin-right: 15px;
    }
    Embedding the styling in a file is only necessary if you don't have an external stylesheet.

  4. #4
    Join Date
    Jan 2009
    Location
    Vegas Baby!
    Posts
    332
    Plugin Contributions
    0

    Default Re: Javascript on Main Page

    Thanks, Glenn. I'm going to have to scratch this idea anyway, this slideshow doesn't work well & I can't find any other that shows multiple frames at the same time.
    Completed: BellaFavori.com
    In Progress: WeddingDivasLV.com
    Coming Soon: ???

  5. #5
    Join Date
    Sep 2007
    Posts
    47
    Plugin Contributions
    0

    Default Re: Javascript on Main Page

    I too am wanting a slide-show on the main page (only one frame though), and have got this running OK, except I can only load the additional jscript globally but I need it to only run on the main page. I can't get my head around the template system here, so any advise would be greatly appreciated. To get the additional javascript to load I have modded a template driven file:

    includes/templates/MY_TEMPLATE/common/html_header.php

    and hard-coded the links to the script files that are residing in:

    /includes/templates/MY_TEMPLATE/jscript/

    echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/file1.js"></script>'."\n";
    echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/file2.js"></script>'."\n";
    echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/file3.js"></script>'."\n";

    It looks to me like they are supposed to auto-load but nothing happens unless I hard code it. Existing code snip below:

    /**
    * load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
    */
    $directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
    while(list ($key, $value) = each($directory_array)) {
    echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
    }

    /**
    * load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
    */
    $directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
    while(list ($key, $value) = each($directory_array)) {
    echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
    }

    -------------------------------

    I have tried getting the script to load by adding the script files into:

    includes/modules/pages/index/

    but it doesn't work.


    --------------------------------

    So does anyone know where to put the script file so that ONLY a specific page within Zen Cart will load it? I have read several articles saying it can be done, but none of the instructions are right....

    Adrian

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Javascript on Main Page

    load all site-wide jscript_*.js files

    You need to name the files according to the convention so they will be picked up.

    jscript_file1.js
    jscript_file2.js
    jscript_file3.js

    or something more descriptive.

 

 

Similar Threads

  1. Help Remove catagories off main page, but list subcatagories of main page
    By MadPricerSales in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 26 Mar 2010, 04:14 AM
  2. Feature products on category main page, but not on main home page
    By gems14k in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 17 Sep 2009, 03:47 PM
  3. flash on main page with javascript ASAP
    By MaxBodine in forum General Questions
    Replies: 4
    Last Post: 23 Jul 2009, 03:19 PM
  4. Problems integrating php/javascript on main page
    By webrock in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Jan 2009, 05:20 AM
  5. Calling Javascript file from main page
    By praiseandplay in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 5 Aug 2006, 04:41 AM

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