Advanced Search

Results 1 to 3 of 3

Thread: Step Carousel Viewer v1.9 - updating contents on demand

  1. #1
    Join Date
    Oct 2013
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Step Carousel Viewer v1.9 - updating contents on demand

    Step Carousel Viewer v1.9

    http://www.dynamicdrive.com/dynamici...epcarousel.htm

    I love being able to update the contents of the carousel on demand; however, is there a way while updating the carousel with the external file, [stepcarousel.loadcontent('galleryid', 'path_to_file') ] to also jump to a predefined panel?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,693
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    Code:
    stepcarousel.configholder.galleryid.oninit = function(){
    	stepcarousel.stepTo('galleryid', 3);
    	stepcarousel.configholder.galleryid.oninit = function(){}; // optional reset
    };
    stepcarousel.loadcontent('galleryid', 'path_to_file');
    Notice the red. Those (except for the number) are the gallery id. They of course must all be the same. The number is the index of the panel that you want it to move to once the external content is loaded. The optional reset line may be removed. If it is, the carousel will always step to 3 whenever new content is added, unless something changes the oninit again. In other words, if all of your code loading external content first sets its own oninit, the reset isn't needed. In most cases you would want a reset or it would at least do no harm. Unless you're sure you don't need or want it, keep it.

    If you're going to be doing a lot of this, setup a function for it:

    Code:
    stepcarousel.loadandmoveto = function(galid, path, index){
    	var config = stepcarousel.configholder[galid];
    	config.oninit = function(){
    		stepcarousel.stepTo(galid, index);
    		config.oninit = function(){}; // optional reset
    	};
    	stepcarousel.loadcontent(galid, path);
    };
    Using a text only editor like NotePad, open up the stepcarousel.js file and add the above function at the very end, after everything else. Save and use that version.

    Now if you want to do this, all you need is:

    Code:
    stepcarousel.loadandmoveto('galleryc', 'external2.htm', 3);
    Where 'galleryc' is the id, 'external2.htm' is the path to the file, and 3 is the index of the panel you want it to go to.

    If the carousel already has an oninit function and that needs to be preserved, more code is needed. If that's the case, just let me know.
    Last edited by jscheuer1; 10-28-2013 at 07:24 AM. Reason: clarity, add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    StillNew (10-27-2013)

  4. #3
    Join Date
    Oct 2013
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Perfect. That's exactly what I needed.

    Thank you very much.

Similar Threads

  1. Step Carousel Viewer (auto step)
    By Mission Impossible in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 04-22-2013, 11:48 AM
  2. Step Carousel Viewer v1.9 bug in jQ 1.8.x+
    By jscheuer1 in forum Bug reports
    Replies: 0
    Last Post: 11-23-2012, 04:12 PM
  3. Step Carousel Viewer v1.6.1
    By LuperonBoater in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 02-17-2009, 12:24 PM
  4. loading Step Carousel Viewer in middle of carousel
    By sam4682 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 12-31-2008, 10:07 PM
  5. Step Carousel Viewer v1.6.1 Help Please
    By hax0r in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 11-17-2008, 07:20 PM

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
  •