www.webdeveloper.com
Results 1 to 3 of 3

Thread: Links aren't hiding when they're supposed to

  1. #1
    Join Date
    Apr 2010
    Posts
    26

    Links aren't hiding when they're supposed to

    Hey all,

    I have a back button and a forward button. When the first paragraph fades in, back button should be hidden. When the last paragraph fades in, the forward button should be hidden. Yet, neither of them are hiding, ever:

    Code:
    $nextGraph = $('#group1 p:first');
    					// $totalGraphs = $('#group1 p').size();
    					$('#group1 .slidernav').prepend("<a href='#' class='control' id='leftControl'>Back</a>").append("<a href='#' class='control' id='rightControl'>Forward</a>");
    					manageControls($nextGraph);
    					$('#group1 .slidernav a').bind('click', function(){
    						var triggerID = $active.attr("rel") - 1;  
    					    var image_reelPosition = triggerID * imageWidth;
    						clearInterval(playFade);
    						// clearInterval(play);
    					
    						$nextGraph = ($(this).attr('id')=='rightControl') ? $nextGraph.next() : $nextGraph.prev();
    						
    						manageControls($nextGraph);
    						$(".image_reel p").animate({
    							opacity: 0,
    							left: image_reelPosition + 500
    						}, 500 );
    						
    						$nextGraph.animate({
    							opacity: 1,
    							left: image_reelPosition
    						}, 800 );
    					});
    					
    					function manageControls(currentGraph){
    						(currentGraph==$('#group1 p:first')) ? $('#leftControl').hide() : $('#leftControl').show();
    						(currentGraph==$('#group1 p:last')) ? $('#rightControl').hide() : $('#rightControl').show();
    					};

  2. #2
    Join Date
    Aug 2010
    Location
    Baltimore, Maryland, United States
    Posts
    138
    Code on a line after // becomes a comment.

  3. #3
    Join Date
    Apr 2010
    Posts
    26
    Yeah I know what // does. But the code commented out has nothing to do with the problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles