興趣的人最終代碼...
//=Jay. Create div before Showreel.
$(document).ready(function(){
$('.videopress').before("<div class='new'></div>");
});
var boxWidth = $('.videopress object').width();
//=Jay. Showreel Lights Out
$(document).ready(function(){
$(".new").hover(function() {
$(this).next().removeClass('videopress');
$('.videopress').animate({opacity: 0}, 1000);
//(Below) Chrome requires separate specificity for some reason, cannot chain these.
$('.videopress object').css('width', '0px');
$('html').animate({backgroundColor: "black" }, 1000);
$('nav').animate({opacity: 0}, 1000);
$('header').animate({opacity: 0}, 1000);
$('#showreel h1').animate({opacity: 0}, 1000);
},function() { //Showreel Lights on
$(this).next().addClass('videopress');
//(Below) Chrome requires separate specificity for some reason, cannot chain these.
$('.videopress object').css('width', boxWidth);
$('.videopress').animate({opacity: 100}, 1000);
$('html').animate({ backgroundColor: "white" }, 500);
$('nav').animate({opacity: 100}, 500);
$('header').animate({opacity: 100}, 500);
$('#showreel h1').animate({opacity: 100}, 500);
});
});
是你的問題更像hoverwithin「X」 PX() – 2011-03-17 17:28:33