Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to transfer values from Layer pop-up layer to parent page in jQuery

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces jQuery how to achieve Layer pop-up layer value to the parent page related knowledge, detailed and easy to understand, simple and fast operation, with a certain reference value, I believe that everyone reading this jQuery how to achieve Layer pop-up layer value to the parent page article will be harvested, let's take a look at it.

Effect drawing:

代码:

$(document).ready(function(){//添加任务弹出层addTask(); });//弹出层function addTask(){$('[data-id="addList"]').on('click', function(){layer.open({type: 2,title: '添加任务',closeBtn:1,//maxmin: true,shadeClose: false, //点击遮罩关闭层area : ['15%' , '28%'],//弹层宽高content: 'jsp/taskconf/roundConf-addList.jsp'});});//关闭弹层layerClose();addTeam("addTeam");addTeam("addRule");}//点击确定按钮,先传值到父页面,然后关闭弹层function layerClose(){('[data-id="saveBtn"]').click(function(){ //点击确定按钮,获取弹层输入值,传入父页面 var parentId=parent.('[data-id="saveBtn"]').click(function(){ //点击确定按钮,获取弹层输入值,传入父页面 var parentId=parent.("#leftTree_1_ul");//接收值的父页面IDvar txt = $('[data-id="team-txt"]').val();//弹出层内获取要传出的值var str = "" +"" +"" +"" +""+txt+"" +"";parentId.append(str);//传值到父页面 //先得到当前iframe层的索引 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); //再执行关闭 });}关于"jQuery中怎么实现Layer弹出层传值到父页面"这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对"jQuery中怎么实现Layer弹出层传值到父页面"知识都有一定的了解,大家如果还想学习更多知识,欢迎关注行业资讯频道。

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report