Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reserve the border colour when clicking on a menu

I have the following tab menu inside my SharePoint web site. I have applied the following Script to show blue border around the tab:-

$(document).ready(function(){

$("span:contains('Page Options')").css('border-top', '4px solid #008CD2');
$("span:contains('Page Options')").css('border-left', '1px solid #008CD2');

$("span:contains('Page Options')").css('border-right', '1px solid #008CD2');

});

Which will work well as follow:-

enter image description here

But when the user clicks on the tab the border will be cleared out as follow:-

enter image description here

Can anyone advice how I can keep the border shown regardless of whether the tab was clicked or not ? Thanks

like image 560
John John Avatar asked Dec 04 '25 10:12

John John


1 Answers

Put the css class which mention below in style tag.

.tabBorder{
    border-top:4px solid #008CD2;
    border-right:1px solid #008CD2;
    border-left:1px solid #008CD2;
}

then add the following code in script tag.

$(function(){
    $("span:contains('Page Options')").addClass("tabBorder");
});

This is not clear the border unless or until your do reload, refresh or execute the below script.

$("span:contains('Page Options')").removeClass("tabBorder");

but make sure that the above code will removes the all span tag border who contains Page Options. So you need to track of that specific span otherwise which you want to remove that class.

please have a look of the below url

http://jsfiddle.net/shailesh_rathod19/jVpxb/

I don't found any issue. on this. let me know for futher help!. Thanks.

like image 153
Shailesh Rathod Avatar answered Dec 07 '25 01:12

Shailesh Rathod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!