jquery控制漂浮层 在鼠标单击时的坐标位置显示

 

<script>
$(function(){
	
	$('#closeCon').click(function(){ $('#kfms').hide('slow'); });
	
	$('.kfConDiv').bind('click',function(e){
	
		var xx = e.originalEvent.x || e.originalEvent.layerX || 0; 
		var yy = e.originalEvent.y || e.originalEvent.layerY || 0; 
		
		$('#kfms').css('top',yy);
		$('#kfms').css('left',xx);
		
		$('#kfms').show('slow',function(){ $('#kfContent').text('扣分原因'); });
	});

});
</script>

 <style>

body{ background:url(../../../vehstyle/css/material/bg/examTblBg.jpg)}
.drvScoreDataTr td{border:1px solid blue;}

.kfConDiv{
	width:262px; height:36px; border:1px solid red; text-overflow:ellipsis;
}

.mesCtn{ position:absolute; top:500px; left:460px; width:200px; height:120px; padding:2px; background-color:#6CF; display:none;}

.closeCtn{ float:left; width:200px; height:23px; padding:1px; background-color:#6699FF;}

.closeDiv{ float:right; width:25px; height:25px; line-height:25px; color:#009; font-size:38px; text-align:center; background-color:#F33; border:#009; cursor:pointer;}

.contentDiv{ float:left; font-size:13px; width:192px; height:86px; padding:5px;}

</style>

 <body>

<table id="drvScoreMes" cellpadding="0" cellspacing="0" style=" border:1px solid #ccc;">
  <tr id="drvScoreMesTitle">
    <td style="width:40px;" align="center">&nbsp;扣分 </td>
    <td class="titleSplit"></td>
    <td style="width:262px;"> &nbsp;扣分原因 </td>
    <td class="titleSplit"></td>
    <td style="width:90px;" align="center"> &nbsp;操作 </td>
    <td></td>
  </tr>
  <tr class="drvScoreDataTr">
    <td style="width:40px;" colspan="2" align="center">&nbsp;扣分 </td>

    <td style="width:262px;" colspan="2"> 
    	<div class="kfConDiv"> &nbsp;扣分原因扣分原因扣分原因扣分原因扣分原因扣分原因扣分原因扣分原因扣分原因扣分原因扣分原因扣</div> </td>

    <td style="width:90px;" align="center"> <input type="button" value="删除" /> </td>
    <td></td>
  </tr>
</table>

<!-- =================================== 内容层 =================================== -->
<div id="kfms" class="mesCtn"><div class="closeCtn"><div id="closeCon" class="closeDiv">×</div></div><div id="kfContent" class="contentDiv"></div></div>
</body>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值