1
我正在使用jQuery.innerfade插件,它沒有響應:::我在jQuery中編寫了一些工作得很好的東西:::只是想知道這是否是最優編碼,因爲我沒有很多jQuery的知識:::爲innerfade優化jQuery代碼
// Set container height
var innerfade_H = $('#blog_link .container').height();
$("#blog_link .container").css("height", innerfade_H);
// Resize innerfade on resize
function resize_innerfade() {
$('#blog_link .container, .blog_link').css("height", ""); //clear heights we will be adding new height
$('.blog_link li').css("position", ""); //clear position this is so we can calculate the actual height
var innerfade_Resize = $('.blog_link').height(); //get new height
$("#blog_link .container, .blog_link").css("height", innerfade_Resize); //set the new height
$('.blog_link li').css("position", "absolute"); // reset position to absolute
};
// On resize lets put everything into motion little timer so screenwidth settles
var resizeInn;
jQuery(window).resize(function() {
clearTimeout(resizeInn);
resizeInn = setTimeout(resize_innerfade, 200);
});