Question

The jQuery code used:

$('#contentspacer').cycle({fx:'fade',speed:2500,timeout:6000,next:'.next',prev:'.prev'});
$('.pause').click(function() {$('#contentspacer').cycle('pause'); return false;});
$('.play').click(function() {$('#contentspacer').cycle('resume'); return false;});

The html used for the "navigation":

<div class="pnbtns"><a href="#" class="prev">&#8592;</a> <a href="#" class="pause">pause</a> <a href="#" class="play">play</a> <a href="#" class="next">&#8594;</a></div>

As you can see, the play and the pause buttons work fine and do not add the hashtag at the end, the next and the previous button still work, but add the hashtag.

What I want to do is add the return false; to the .prev and .next buttons, without using inline javascript (I know how to do it that way) and without leaving the links empty(must validate strict xhtml).

Was it helpful?

Solution

Is this what you are looking for?

$('.next, .prev').live('click', function(){
   return false;
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top