Replies: 1
Hello Support,
I am having continuous trouble in keeping the current page of Menu active in this OceanWP theme. The Code works properly and shows current page active in live but when i refresh my website and click on any page of menu, it doesn’t work and only Home page stays active.
The code i have developed is here……I AM NOT AN EXPERT SO HOPING FOR THE HELP FROM A EXPERT HERE…. THANKS IN ADVANCE.
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #111;
}
ul li {
float: left;
}
ul li a {
display: inline-block;
color: white;
text-align: center;
font-family: Sans-Serif;
padding: 12px 23px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
.active {
color: #484749;
border-radius: 25px 10px 25px 10px;
background-color: #f2f2f2;
}
</style>
<script
src=”https://code.jquery.com/jquery-3.3.1.js”></script>
<script type=”application/javascript”>
$(document).ready(function(){
$(‘ul li a’).click(function(){
$(‘li a’).removeClass(“active”);
$(this).addClass(“active”);
});
});
</script>
</head>
<body>
</body>
</html>