我试图设置一个简单的面板,跟随鼠标移动与外部iframe。我想在点击后隐藏它。到目前为止我得到了什么:
<div id="wrapper45" onclick="hideitnow(this)" style="position: absolute; opacity: 0.5; filter: alpha(opacity = 50); margin-left: -50px; z-index: 100;">
<script src="thescriptthatcallstheframe"></script>
</div>
<script type="text/javascript">
jQuery( document ).ready( function() {
$( "#link" ).mousemove( function( e ) {
$( '#wrapper45' ).css( {
top: e.pageY - 50,
left: e.pageX + 25
} );
} );
} )
</script>
hideitnow功能:
<script type="text/javascript">
function hideitnow(elem){
document.getElementById(elem).style.display = 'none';
}
</script>
有没有人知道为什么它不起作用!? 提前thx!
答案 0 :(得分:0)
<script type="text/javascript">
$(function() {
$("#link").mousemove(function(e) {
$('#wrapper45').css({
top: e.pageY - 50,
left: e.pageX + 25
});
});
$('#wrapper45').live('click', function() {
$(this).css({display: 'none'});
});
});
</script>