Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: highlight current pane in Step Carousel Viewer

  1. #1
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default highlight current pane in Step Carousel Viewer

    1) Script Title: Step Carousel Viewer

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...epcarousel.htm
    3) Describe problem:
    This is a great script, theres just one thing i cant figure out. I would like to be able to highlight which pane is active in the menu i have put above the carousel using stepcarousel.stepTo('galleryid', index) method. im going to use a UL with list items of these types of links:
    <a href="javascript:stepcarousel.stepTo('mygallery', 1)">Home</a> >>
    <a href="javascript:stepcarousel.stepTo('mygallery', 2)">About</a> >>
    <a href="javascript:stepcarousel.stepTo('mygallery', 3)">Contact</a>

    but i have no clue how to highlight which <li> is active in the slider pane.

    thanks for your time

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

    Default

    If by highlight the current panel you mean apply some visual cue to it (ie: a red border), yes that's possible using the onslide() event handler of the script, plus the undocumented fact that within this event handler, you can reference all the slides wthin the Carousel using the code this.$panels[i], where i is the slide (starting from 0) you wish to access. With that said, the below applies a red border to the current slide:

    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 ['external', 'path_to_external_file']
    	onslide: function(){
    		for (var i=0; i<statusC; i++){
    			var withinRange=(i>=statusA-1 && i<=statusB-1) //check whether this slide falls within range of active slides currently in view
    			if (withinRange)
    				this.$panels[i].style.border="3px solid red"
    			else
    				this.$panels[i].style.border="3px solid white"
    		}
    	}
    })
    This is a little cumbersome I agree. The next time the script is updated I'll work this feature directly into the script.
    DD Admin

  3. #3
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    im afraid i must be screwing something up. do i just need to add that extra code? when i add it, i get an error, and all my panels load in one panel. im very new to all this. heres a screenshot of the code i added, if it helps:

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

    Default

    You forgot the comma that should be added after contenttype:

    Code:
    contenttype: ['inline'],
    DD Admin

  5. #5
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    oops, good eye
    ok, that works for what i think you thought i wanted, but i think i wasnt clear.
    let me provide a picture:

    i would like to highlight the navigation item of the current pane shown, not the pane itself. for example, have the navigation text of "RT-PACS" be red, when thats the slide shown.

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

    Default

    The concept should be virtually identical actually. Just so I understand correctly, you mean highlight the corresponding nav links that go to a specific slide within the Carousel Viewer, ie, one of the following:

    Code:
    <a href="javascript:stepcarousel.stepTo('mygallery', 1)">Home</a> >>
    <a href="javascript:stepcarousel.stepTo('mygallery', 2)">About</a> >>
    <a href="javascript:stepcarousel.stepTo('mygallery', 3)">Contact</a>
    DD Admin

  7. #7
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    yes! exactly that

  8. #8
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Maybe theres a way of doing it using a status item? i cant quite get my head around it though...

  9. #9
    Join Date
    Jan 2009
    Location
    Cali
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Howdy brooke! Were you able to get it to work? I too have been looking for a way to do that. Can anybody help?

  10. #10
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by leftybanana View Post
    Howdy brooke! Were you able to get it to work? I too have been looking for a way to do that. Can anybody help?
    no, sorry, I thought I was on to something, but i havent gotten any further.

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
  •