I have successfully implemented a tab menu that functions well in Chrome and IE 9,10. However, it does not seem to work in IE 7 or 8. I am at a loss regarding what changes need to be made to my code.
Could anyone provide assistance?
<ul class="hr_tab menu1">
<li class="tab1 on" data-tab="tab-1" data-trigger-class="menu1">
<a href="#">tab1</a>
</li>
<li class="tab2" data-tab="tab-2" data-trigger-class="menu2">
<a href="#">tab2</a>
</li>
<li class="tab3" data-tab="tab-3" data-trigger-class="menu3">
<a href="#">tab3</a>
</li>
</ul>
<div id="tab-1" class="tab_content on">111</div>
<div id="tab-2" class="tab_content">22</div>
<div id="tab-3" class="tab_content">33</div>
.tab_content { display:none; }
.tab_content.on { display:inherit;}
$(document).ready(function(){
$('ul.hr_tab li').click(function(e){
var tab_id = $(this).attr('data-tab');
$('ul.hr_tab li').removeClass('on');
$('.tab_content').removeClass('on');
$(this).addClass('on');
$("#"+tab_id).addClass('on');
$('.hr_tab').removeClass('menu1 menu2 menu3');
$('.hr_tab').addClass($(this).attr('data-trigger-class'));
e.preventDefault();
});
})