Home -> VRSmarty plugins page -> carousel.swf
This plugin is completely free for use in any context or connection.
carousel.swf
A plugin for showing a thumbnail carousel menu. Click images to select a new pano, link to another page or execute any other VRSmarty commands.

Carousel diameter, angle and rotation can be selected.
Each thumbnail can have its own OnClick, OnOver and OnOut events.

The following parameters are supported:

In VRSmarty xml file:
xmlFilexmlFile='myCarousel.xml'plugin control XML file, default=carousel.xml



Plugin attributes:set with spot_id.content.name=value
diameterdiameter=65%carousel diameter, in pixels or percentage (default=200)
angleangle=70carousel angle in degrees, 0=vertical, 90=horisontal (default=60)
spinspin=Tcarousel constant spinning, see <carousel> tag below, any other value
will toggle spin on/off


Plugin methods: call with spot_id.content.name(value)
select(id)select('pano3')set thumbnail as selected
expand(sw)expand(T)0 or 1, anything else will toggle expanding
can also be used at startup to set initial status
collapse(sw)collapse(T)0 or 1, anything else will toggle collapsing
same function as expand, but inverted



Plugin external xml file:

In <carousel> tag:
visiblevisible="0"0 or 1, anything else will toggle visibility
diameterdiameter="75%"carousel radius, in pixels or as a percentage (default=200)
angleangle="70"carousel angle in degrees, 0=vertical, 90=horisontal (default=60)
spinspin="1"carousel constant spinning: 0=no spin, 1=clockwise spin, -1=anticlockwise spin, default:0
startCollapsedstartCollapsed="1"initial carousel status, 0 or 1
onClickonClick="hide"behaviour after clicking thumbnail, useful with parameter choiceField=0
In <images> tag:
sizesize="100:67"thumbnail size, default=100:67
frameColorframeColor="#000000"selected thumbnail frame color, default=#FFFFFF
bgColorbgColor="#FFFFFF"selected thumbnail text background color, default=#333333
mouseFramemouseFrame="1"frames the thumbnail at mouseOver (default 1)
mouseTextBgmouseTextBg="0"show thumbnail text background at mouseOver (default 1)
fontfont="Comic Sans MS"thumbnail text font, default=Arial
textSizetextSize="10"thumbnail text size, default 10
textColortextColor="#404040"thumbnail text color, default #FFFFF0
In <image> tag:
idid="pano5"thumbnail id
texttext="Train Station"thumbnail text
urlurl="pics/pano8.jpg"thumbnail url
onClickonClick="global.goPano2"thumbnail onClick command
onOveronOver="pic3.visible=1"thumbnail onOver command
onOutonOut="pic3.visible=0"thumbnail onOut command
selectedselected="1"thumbnail selected at start



Example of plugin xml file:

<?xml version = '1.0'?>
<carousel
   diameter="60%"
   angle="77"
   spin="1"
   startCollapsed="0"
   mouseFrame="0"
   mouseTextBg="0"
>
   <images 
      size="100:67"
      bgColor="#404040"
      frameColor="#FFFFFF"
      font="Comic Sans MS"
      textSize="10"
      textColor="#E0E0E0"
   >
      <image text="The Train Bridge" url="/panos/images/thumbs/pano3.jpg" onClick="goBridge()" onOver="p3.visible=1" onOut="p3.visible=0" />
      <image text="Maria Hill" url="/panos/images/thumbs/maria.jpg" onClick="goMaria()" onOver="p4.visible=1" onOut="p4.visible=0" />
      <image text="City Hall Tower" url="/panos/images/thumbs/cityhall.jpg" onClick="goTower()" onOver="p1.visible=1" onOut="p1.visible=0" />
      <image text="%C5SS bridge" url="/panos/images/thumbs/ass.jpg" onClick="goASS()" onOver="p5.visible=1" onOut="p5.visible=0" />
      <image text="Hammarby Gates" url="/panos/images/thumbs/hammarbyslussen1.jpg" onClick="goGates()" onOver="p7.visible=1" onOut="p7.visible=0" />
      <image text="T.Knutsson Street" url="/panos/images/thumbs/torkelknutsson.jpg" onClick="goTorkel()" onOver="p11.visible=1" onOut="p11.visible=0" />
      <image text="The Yatch Club" url="/panos/images/thumbs/yachtclub.jpg" onClick="goYatchs()" onOver="p6.visible=1" onOut="p6.visible=0" selected="1" />
      <image text="Under the bridge" url="/panos/images/thumbs/arstaviken7.jpg" onClick="goBridge()" onOver="p9.visible=1" onOut="p9.visible=0" />
      <image text="Small bridge" url="/panos/images/thumbs/arstaviken8.jpg" onClick="goMaria()" onOver="p10.visible=1" onOut="p10.visible=0" />
      <image text="City Hall Yard" url="/panos/images/thumbs/cityyard.jpg" onClick="goTower()" onOver="p2.visible=1" onOut="p2.visible=0" />
      <image text="%C5SS bridge" url="/panos/images/thumbs/ass.jpg" onClick="goASS()" onOver="p5.visible=1" onOut="p5.visible=0" />
      <image text="Hammarby Gates" url="/panos/images/thumbs/hammarbyslussen1.jpg" onClick="goGates()" onOver="p7.visible=1" onOut="p7.visible=0" />
      <image text="The Årsta Bridge" url="/panos/images/thumbs/arstabron11.jpg" onClick="goTorkel()" onOver="p12.visible=1" onOut="p12.visible=0" />
      <image text="The Yatch Club" url="/panos/images/thumbs/arstaviken4.jpg" onClick="goYatchs()" onOver="p8.visible=1" onOut="p8.visible=0" />
   </images>
</carousel>
					



NOTES:
Parameter names are not case sensitive ("FrameColor" is equal to framecolor").


Carousel rotation (except for the slow constant rotation, if chosen) is activated by mouse-over. When moving the mouse over the left part, the carousel will rotate counter- clockwise and vice versa. The rotation will be halted when the mouse is in the center part the width of a thumbnail.


The selected thumbnail is always framed.


Thumbnail texts will span over several lines if necessary. They can contain newline ("\n") codes to control line breaks.


If you are using the &" characters inside the "command" parameters in the xml file, you have to encode them as follows:

& as %26
" as %22
You can also enclose your tag data with <![CDATA[ ... ]]> which makes the xml parser ignore any special characters.


The select(id) command can be used at any time to select a thumbnail. If a new pano is loaded by another method than clicking an image, using the command: "spot_id.content.select('xx')" will select the corresponding thumbnail.

Version history: