1
我有兩個代碼部分,使3件事情:jQuery的調整格框懸停
- 調整在同一時間只有6個.boxes DIV一個(與它的文本內容)
- 化妝未被選擇
- 顯示隱藏更多跨度透明.box的div的
CODE:
$('.content_area div').hide();
$(function(){
$('.box').bind('mouseover',function() {
$(this).addClass('up');
$('.box').not('.up').fadeTo('normal',0.2);
});
$('.box').bind('mouseout',function() {
$('.box').removeClass('up').fadeTo('normal',1);
});
});
initwidth = $('.box').width();
initHeight = $('.box').height();
$('.box').hover(function(){
$(this).children('.more').show();
$(this).stop().animate({width: '220', height: '140'},{queue:false, duration:'fast'}).css('font-size', '1.2em');
}, function(){
$(this).children('.more').hide();
$(this).stop().animate({width: initwidth, height: initHeight},{queue:false, duration:'fast'}).css('font-size', '1em');
});
但有些事情是錯誤的。只有第一個盒子工作得很好,但是當調整大小時,它並不掩蓋其他盒子。
它你可以在這裏看到效果:jsFiddle
我的問題:是否有可能,統一的代碼,使其工作? : - [
你很好。 Eveything就像一個魅力。謝謝你的幫助! – cachaito 2011-04-19 19:57:17
這個效果很好,但是有沒有辦法讓其他盒子的尺寸變小,因爲盒子變大了? – Tom 2011-07-13 20:38:08