博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JavaScript邮箱系统开发(五)
阅读量:7217 次
发布时间:2019-06-29

本文共 919 字,大约阅读时间需要 3 分钟。

hot3.png

一、顶部点击一个tab页

$('#B_history').on('click focus','li',function(e) {    e.preventDefault();    e.stopPropagation();    var data_id = $(this).data('id');    $(this).addClass('current').siblings('li').removeClass('current');    $('#iframe_'+ data_id).show().siblings('iframe').hide();   //隐藏其它iframe});

二、顶部关闭一个tab页

$('#B_history').on('click','a.del',function(e) {    e.stopPropagation();    e.preventDefault();    var li = $(this).parent().parent(),prev_li = li.prev('li'),data_id = li.attr('data-id');	li.hide(60,function() {	   $(this).remove();                   //移除选项卡	   $('#iframe_'+ data_id).remove();    //移除iframe页面	   var current_li = $('#B_history li.current');	   //找到关闭后当前应该显示的选项卡	   current_li = current_li.length ? current_li : prev_li;	   current_li.addClass('current');	   cur_data_id = current_li.attr('data-id');	   $('#iframe_'+ cur_data_id).show();	});});

转载于:https://my.oschina.net/yonglei/blog/295325

你可能感兴趣的文章
转:matlab+spider+weka
查看>>
步步为营 .NET 设计模式学习笔记 十五、Composite(组合模式)
查看>>
angular通过路由实现跳转 resource加载数据
查看>>
python try except, 异常处理
查看>>
字符串中的各种方法
查看>>
创建文件夹、新建txt文件
查看>>
js form表单 鼠标移入弹出提示功能
查看>>
LFS7.10——准备Host系统
查看>>
Redis.py客户端的命令总结【三】
查看>>
mac 安装secureCRT
查看>>
/var/adm/wtmp文件太大该怎么办?
查看>>
反应器模式 vs 观察者模式
查看>>
Algernon's Noxious Emissions POJ1121 zoj1052
查看>>
iOS-数据持久化-对象归档
查看>>
iOS开发UI篇—程序启动原理和UIApplication
查看>>
MUI 里js动态添加数字输入框后,增加、减少按钮无效
查看>>
python pip 更换国内安装源(windows)
查看>>
结对编程2后篇
查看>>
oracle exp 和 imp 数据和表结构互相独立导出导入
查看>>
iphone-common-codes-ccteam源代码 CCNSPredicate.m
查看>>