Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    22
    Plugin Contributions
    0

    Default Using jquery for new slideshow?

    Hello all,
    I'm trying to build a new slideshow using the jquery "Cross Slide". I really wanted to understand some the of the new features used in Zen Cart 2.0 so I've tried to duplicate the same setup used in "jqlightbox" plug-in. https://www.zen-cart.com/forum/showt...ghlight=jquery

    My problem is I don't understand exactly how the jqlightbox.php file added into the page you want it added on or how Zen Cart determines when the other files under jscript directory are required to be added in the header.

    I've built the following files and need to know what next steps should be.
    In the directory: includes/templates/(MY_TEMPLATE)/jscript/
    /auto_loaders/jscript_crossslide.php
    /jquery/jquery_crossslide-0.3.3.js
    jqcrossslide.php

    I doing this on the home page on my test site here.
    http://www.pot-gardens.com/catalog/

    Thanks, Steven

  2. #2
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Using jquery for new slideshow?

    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  3. #3
    Join Date
    Sep 2008
    Posts
    22
    Plugin Contributions
    0

    Default Re: Using jquery for new slideshow?

    Thanks yellow1912.

    I can tell already I have a problem in my $pages variable.
    What value do I use to have it on define pages "define_main_page.php"?

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Using jquery for new slideshow?

    you will need to use call back for that.
    create a function like this

    function this_is_home_page()
    {
    global $this_is_home_page;
    return $this_is_home_page;
    }
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Sep 2008
    Posts
    22
    Plugin Contributions
    0

    Default Re: Using jquery for new slideshow?

    Thanks for information so far but I'm still not figuring this out.
    I'm just a beginner with JavaScript and only slightly better in php. I like Zen Cart and its available options (a lot), but trying to trace all the calls with this cart is very confusing.

    I thought trying to add a simple slide show using the new features from yellow1912 would be good learning experience. I still want to learn so I'm hope you will indulge me in asking more questions.

    I'm not certain I know where my problems are.
    1. jscript_crosslide.php (in jscript/auto_loaders). I understand I need to setup a call_back to make it work as define_main_page is not actual page name. However every time I try to put in "call_backs" variable my whole zen cart stops working. (I put in an if clause at front just to try and turn it on and off for now, didn't work.)
    Code:
    <?php
    if (1==1) {
    $call_backs = ('jqCrossSlide_here');
    $jscripts[] = array('conditions' => array('call_backs' => $call_backs),
    'files' => array('jquery-1.3.2.min.js' => array('path' => 'jquery/','order' => 1), 
    'jquery.crossslide-0.3.3.js' => array('path' => 'jquery/','order' => 11), 
    'jquery.ondemand.js' => array('path' => 'jquery/','order' => 11),
    'jqcrossslide.php' => array('path' => '','order' => 12)
     ));
    }

    2. I need to create a function "jqCrossSlide_here" to initiate the call back to javascript code. I'm not sure where this function goes in Zen Cart. I thought maybe I need to create a php page in "functions/extra_functions". Do this actually go into the define_main_page.php? I created the following page "functions_crossslide.php" and inserted this code:
    Code:
    function jqCrossSlide_here(){
    	global $jqCrossSlide_here;
    	return $jqCrossSlide_here;
    }
    3. Exactly what should I be inserting into the define_main_page.php? For now I tried the following:
    Code:
    <?php
      jqCrossSlide_here();
    ?>
    <div id="jqCrossSlideMain" class="jqcrossslide" style="border: 2px solid; margin: 1em auto; padding: 0px; overflow: hidden; position: relative; height: 500px; width: 500px;">
    &nbsp;</div>
    4. Here is the javascript from my jqcrossslide.php file (in jscript/).
    Code:
    <script language="javascript" type="text/javascript"><!--
    $(document).ready(function(){
    	$("#jsCrossSlideMain").crossSlide({fade:1},[
    		{
    			src:  'images/Cosmos_SontataCarmine.jpg',
    			from: '100% 80% 1x',
    			to:   '100% 0% 1.7x',
    			time: 3
    		}, {
    			src:  'images/Geranium_MegaPinkSplash.jpg',
    			from: 'top left',
    			to:   'bottom right 1.5x',
    			time: 2
    		}
    	]);
    })
    //--></script>
    I've tried to read the following, but not figured it out so far.
    http://www.zen-cart.com/forum/showthread.php?t=114609
    All Wiki pages at http://wiki.rubikintegration.com/zen...t_loader/about
    Both jqlightbox and jqzoom from http://public.rubikintegration.com/

    Thanks, Steven

  6. #6
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Using jquery for new slideshow?

    For the call back, how about this

    PHP Code:
    $jscripts[] = array('conditions' => array('call_backs' => array('jqCrossSlide_here')),
    'files' => array('jquery-1.3.2.min.js' => array('path' => 'jquery/','order' => 1), 
    'jquery.crossslide-0.3.3.js' => array('path' => 'jquery/','order' => 11), 
    'jquery.ondemand.js' => array('path' => 'jquery/','order' => 11),
    'jqcrossslide.php' => array('path' => '','order' => 12)
     ));

    PHP Code:
    function jqCrossSlide_here(){
        global 
    $this_is_home_page// this is a zen variable telling you whether the current page is homepage
        
    return $this_is_home_page;

    For the define main page

    Code:
    <div id="jqCrossSlideMain" class="jqcrossslide" style="border: 2px solid; margin: 1em auto; padding: 0px; overflow: hidden; position: relative; height: 500px; width: 500px;">
    &nbsp;</div>
    Last edited by yellow1912; 13 Mar 2009 at 05:30 PM.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

 

 

Similar Threads

  1. v154 Adding slideshow to header (using Cycle)
    By Rumpleteazer in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 26 Feb 2015, 02:09 PM
  2. Installing JQuery Slideshow
    By flyingcitrus in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Dec 2010, 04:42 AM
  3. using jquery slideshow plugin on the tpl_index_default page?
    By sandesh35 in forum General Questions
    Replies: 3
    Last Post: 27 Oct 2010, 01:09 PM
  4. using zencarts free slideshow plugin
    By scottgallagher in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 11 Dec 2009, 11:27 PM
  5. Using JQuery Easyslider for homepage banner help
    By TrvlFox in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 26 Sep 2009, 09:01 PM

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