Created
December 17, 2013 21:08
-
-
Save jawinn/8012647 to your computer and use it in GitHub Desktop.
Different jQuery to old version of IE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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