Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-02-2012, 11:32 PM   PM User | #1
Mejse78
New to the CF scene

 
Join Date: May 2012
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Mejse78 is an unknown quantity at this point
Anythinslider navigationFormatter

Hello.. I want the Anythingslider to apear 3 times on the same page.
But I'm having problems regarding the navigationformatter

Code:
<script type="text/javascript">

var slider1 = ['april', 'maj', 'juni', 'Quote #2', 'Image #2'];
function formatText(index, panel) {
	return slider1[index - 1] || index;
}
 </script>
This gives the panels their name.
But I can't figure out how to give different names to panels in different sliders.
I thought that I could just make one like this:

Code:
<script type="text/javascript">

var slider2 = ['hello', 'hi', 'bonjour', 'holla', 'Image #2'];
function formatText(index, panel) {
	return slider2[index - 1] || index;
}
 </script>
But that doesn't work.
Can anyone help me with this?

Thanks.

The Anythingslider

Last edited by VIPStephan; 05-02-2012 at 11:37 PM..
Mejse78 is offline   Reply With Quote
Old 05-02-2012, 11:43 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,697
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
This is not the whole code required to set up the slider, it seems to be only the callback for the navigationFormatter option, as far as I can tell from looking at the demo source code. You need to set up another slider:
PHP Code:
$('#slider1').anythingSlider({
  ...
  
navigationFormatter: function() {
    
// code here for slider 1
  
}
  ...
});

$(
'#slider2').anythingSlider({
  ...
  
navigationFormatter: function() {
    
// code here for slider 2
  
}
  ...
}); 
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:22 AM.


Advertisement
Log in to turn off these ads.