子页面就一个单纯的button
<button type="button" id="close">关闭</button>子页面jquery
$(function(){
$("#close").click(function(){
window.parent.tabsClose();
});
});父页面jquery
function tabsClose(){
var tab=$('#tab_id').tabs('getSelected');//获取当前选中tabs
var index = $('#tab_id').tabs('getTabIndex',tab);//获取当前选中tabs的index
$('#tab_id').tabs('close',index);//关闭对应index的tabs
}
本文介绍了如何在HTML页面中使用jQuery实现一个简单的按钮点击事件,用于关闭包含ID为'close'的子页面。通过调用父页面的tabsClose()函数来实现子页面的关闭功能。
698

被折叠的 条评论
为什么被折叠?



