View Full Version : modifying Featured Content Slider v2.4
lukasdesign
09-17-2008, 11:52 AM
1) Script Title:
Featured Content Slider v2.4
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm
3) Describe problem:
I modified the gallery "Example2" to my graphical needs, but I would love to show a description to every image, let's say in in different <div> under the pagination. Is this difficult to do?
Someone could me there?
thanks to everybody!!!
ddadmin
09-17-2008, 06:13 PM
You can use the "onChange" event handler within the initialization code to do this. Something like:
var description=new Array()
description[0]="Image description 1"
description[1]="Image description 2"
description[2]="Image description 3"
featuredcontentslider.init({
id: "slider1", //id of main slider DIV
contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
toc: "#increment", //Valid values: "#increment", "markup", ["label1", "label2", etc]
nextprev: ["Previous", "Next"], //labels for "prev" and "next" links. Set to "" to hide.
enablefade: [true, 0.2], //[true/false, fadedegree]
autorotate: [true, 3000], //[true/false, pausetime]
onChange: function(previndex, curindex){ //event handler fired whenever script changes slide
document.getElementById("describediv").innerHTML=description[curindex-1]
}
})
See the script page for more info on this event handler.
lukasdesign
09-18-2008, 07:41 AM
I created
<div id="describediv" class="description"> lukas </div>
but how do I get the various contents in it?
I suppose I have to build some inner divs?
ddadmin
09-19-2008, 12:53 AM
The descriptions themselves would be defined inside the script as an array:
var description=new Array()
description[0]="Image description 1"
description[1]="Image description 2"
description[2]="Image description 3"
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.