- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › JQ:Click issue
Hey,my code is wrote to show/hide the next or prev image through click issues,but sth is wrong.Can anyone help?I will be very grateful.http://codepen.io/lrelia/pen/fJzEq
here my try, but I only studying JS/jQuery and there is more better solution http://codepen.io/Kuzyo/pen/GowDr
p.s. I now in process of reading this book http://www.amazon.com/JavaScript-jQuery-The-Missing-Manual/dp/1449399029 there is several good tutorials how to work with galleries
@Kuzyo Much Thank.Your solution works well, but I delete it by mistake..T T I write a different solution for the problem.http://codepen.io/lrelia/pen/fJzEq It works well with Chrome and IE 9,but just can’t work well in codepen.HAHA.
The before mistake I made is click() .
Wrong: selector.click(function() {}); //anonymous function is not allowed
Right: var handle = function() {};selector.click(handle);
click is allowed, it’s example from jQuery documentation http://api.jquery.com/click/ :
$( "p" ).click(function() {
$( this ).slideUp();
});
@Kuzyo,but it seems weird,it doesn’t work when I use anonymous function.Is it because ‘current’ is global variable?
Can you send me your full code. Interesting why it doesn’t work?