Killersites Community: Jquery Cycle Plugin: Use text instead of numbers in Pager? - Killersites Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Jquery Cycle Plugin: Use text instead of numbers in Pager?

#1 User is offline   Susie 

  • PipPipPipPip
  • View blog
  • View gallery
  • Group: Advanced Member
  • Posts: 3,359
  • Joined: 19-December 08
  • LocationColumbus, OH

Posted 21 May 2009 - 12:12 PM

(Ben, I hope you're reading this today!! :) )

Does anyone know if it's possible to substitute text for the numbers in the nav on the Pager version of the cycle plugin?

Jquery Cycle Plugin - http://malsup.com/jq...cycle/int2.html - Scroll down to the 2nd set up examples.

What I want to do is put the name of the image instead of having just a generic number.

Possible? If so, how? TIA!
0

#2 User is offline   shelfimage 

  • PipPipPipPip
  • Group: Advanced Member
  • Posts: 3,112
  • Joined: 22-December 08
  • LocationNashville

Posted 25 May 2009 - 10:16 AM

a thumbnail list can be generated (http://malsup.com/jq...cle/pager2.html) so maybe just changing this line will generate a text link:

// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '
  • " ' + slide.src + ' "

  • ';
    }
    0

    #3 User is offline   Susie 

    • PipPipPipPip
    • View blog
    • View gallery
    • Group: Advanced Member
    • Posts: 3,359
    • Joined: 19-December 08
    • LocationColumbus, OH

    Posted 25 May 2009 - 06:02 PM

    Thanks, John. :) This might work even if there's no way to get it to show text.
    0

    #4 User is offline   ir3nicus 

    • View blog
    • Group: New Members
    • Posts: 2
    • Joined: 18-November 11

    Posted 18 November 2011 - 10:52 AM

    Hi. I have another question. I want to use an image instead of numbers too.

    $(document).ready(function() {
        $('#promo2').cycle({
    		fx: 'fade',
            timeout: 6000,
    		pager: "#nav",
    		pagerAnchorBuilder: function(idx, slide) { 
    				return '<a href="#"><img src="images/ball2.png" width="13" heigth="13" /></a>';
    		}
    				
    	});
    });
    


    What about when I would like to use another image when the a tag is active ?
    Is it possible to do that?
    Thanks in advance
    0

    #5 User is offline   Ben 

    • View blog
    • Group: Administrators
    • Posts: 5,419
    • Joined: 19-December 08
    • LocationChico, CA

    Posted 18 November 2011 - 12:13 PM

    View Postir3nicus, on 18 November 2011 - 07:52 AM, said:

    What about when I would like to use another image when the a tag is active ?
    Is it possible to do that?
    Thanks in advance

    What I've done in the past is to give the a tag display:block, hide the text with a negative text-indent, and add a background image. Since the cycle plugin adds a class to the active page number, this also allows me to use a different background image for the active item.
    Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
    Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
    0

    #6 User is offline   ir3nicus 

    • View blog
    • Group: New Members
    • Posts: 2
    • Joined: 18-November 11

    Posted 19 November 2011 - 12:56 PM

    Ok but should I use live or delagate jquery function to add it?

    Using only css styles don't work:

    #nav a.activeSlide { display: block; ... }
    Is there any js tag to change activeSlide ?

    "
    pagerAnchorBuilder: function(idx, slide) {
    "
    0

    #7 User is offline   Ben 

    • View blog
    • Group: Administrators
    • Posts: 5,419
    • Joined: 19-December 08
    • LocationChico, CA

    Posted 19 November 2011 - 01:38 PM

    CSS will work. If it isn't, you have an error in the CSS or you aren't targeting the correct element.
    Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
    Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
    0

    Share this topic:


    Page 1 of 1
    • You cannot start a new topic
    • You cannot reply to this topic

    1 User(s) are reading this topic
    0 members, 1 guests, 0 anonymous users