I have a tab navigation link(tab1, tab2, tab3) and the bottom of the page there is a page link navigation for each tabs.
for tabs highlight
$(document).ready(function(){
var str=location.href.toLowerCase();
$(".tabs li a").each(function() {
if (str.indexOf(this.href.toLowerCase()) > -1 ) {
$("li.highlight").removeClass("highlight");
$(this).parent().addClass("highlight");
}
});
})
for page highlight
$(document).ready(function(){
var str=location.href.toLowerCase();
$(".paging li a").each(function() {
if (str.indexOf(this.href.toLowerCase()) > -1 ) {
$("li.hp").removeClass("hp");
$(this).parent().addClass("hp");
}
});
})
although a page link and a tab link were highlighted correctly for each functions how can i highlight current tab(after clicking page link) and current page at once? can i use above functions?
thanks!
yes you can use same functions just bind a function to call the above functions to the page link tag
give an id to an html element
eg <Div id="myId"></Div>
and try this
$("myId").live('click',function(){
// call whichever function you want to
}) ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With