Solved

Javascript TinySlideShow to be used multiple times on one webpage.

Posted on 2011-03-17
6
1,820 Views
Last Modified: 2012-05-11
I got TinySlideShow code from here: http://www.scriptiny.com/2008/12/javascript-slideshow/

I've put alot of work into integrating the TinySlideShow into this website: http://test.production.esa.edu.au/ndlrn/ndlrncatalog/final.html

the slideshow appears in the 'NUMBER -> counting beetles series'

unfortunately I discovered later that I need to use the TinySlideShow multiple times on the same webpage.

The way parameters are passed into a slideshow is as follows (appears at bottom of final.html page)
<script>
var slideshow=new TINY.slider.slide('slideshow',{
            id:'homepageSlider', // ID of the parent slideshow div
            auto:0,  // Seconds to auto-advance, defaults to disabled
            resume:false,  // Resume auto after interrupted, defaults to false
            vertical:false,  // Direction, defaults to false
            navid:'pagination', // Optional ID of direct navigation UL
            activeclass:'current',  // Class to set on the current LI
            position:0,    // Initial slide position, defaulting to index 0
            rewind:false,
            elastic:false
            });
</script>

I tried changing the parameter ID to class instead, which didn't work.

I'm trying to create the CSS/HTML/Javascript then place this into an XSL file which will pull alot of data dynamically and place it into the TinySlideShow.

If you think there's no solution to this please recommend any plugins thanks and much appreciated.
0
Comment
Question by:jeremyll
  • 3
  • 2
6 Comments
 
LVL 20

Expert Comment

by:Proculopsis
ID: 35155273

A pragmatic solution might be to drop each instance of the slideshow into its own iframe.
0
 
LVL 19

Accepted Solution

by:
Bardobrave earned 500 total points
ID: 35155284
I understand that you need to load different data into different instances of the slider.

If it's the case, the only thing you should need is to create different js object variables where you store the different instances of the class, and use them accordingly.

<script>
var slideshow1=new TINY.slider.slide('slideshow',{
            id:'homepageSlider1', // ID of the parent slideshow div
            auto:0,  // Seconds to auto-advance, defaults to disabled
            resume:false,  // Resume auto after interrupted, defaults to false
            vertical:false,  // Direction, defaults to false
            navid:'pagination', // Optional ID of direct navigation UL
            activeclass:'current',  // Class to set on the current LI
            position:0,    // Initial slide position, defaulting to index 0
            rewind:false,
            elastic:false
            });

var slideshow2=new TINY.slider.slide('slideshow',{
            id:'homepageSlider2', // ID of the parent slideshow div
            auto:0,  // Seconds to auto-advance, defaults to disabled
            resume:false,  // Resume auto after interrupted, defaults to false
            vertical:false,  // Direction, defaults to false
            navid:'pagination', // Optional ID of direct navigation UL
            activeclass:'current',  // Class to set on the current LI
            position:0,    // Initial slide position, defaulting to index 0
            rewind:false,
            elastic:false
            });
</script>

And so on... I don't know this plug-in, but I think you should be able to make it work this way.
0
 

Author Comment

by:jeremyll
ID: 35155458
Thanks Bardobrave,

I'm hoping for an alternative solution and looks like its the only solution available in which case ill need to find another slides jquery plugin. Please recommend any plugins. Thanks
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:Bardobrave
ID: 35155547
I must be missing something here.

 Why do you seek an alternate solution to create different instances? Are you loading different slides each time or you need to load the same slide in different places?

You are going to pull data from database to slider through XSL (not very sure how) but don't see exactly what is the problem you have with the plugin. I fear we recommend you other plugins and you face the same problem later, maybe we should understand exactly what the problem is to try to find a solution.
0
 

Author Comment

by:jeremyll
ID: 35155728
Need to load about 40+ different slides on one webpage. Also, the number of slides is not fixed as a content editor will upload more slides later. So these slides need to be created dynamically.
0
 
LVL 19

Assisted Solution

by:Bardobrave
Bardobrave earned 500 total points
ID: 35155931
So wouldn't be better to store data about visible slides on database and load the number of sliders needed on executing time?

I mean. Your content editor will define wich, how many and what data include your sliders. This info will be somewhat included into your database.

Then, when you load a page when sliders are present, you can add a server routine that posts to client code instances of the slider, this way, when HTML response is sent to client machines, the js code to render 1,2, or any number of sliders will be present in the page (because your server code had inserted them there) and the plugin engine will do the rest.

If you are planning to use XSL transformations to build an instance of the slider don't would you be able to alter your transformation to detect the number of instances you need in each page and generate an instance for each one?

I suppose you'll read data from XML files, probably you can alter your XML structure from a single slider to a multiple one without too much problems.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Provide the IDEA of External JS 1 35
How to check or uncheck a checkbox using the id of the checkbox 2 16
arrays and radio buttons 10 36
Calculating percentage 2 27
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question