人
我试图让div重叠在我的桌子上,让用户知道这个td不再有效了。
Overlay TestsText1 | Text2 | Text3 | |
Text1 | Text2 | Text3 |
This is the overlay div.
的Javascript
$(document).ready(function() {
$('.row').mouseover(function() {
var $divOverlay = $('#divOverlay');
var bottomWidth = $(this).css('width');
var bottomHeight = $(this).css('height');
var rowPos = $(this).position();
bottomTop = rowPos.top;
bottomLeft = rowPos.left;
$divOverlay.css({
position: 'absolute',
top: bottomTop,
right: '0px',
width: '66.7%',
height: bottomHeight
});
$('#info').text('Top: ' + bottomTop + ' Left: ' + bottomLeft);
$divOverlay.delay(1000).slideDown('fast');
});
$('#divOverlay').mouseleave(function() {
var $divOverlay = $('#divOverlay');
$divOverlay.slideUp();
});
});
CSS
.cell{width: 80px; height: 80px; border: 1px solid #000;}
.blind{display: none; background:#000; height: 80px; width: 320px;}
.second{display:none; background: #00f; height: 80px; width: 320px;}
#divOverlay { display: none; background-color:Silver; text-align:center; position:absolute; z-index:10000; opacity:0.5; }
从上面的例子中,我只想删除mouserover效果,这样
divOverlay可以在任何时候超过td。
我试图修改Javascript代码,但我失败了。