Carousel caption box height

A place to ask questions and get help. Be the first on your block to post ...

Carousel caption box height

Postby cbrassil2 » Thu May 12, 2011 11:59 pm

It's unclear to me how to use the textholderHeight option of the Carousel. Does the command go in a JSON file or does it go between the script calls in the html? I haven't been able to get either to work successfully.

If it does go in a JSON file, do I call that file using the within the script section after the call to the plugin, like this:

<script type="text/javascript">// <![CDATA[
WDN.initializePlugin('carousel');
WDN.carousel.supportJSON = 'carouselJSON.js';
// ]]></script>

Currently carouselJSON.js is a text file with the single line:

WDN.carousel.textholderHeight = .05;

The page I'm developing is currently at <http://unlcms.unl.edu/schoolofbiologicalscience/cbrassil/>. I'm using Firefox 4.0.1 on a Windows 7 machine.

Thanks,
Chad
cbrassil2@unl.edu
cbrassil2
 
Posts: 4
Joined: Thu May 12, 2011 11:50 pm

Re: Carousel caption box height

Postby cbrassil2 » Sat May 14, 2011 8:54 am

I've been trying some things. When I run the following lines in the Web Developer console in Firefox I get the behavior that I want:

WDN.loadJS('carousel.js');
WDN.carousel.textholderHeight = 0.05;
WDN.carousel.initialize();

But when I put them in my code like this, it doesn't work. It says textholderHeight is undefined.

<script type="text/javascript">// <![CDATA[
WDN.loadJS('carousel.js');
WDN.carousel.textholderHeight = 0.05;
WDN.carousel.initialize();
// ]]></script>

My problem is I have a thin understanding of how the loadJS and initializePlugin functions work, as well as how javascript works in general. Anyone?
cbrassil2
 
Posts: 4
Joined: Thu May 12, 2011 11:50 pm

Re: Carousel caption box height

Postby cbrassil2 » Sun May 15, 2011 12:21 am

I've finally answered my own question. For the others who may be naive on this, the carousel.js code doesn't get executed immediately after the WND.initializePlugin call, but simply cued. Therefore, you have to slip a call into the textholderHeight redefinition just before the initialize function is going to be called by the WDN.initializePlugin.

<script type="text/javascript">// <![CDATA[
WDN.initializePlugin('carousel',function(){WDN.carousel.textholderHeight = 0.05;WDN.carousel.initialize();});
// ]]></script>
cbrassil2
 
Posts: 4
Joined: Thu May 12, 2011 11:50 pm


Return to Help & Assistance

Who is online

Users browsing this forum: No registered users and 3 guests

cron