项目js总结


//判断元素是否显示
if ($("#yuanYinDiv1").is(":hidden")) 

//子页面调用兄弟页面方法
window.parent.frames[0].zhuaiPai();
<!--more-->
//子页面关闭当前弹窗
 var index = parent.layer.getFrameIndex(window.name);
 parent.layer.close(index);

//数组指定位置插入    插入到0位置
tempCols.splice(0, 0, checkBoxBar);  

//删除1位置的元素
tempCols.splice(1, 1);     

//获取父元素下第几个元素
$("ul.layui-tab-title").children("li").eq(0).remove();

//清空select
$("#zrf").find("option:selected").text("");
$("#zrf").empty();

//加载select
var currentZtf = loadZrf();
$.each(currentZtf, function (index, item) {
// 下拉菜单里添加元素
$('#zrf').append(new Option(item.name, item.value));
})

//检测回车触发登陆
$(document).keyup(function (e) {
		if (e.which == 13) {
			$("#loginButton").trigger('click');
		}
	})
//应对 无法触发click事件
  $(document).on('click', '.task-link', function () {
        var _this = this;
        var taskId = $(_this).attr("data-id");})
//解决session过期 iframe 内登陆父页面跳转 在登陆页面加入
<script lang="JavaScript">
	if (window != top) {
		top.location.href = location.href;
	}
</script>
//获取实体类中某一属性数组
itemTypeList.stream().map(ItemType::getItemType)
/*select高度*/
.layui-form-select dl {
	max-height: 180px;!important;
}
posted @ 2020-11-07 13:10  JaminYe  阅读(285)  评论(0编辑  收藏  举报