I am trying to create simple jQuery tabs. The contents of the tab should be displayed on hover. Therefore, I am trying to use code. The problem is that if you type fast enough on the tab headers, you can still see the contents of other tabs before the correct tab contents are displayed.
Demo:
See the Fiddle link to see the problem:
http://jsfiddle.net/0v9nhxu3/
The code:
jQuery(document).ready(function($) {
$(".tab-titles li").hover(function() {
$(".tab-content").hide();
$(".tab-titles li").removeClass('active');
$(this).addClass("active");
var selected_tab = $(this).find("a").attr("href");
$(selected_tab).fadeIn();
return false;
});
});
source
share