Here is the sample script:
<script type="text/javascript" src="/_layouts/1033/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var oUrl = window.location.href;
$("table .ms-navitem td a").each(function() {
var ohref = $(this).attr("href");
if(oUrl.indexOf(ohref) != -1)
{
var oClass = $(this).parent().parent().parent().parent().attr("class") + " ms-selectednav";
$(this).parent().parent().parent().parent().attr("class", oClass);
}
});
});
</script>
Basically, in order to explore and understand the html structure of the page, I have used an IE Developer Toolbar as shown below.
After adding the script in the master page, the current page link will now be highlighted.
No comments:
Post a Comment