Monday, 5 March 2012

Removing Dotted Border on Clicked Links using JQuery

var links = document.getElementById('nav').getElementsByTagName('a');
for ( var i = 0; i < links.length; i++ ) 
{
        links[i].onmousedown = function () 
{
          this.blur();
          return false;
         }
          links[i].onclick = function()
 {
             this.blur();
          }
          if ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ) 
{
                    links[i].onfocus = function() {   this.blur();  }
}
 }
   
$('a').live('mousedown', function(e) {
  e.target.blur();
  e.target.hideFocus = true;
  e.target.style.outline = 'none'
}).live('mouseout', function(e) {
  e.target.blur();
  e.target.hideFocus = false;
  e.target.style.outline = null;
}); 

No comments:

Post a Comment