zoukankan      html  css  js  c++  java
  • ionic中自定义底部弹出框

    通用部分:
    <script>
         MY_FUNCTION = (function() {
            var upSheet = document.createElement('div');
            upSheet.setAttribute('style', 'display:none;position:absolute;left:0px;top:0px;z-index: 9999;');
            upSheet.style.width = document.documentElement.clientWidth + 'px';
            upSheet.style.height = document.documentElement.clientHeight + 'px';

            var sheet = document.createElement('div');
            sheet.setAttribute('style', 'display:block;100%;min-height:0px;position:absolute;left:0px;bottom:0px;z-index:10000;');
            upSheet.appendChild(sheet);
            document.body.appendChild(upSheet);
           return {
             scope : null,
             showUpSheet : function(o) {
               this.scope = o.scope;
               this.item=o.item;        
               sheet.innerHTML = o.template;
               upSheet.style.display = 'block';
             },
             hideUpSheet : function() {
               sheet.innerHTML = '';
               upSheet.style.display = 'none';
             }
           };
        })();
      </script>


    调用部分:
    $scope.showUpSheet = function() {
          MY_FUNCTION.showUpSheet({
            template: document.getElementById('templates/sheet.html').innerHTML
          });
        }

    html部分:
    <script id="templates/sheet.html" type="text/html">
      <div class="tabs-tanchu">
        11111111111
      </div>
    </script>

  • 相关阅读:
    翻译MDN里js的一些方法属性
    ajax相关
    我的面试错题
    写代码通用思路
    工厂模式
    cookie & session
    X-UA-Compatible设置IE浏览器兼容模式
    [转]IE6/IE7/IE8/IE9中tbody的innerHTML不能赋值的完美解决方案
    EasyUseCase 一款脑图转化 Excel 测试用例工具 (1.2 版本升级)
    XMind2TestCase:一个高效测试用例设计的解决方案!
  • 原文地址:https://www.cnblogs.com/cutone/p/5780595.html
Copyright © 2011-2022 走看看