Skip to content

Instantly share code, notes, and snippets.

@jawinn
Created December 17, 2013 21:08
Show Gist options
  • Select an option

  • Save jawinn/8012647 to your computer and use it in GitHub Desktop.

Select an option

Save jawinn/8012647 to your computer and use it in GitHub Desktop.
Different jQuery to old version of IE
// Found this nice function on StackOverflow, which you don't necessarily need.
jQuery.fn.exists = function(){
return jQuery(this).length>0;
}
// Example jQuery Code
$(document).ready(function()
{
// Hover function which gives different javascript to older IE
$("table.inv-table .inv-link").hover(function(){
if ( $("html.lt-ie9").exists() ) {
$('span.hov',this).show();
} else {
$('span.hov',this).fadeTo(250, 1.0);
}
}, function(){
if ( $("html.lt-ie9").exists() ) {
$('span.hov',this).hide();
} else {
$('span.hov',this).fadeTo(400, 0);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment