Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript anything slider numbers to text Re: anything slider numbers to text

#78457
oneworld95
Member

You’d add the HTML that you need inside the formatText() function. You’d probably want to build the HTML and test it so it all looks good and is the right size; then just concatenate a string inside the formatText() function. If you wanted to return a DIV tag, you’d do something like this:

Code:
function formatText(index, panel){
var myHtml = “

My text for Panel #” + index + ” goes here


return myHtml;
}

What the formatText function does is to set the HTML of the little "tab" under each panel of the AnythingSlider. For each panel, the AnythingSlider calls this function to get the HTML, so it serves as a template for the tabs. The HTML can contain anything you need, but it should be kept small enough to go with the design. The function has the index of that panel, as the argument "index" so you can reference that in your code as I’ve done in the example above.