jQuery .support() implementation
Can someone take a look at the following plugin. I its a basic AJAX navigation plugin and it fades content into a div when menu buttons are pressed. What would be the easiest way to exclude IE 6/7/8 from recognizing the fade effect? I just want IE to not see the fadeOut/fadeIn part of the plugin:
$(function() {
var newHash = "",
$mainContent = $("#main-content"),
$pageWrap = $("#page-wrap"),
baseHeight = 0,
$el;
$("nav#footer").delegate("a", "click", function() {
window.location.hash = $(this).attr("href");
return false;
});
$(window).bind('hashchange', function(){
newHash = window.location.hash.substring(1);
if (newHash) {
$mainContent
.find("#guts")
.fadeOut(200, function() {
$mainContent.show().load(newHash + " #guts", function() {
$mainContent.fadeIn(开发者_开发百科200, function() {
});
$("nav#footer a").removeClass("current");
$("nav#footer a[href="+newHash+"]").addClass("current");
});
});
};
});
$(window).trigger('hashchange');
Since IE does not support cssFloat you can use jQuery $.support
and issue the following conditional to detect if browser is IE if($.support.cssFloat) {....
精彩评论