zoukankan      html  css  js  c++  java
  • jquery的Layer弹出框操作

    在layer中,我们要先获取窗口的索引,然后再进行操作。
    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

    $("#update_id").click(function() { parent.$('#father_id').html(autoSelectName);//对父页面的元件操作,给id为father_id进行赋值。 window.parent.location.reload(); //刷新父页面 parent.layer.close(index); });
    openUser是一个js方法,selectId,selectName是传的参数,里面调用layer的open方法,area是弹出框的大小,content是请求页面路径。
    还要导入layer的js包,在layer的官网上可以下载,加载layer.js就行,注意,这个好像要求jquery的版本是1.8以上才行。
    function
    openUser(selectId,selectName){ layer.open({ type: 2, title: '选择关联人', maxmin: true, area: ['1000px', '600px'], content: '${base}/user/listLayout?selectId='+selectId+'&selectName='+selectName, scrollbar: false, end: function(){ } }); }


    在layer的官网有很全的例子供大家学习,我觉得这个功能比较强大,当然如果要弄弹出层,也可以采用bootsrap的静态框。
    layer的官网:http://layer.layui.com/
  • 相关阅读:
    EL+Serilog日志
    HttpClientFactory-向外请求的最佳
    Autofac依赖注入
    .Net Core MemoryCache
    时间复杂度和空间复杂度
    中间件-异常处理
    依赖注入-1
    使用并发集合
    安卓刷机&root
    Mac Android Studio 常用快捷键大全
  • 原文地址:https://www.cnblogs.com/TerLeeHost/p/7843398.html
Copyright © 2011-2022 走看看