如何讓Jquery代碼只選擇主div(.post)? 它也影響它的孩子,內部div。JQuery選擇器影響其子
我使用這個:
$(document).ready(function() {
$(".post")
.mouseover(function() {
$(this).animate({
height: 180,
width: 160
}, 200, function() {
// Animation complete.
});
})
.mouseout(function() {
$(this).animate({
height: 150,
width: 150
}, 200, function() {
// Animation complete.
});
});
});
下面的代碼:http://jsfiddle.net/q5g4xrqf/
不適合我(火狐37)瀏覽器的問題可能影響內部元件? – atmd 2015-02-24 16:45:47
當您將鼠標移動到橙色div上時,它會增長,好! 但是,當你在橙色裏面滾過黑色時,它會縮小並再次增長...:/ – 2015-02-24 16:49:18
所以,我更新了這裏:http://jsfiddle.net/q5g4xrqf/5/ 我想要一個文本出現在橙色div的頂部,但我不希望黑色div移動。什麼是最好的解決方案? 這是它是如何:http://jsfiddle.net/q5g4xrqf/6/ – 2015-02-25 15:53:50