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.
- <script type="text/javascript">
- $(document).ready(function() {
- $(".glidernav-1-active").fadeTo("slow", 0.0);
- $(".glidernav-2-active").fadeTo("slow", 0.0);
- $(".glidernav-3-active").fadeTo("slow", 0.0);
- $(".glidernav-4-active").fadeTo("slow", 0.0);
- $('.content').cycle({
- fx: 'fade', speed: 2000, timeout: 3000,
- pager: '#nav',
- pagerAnchorBuilder: glidernav
- });
- function glidernav(idx, slide) {
- if (idx == 0) return '.glidernav-1-active';
- else if (idx == 1) return '.glidernav-2-active';
- else if (idx == 2) return '.glidernav-3-active';
- else if (idx == 3) return '.glidernav-4-active';
- };
- if (pagerAnchorBuilder == '.glidernav-1-active') {
- $(".glidernav-1-active").fadeTo("slow", 1.0);
- };
- });
- </script>
Thanks for any help you can provide!