Hi All, I'm using http://jqueryfordesigners.com/jquery-tabs/ for a project, the tabbing code looks like this:-
<script type="text/javascript" charset="utf-8">
$(function () {
var tabContainers = $('div.tabs > div');
tabContainers.hide().filter(':first').show();
$('div.tabs ul.tabNavigation a').click(function () {
tabContainers.hide();
tabContainers.filter(this.hash).show();
$('div.tabs ul.tabNavigation a').removeClass('selected');
$(this).addClass('selected');
return false;
}).filter(':first').click();
});
</script>
This works great, but the design requires that I insert the selected class on the li tag, not the a tag. When I alter the script to do this the show/hide for each tab breaks. Any thoughts on what else needs to change? Thanks in advance.
<script type="text/javascript" charset="utf-8">
$(function () {
var tabContainers = $('div.tabs > div');
tabContainers.hide().filter(':first').show();
$('div.tabs ul.tabNavigation li').click(function () {
tabContainers.hide();
tabContainers.filter(this.hash).show();
$('div.tabs ul.tabNavigation li').removeClass('selected');
$(this).addClass('selected');
return false;
}).filter(':first').click();
});
</script>