jQuery Cycle pager and pagerAnchorBuilder Question

jQuery Cycle pager and pagerAnchorBuilder Question

Hi everyone

I'm a bit of a fledgling with all things Javascript, but I have to say, jQuery is very nice and seems to be extremely versatile! I'm starting to get a decent grasp on a few things I think.

I had a question related to the jQuery Cycle plugin.

I'm trying to understand how I can utilize two different effects on two different portions of my page.

First, I got the pagerAnchorBuilder to operate correctly in terms of going to the specified <li> item when clicked, while still cycling through the pager.

My issue is that I would like for the pagerAnchorBuilder item to use a .fadeTo() effect.

I'm not exactly sure how to accomplish this.

Is there a way I can request what the value of the pagerAnchorBuilder is and execute an if {} statement?

I've attached my code to clarify. I start all the nav items out with a .fadeTo(0000, 0.0) in order to keep them in the page to fade in should I get the code to operate correctly... so that's what the initial .fadeTo()s in the code are for.

  1. <script type="text/javascript">
  2. $(document).ready(function() {

  3. $(".glidernav-1-active").fadeTo("slow", 0.0);
  4. $(".glidernav-2-active").fadeTo("slow", 0.0);
  5. $(".glidernav-3-active").fadeTo("slow", 0.0);
  6. $(".glidernav-4-active").fadeTo("slow", 0.0);

  7. $('.content').cycle({ 
  8. fx: 'fade', speed: 2000, timeout: 3000, 
  9. pager: '#nav', 
  10. pagerAnchorBuilder: glidernav
  11. });

  12.     function glidernav(idx, slide) {
  13. if (idx == 0) return '.glidernav-1-active';
  14. else if (idx == 1) return '.glidernav-2-active';
  15. else if (idx == 2) return '.glidernav-3-active';
  16. else if (idx == 3) return '.glidernav-4-active';

  17. };

  18. if (pagerAnchorBuilder == '.glidernav-1-active') {
  19. $(".glidernav-1-active").fadeTo("slow", 1.0);
  20. };
  21. });

  22. </script>
Thanks for any help you can provide!