-
-
Save kivanio/257289 to your computer and use it in GitHub Desktop.
This file contains 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
//A. Target Safari | |
if( $.browser.safari ) {}; | |
//B. Target anything above IE6 | |
if ($.browser.msie && $.browser.version > 6 ) {}; | |
//C. Target IE6 and below | |
if ($.browser.msie && $.browser.version <= 6 ) {}; | |
//D. Target Firefox 2 and above | |
if ($.browser.mozilla && $.browser.version >= "1.8" ) {}; |
This file contains 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
function equalHeight(group) { | |
tallest = 0; | |
group.each(function() { | |
thisHeight = $(this).height(); | |
if(thisHeight > tallest) { | |
tallest = thisHeight; | |
} | |
}); | |
group.height(tallest); | |
} | |
/* | |
Usage: | |
$(document).ready(function() { | |
equalHeight($(".recent-article")); | |
equalHeight($(".footer-col")); | |
}); | |
*/ |
This file contains 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
$('#myImage').attr('src', 'image.jpg').load(function() { | |
alert('Image Loaded'); | |
}); |
This file contains 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
/* | |
The target="blank" attribute can be useful when you want a link to be opened in a new tab or window. Though, the target="blank" attribute is not valid XHTML 1.0 Strict. | |
using jQuery, you can achieve the same functionality without having validation problems. | |
*/ | |
$("a[@rel~='external']").click( function() { | |
window.open( $(this).attr('href') ); | |
return false; | |
}); |
This file contains 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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> |
This file contains 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
function parseXml(xml) | |
{ | |
//find every Tutorial and print the author | |
$(xml).find("Tutorial").each(function() | |
{ | |
$("#output").append($(this).attr("author") + "<br />"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment