Results 1 to 5 of 5

Thread: Integrating Step Carousel with Featured Content Glider

  1. #1
    Join Date
    Nov 2009
    Location
    Lithuania
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Integrating Step Carousel with Featured Content Glider

    1) Script Title: Step Carousel v1.8 and Featured Content Glider (Dec. 09)

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...epcarousel.htm
    http://www.dynamicdrive.com/dynamici...tentglider.htm

    3) Describe problem:

    The image based website I am trying to create requires a clickable thumbnail scroller used to change the main image located elsewhere on the page.

    I have used the 'Step Carousel' script for the thumbnail scroller and wanted to use it's onpanelclick:function to toggle the featured content glider which is placed above it. The featured content glider will display a larger version of the selected image.

    The scripts load and initialise fine, it's just a matter of tweaking the code.

    Could someone point me in the right direction?
    (Don't worry I know where the door is )

    Your help is much appreciated.

    Badgio
    Last edited by Badgio; 03-28-2010 at 06:31 PM. Reason: Resolved

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Do you have a URL to what you have so far, assuming you've already made some changes/ attempts to get the two scripts to work the way you want? If so what's the URL?
    DD Admin

  3. #3
    Join Date
    Nov 2009
    Location
    Lithuania
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    This is a link to a sample page http://www.make-up.lt/covers/

    Basically, I will do away with the 'featured content glider' (FCG) pagination buttons with control being exercised through the 'step carousel' (CAR) by way of clicking a panel to trigger the FCG.

    As I am not a coder, I don't really have a clue how to go about this, and haven't attempted any code changes.

    Having said that, would changing
    Code:
    config.$toc.click(function(event)
    in featuredcontentglider.js so that it looks for/uses the
    Code:
    onpanelclick()
    event handler used by 'step carousel' be a solution?

    Thanks.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ok try this. Firstly for the configuration code for your FCG, modify it so the settings are stored inside a variable, for example:

    Code:
    var gliderconfig={
    	gliderid: "canadaprovinces", //ID of main glider container
    	contentclass: "glidecontent", //Shared CSS class name of each glider content
    	togglerid: "p-select", //ID of toggler container
    	remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
    	selected: 0, //Default selected content index (0=1st)
    	persiststate: false, //Remember last content shown within browser session (true/false)?
    	speed: 500, //Glide animation duration (in milliseconds)
    	direction: "downup", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
    	autorotate: true, //Auto rotate contents (true/false)?
    	autorotateconfig: [3000, 2] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
    }
    
    featuredcontentglider.init(gliderconfig)
    Notice the arbitrary variable "gliderconfig" used here.

    Secondly, inside each image within your carousel viewer, give it a "data-index" attribute that points to the index of the slide you want it to trigger when clicked on (starting from 0), for example:

    Code:
    <div class="panel">
    <a href="#" class="toc"><img src="http://i30.tinypic.com/531q3n.jpg" data-index="0" /></a>
    </div>
    
    <div class="panel">
    <a href="#" class="toc"><img src="http://i29.tinypic.com/xp3hns.jpg" data-index="1" /></a>
    </div>
    "
    "
    Then finally inside your Carousel's configuration code, use the onpanelclick() event handler like so to bind it all together:

    Code:
    stepcarousel.setup({
    	galleryid: 'mygallery', //id of carousel DIV
    	beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
    	panelclass: 'panel', //class of panel DIVs each holding content
    	autostep: {enable:true, moveby:1, pause:3000},
    	panelbehavior: {speed:500, wraparound:false, persist:true},
    	defaultbuttons: {enable: true, moveby: 1, leftnav: ['http://i34.tinypic.com/317e0s5.gif', -5, 80], rightnav: ['http://i38.tinypic.com/33o7di8.gif', -20, 80]},
    	statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
    	contenttype: ['inline'], //content setting ['inline'] or ['ajax', 'path_to_external_file'],
    	onpanelclick:function(target){
    	 if (target.tagName=="IMG"){
    			featuredcontentglider.cancelautorotate(gliderconfig.togglerid)
    			featuredcontentglider.glide(gliderconfig, target.getAttribute('data-index'))
    	 }
    	}
    })
    DD Admin

  5. The Following User Says Thank You to ddadmin For This Useful Post:

    Badgio (03-24-2010)

  6. #5
    Join Date
    Nov 2009
    Location
    Lithuania
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thanks!

    Great, that all worked, other than I missed a comma when pasting the onpanelclick:function code.

    Many thanks, very much appreciated. This site is invaluable!

    Now time to tackle your php examples for delivering dynamic content into Step Carousel.

    Badgio

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
  •