I have the following code for a button in my nav menu:
div onmouseover=\"changeBGColor(this,'#b90707');changeColor(this,'#fff');\" onmouseout=\"changeBGColor(this,'');changeColor(this,'#333');\" onClick="" class='navbtn'>Entry /div
And the following code to keep the element active:
$('.navbtn').each(function(){
var path = window.location.href;
var current = path.substring(path.lastIndexOf('/')+1);
var url = $(this).attr('onClick').substring(path.lastIndexOf('/')+18,$(this).attr('onClick').length-1);
if(url == current ){
changeBGColor(this,'#b90707');changeColor(this,'#fff');
$(this).onmouseout = '';
$(this).onmouseover= '';
};
});
The element remains active until i move the mouse over the element. I would like to remain active anytime no matter where i move my mouse on..