jq datatables 分页事件问题! datatablesajax 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用jq给分页控件容器增加click事件隐藏你的气泡就行了$('分页控件容器选择器').click(function(){ $('气泡选择器').hide();}); 出了个问题$('#div1 a').click(function(){ $("#div1 span").each(function(){$(this).poshytip('hide')}) });当点击下一页的时候 气泡关不掉 分析原因是 找不到要关闭气泡的span标签 好像先分页成功了才执行关闭气泡事件 页面没有上一页的SPAN了 所以关不掉版主帮忙想个办法把 $('#div1 a').click(function(){ $("#div1 span").each(function(){$(this).poshytip('hide')}) });气泡选择器没对吧气泡放在导航里面? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>无标题页</title> <link href="css/tip-darkgray/tip-darkgray.css" rel="stylesheet" type="text/css" /> <script src="js/jquery-1.8.2.js" type="text/javascript"></script> <script src="js/jquery.poshytip.js" type="text/javascript"></script> <script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script> <script> function del(id) { $("#"+id+"").poshytip('hide'); }$(function () { $("#div1 span").each(function () { var s=$(this).attr("id"); $(this).poshytip({ className:'tip-darkgray', showOn:'none', alignTo:'target', alignX:'inner-left', offsetX:0, offsetY:5, content:function (updateCallback) { $.ajax({ url:'Handler.ashx', data:{ "id":s }, cache:false, success:function (txt) { updateCallback(txt); } }); } }); $(this).click(function () { $(this).poshytip('show'); }); });});</script> </head><body><form id="form1" runat="server"><div id="div1"><table class="style1" id="example"><thead><tr><td>城市</td></tr></thead><tbody><tr><td><span style="cursor:pointer" id="Span1">北京</span></td></tr><tr><td><span style="cursor:pointer" id="Span2">上海</span></td></tr><tr><td><span style="cursor:pointer" id="Span3">成都</span></td></tr><tr><td><span style="cursor:pointer" id="Span4">辽宁</span></td></tr><tr><td><span style="cursor:pointer" id="Span5">吉林</span></td></tr><tr><td><span style="cursor:pointer" id="Span6">江苏</span></td></tr><tr><td><span style="cursor:pointer" id="Span7">山西</span></td></tr><tr><td><span style="cursor:pointer" id="Span8">山东</span></td></tr><tr><td><span style="cursor:pointer" id="Span9">河北</span></td></tr><tr><td><span style="cursor:pointer" id="Span10">河南</span></td></tr><tr><td><span style="cursor:pointer" id="Span11">新疆</span></td></tr><tr><td><span style="cursor:pointer" id="Span12">内蒙</span></td></tr></tbody></table></div></form><script type="text/javascript"charset="utf-8">$(document).ready(function () { $('#example').dataTable(); $('#div1 a').click(function () { $("#div1 span").each(function () { $(this).poshytip('hide') }) });});</script></body></html> 页面加载后 为DIV1 里面的span 点击事件创建气泡 然后DIV中的Table 装入 datatables 装入datatables 后 DIV1里面 会出现一些分页标签 然后给所有A标签 创建点击事件 关闭 span的气泡 现在就是 如果在第一页点击一个SPAN标签 会弹出相应气泡 然后点下一页 数据先分页了 气泡关不掉 再点 上一页 的时候 数据分页 气泡关掉了。我分析就是 分页先执行了 选择器找不到要关闭的SPAN气泡 当再点 上一页 选择器又能找到SPAN的气泡了 所以关闭了 $("#dataTableID_paginate").on("click", "a", function() { alert("clicked") }); 急求正则解决 jQuery 子元素事件继承问题? Jquery Ajax问题 求解决 url参数问题 商品对比功能的js功能,在线等 麻烦大家来帮帮忙,关于js的! 能不能刷新指定window.name的窗口 做了一个loading效果,但有时页面加载得挺快,loading一出来,马上就进入页面了,我的loading代码如下(很简单的),怎么做可以让loading固定显 如何在Frame页面里关闭整个窗口? 如何用JS给网页中的ActiveX控件设定参数值,如: jquery似乎总是加载失败 colorbox 打开新页面后 高度还能控制码?
$('气泡选择器').hide();
});
出了个问题
$('#div1 a').click(function(){
$("#div1 span").each(function(){$(this).poshytip('hide')})
});
当点击下一页的时候 气泡关不掉
分析原因是 找不到要关闭气泡的span标签 好像先分页成功了才执行关闭气泡事件 页面没有上一页的SPAN了 所以关不掉
版主帮忙想个办法把
$("#div1 span").each(function(){$(this).poshytip('hide')})
});
气泡选择器没对吧气泡放在导航里面?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<link href="css/tip-darkgray/tip-darkgray.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.8.2.js" type="text/javascript"></script>
<script src="js/jquery.poshytip.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script>
<script>
function del(id)
{
$("#"+id+"").poshytip('hide');
}
$(function () {
$("#div1 span").each(function () {
var s=$(this).attr("id");
$(this).poshytip({
className:'tip-darkgray',
showOn:'none',
alignTo:'target',
alignX:'inner-left',
offsetX:0,
offsetY:5,
content:function (updateCallback) {
$.ajax({
url:'Handler.ashx',
data:{
"id":s
},
cache:false,
success:function (txt) {
updateCallback(txt);
}
});
}
});
$(this).click(function () {
$(this).poshytip('show');
});
});
}
);
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="div1">
<table class="style1" id="example">
<thead>
<tr><td>城市</td></tr>
</thead>
<tbody>
<tr><td><span style="cursor:pointer" id="Span1">北京</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span2">上海</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span3">成都</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span4">辽宁</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span5">吉林</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span6">江苏</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span7">山西</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span8">山东</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span9">河北</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span10">河南</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span11">新疆</span></td></tr>
<tr><td><span style="cursor:pointer" id="Span12">内蒙</span></td></tr>
</tbody>
</table>
</div>
</form>
<script type="text/javascript"charset="utf-8">
$(document).ready(function () {
$('#example').dataTable();
$('#div1 a').click(function () {
$("#div1 span").each(function () {
$(this).poshytip('hide')
})
});
});
</script>
</body>
</html>
现在就是 如果在第一页点击一个SPAN标签 会弹出相应气泡 然后点下一页 数据先分页了 气泡关不掉 再点 上一页 的时候 数据分页 气泡关掉了。我分析就是 分页先执行了 选择器找不到要关闭的SPAN气泡 当再点 上一页 选择器又能找到SPAN的气泡了 所以关闭了