Initially I was looking for an answer to show/hide a page jumping issue.
Having found an answer here: link with href="#" scrolls page to top when used with jquery slidetoggle, I need to understand where to put return false in the following code:
toggleDetail : function(obj) {
$(obj).parent().parent().next().toggleClass('hide');
$(obj).text() == 'Show' ? $(obj).text('Hide') : $(obj).text('Show');
},
and here’s my call to the show/hide. The ‘href=”javascript:void(0);”‘ worked in stopping the page jumping, do I still need the ‘return false’?
<a href="javascript:void(0);" onclick="VSASearch.toggleDetail(this)">Show</a>
I tried adding ‘return false’ to the end of each $(obj) line before the semi-colon, but that was not it.
1 Answer