Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,471
    Thanks
    6
    Thanked 980 Times in 953 Posts
    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
      
    }
      ...
    }); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •