Created
June 21, 2011 11:01
-
-
Save rwbaker/1037626 to your computer and use it in GitHub Desktop.
Ajax Load Colorbox Assets
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
//Add colorbox style | |
var url = '../css/colorbox.css'; | |
if ( document.createStyleSheet ) { | |
//http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx | |
document.createStyleSheet(url,1); | |
} else { | |
jQuery.root.find('head').append('<link rel="stylesheet" media="all" href="'+url+'">'); | |
}; | |
//Load colorbox script | |
$.getScript('../js/jquery.colorbox-min.js', function(){ | |
jQuery.root.find('.enlarge-photo').colorbox(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment