zoukankan      html  css  js  c++  java
  • jquery . fancybox()

    1.父页面

    function chooseTopic(btn) {//选择议题
            $.fancybox({
                type : 'iframe',
                href : '',
                fitToView : false,
                width : '800',
                height : '420',
                overlayShow : false,
                autoSize : false,
                closeClick : false,
                openEffect : 'none',
                closeEffect : 'none',
                beforeClose : function() {
                    var topicId = $(".fancybox-iframe").contents().find("#topicId").val();传递子页面的数值
                    var topicName = $(".fancybox-iframe").contents().find("#topicName").val();传递子页面的数值                            
                       $(btn).val(topicName);
                }
            });
        }

     2.子页面

               <form  >
                    <table style="margin-top: 4px;  98%; height: 100%;" >
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th >议题名称</th>
                            </tr>
                        </thead>
                        <tbody >
                            <c:forEach var="vft" items="${VoteFormTopices}" varStatus="status">
                                <tr>
                                    <td style="text-align: center;" id="sortIndex" >${status.index + 1}</td>
                                    <td ><a href="#" onclick="javascript:chooseTopic(this);" topicId="${vft.topic.id}" 
    topicName="${vft.topic.name}"> ${vft.topic.name}</a>
    </td> </tr> </c:forEach> </tbody> </table> </form>
    function chooseTopic (obj) {
        $("#topicId").val($(obj).attr("topicId"));
        $("#topicName").val($(obj).attr("topicName"));
        window.parent.$.fancybox.close(); 
    }
  • 相关阅读:
    20170728xlVba SSC_TODAY
    卸载angular版本
    union 共用体
    bootstrap的粗认识
    结构体,结构体数组,结构体指针
    C语言的枚举
    nodeJS 的认识
    nodejs 平台搭建
    动态表单
    指针
  • 原文地址:https://www.cnblogs.com/mcahkf/p/5611066.html
Copyright © 2011-2022 走看看