Stopping onClick from returning the page top the top after jQuery events -


I have read a lot of posts about this issue, with great resolution, however, none of them Does not work in.

This is my JS:

  $ (document) .ready (function () {$ ("a.tab"). Click (function () {$ ("Active.") RemoveClass ("active"); $ (this) .addClass ("active"); $ (". Ul."). Fade (); $ ("inside.");) Content_show = $ (this) .attr ("title"); return false; e.preventDefault ();}); $ ("A.tab, h4") .Fonfef ({Outlook: true})});   

What am I doing?

Update:

Thanks for the help. Now I have the following, although it still does not work:

  $ (document) .ready (function () {$ ("a.tab"). Click (function ( E $ {"(active"). $ ("Active"), $ (this) .addClass ("active"); $ ("inside."). FadeOut ($) ($ ("(" "" ") ; Return false;}) // $ ("a.tab, h4) fontfix ({// outline: true}}});   

anchor tag:

  & lt; a href = "#" title = "content_1" class = "tab active"> New Video & lt; / a & gt;   

Try:

  $ ("a.tab" ). Click (function (e) {  

In the code you are not missing event argument variable which will be in this case e .

If you use the Prevention () method If you are suing, there is no need for false use of return.

Online demo:

UPDATE

Clicking on the link is not the reason for the scroll jump, the reason is that when UL is hidden $ (". The height of the page decreases so that the browser scrolls will be on the top.

This will give me the .animate ({indefinacy: 0}, 500) / Code> To do a fade effect without hiding it.

  $ ("a.tab"). Click (function (e) {... $ (".included ul" ). Chetan ({opacity: 0}, 500); $ ("inside."). FadeIn (); ... e.preventDefault ();});    

Comments