Solved

Javascript TinySlideShow to be used multiple times on one webpage.

Posted on 2011-03-17
6
1,830 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

738 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