`
yuxia_rainy
  • 浏览: 6366 次
  • 性别: Icon_minigender_2
  • 来自: 烟台
最近访客 更多访客>>
社区版块
存档分类
最新评论

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>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics