zoukankan      html  css  js  c++  java
  • 前端函数定义及表格总结

    一、javascript中定义函数是用var foo = function(){}和function foo(){}有什么区别?

      https://www.cnblogs.com/sharpest/p/6481853.html

      https://blog.csdn.net/weixin_30537451/article/details/99063383

    b();
    a();
    function b(){
      document.write("aa");
    }
    var a=function(){
      document.write("123");
    }

      function b(){} 为函数声明,程序运行前就已存在,var a = function(){} 为函数表达式,是变量的声明,属于按顺序执行,所以a为undefined,不能在函数定义的前面使用它。

    二、自定义table固定表头,内容滚动

      参考:https://www.cnblogs.com/mengfangui/p/7027393.html

      关键代码:

    table tbody {
        display: block;
        height: 80px;
        overflow-y: scroll;
    }
    table thead,tbody tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

      设置table滚动条样式

      参考:https://blog.csdn.net/weixin_44962808/article/details/103899598

      关键代码:

         table tbody::-webkit-scrollbar {/* 是否隐藏滚动条*/
                 /*display: none;*/ 
            }
            ::-webkit-scrollbar {/* 定义滚动条样式 */
                width: 6px;
                background-color: #F0F0F0;
            }
            ::-webkit-scrollbar-track {/*定义滚动条轨道 内阴影+圆角*/
                box-shadow: inset 0 0 0px #0905f3;
                border-radius: 5px;
                background-color: #F0F0F0;
            }
            ::-webkit-scrollbar-thumb {/*定义滑块 内阴影+圆角*/
                border-radius: 10px;
                box-shadow: inset 0 0 0px rgba(240, 240, 240, .5);
                background-color: #0065CF;
            }
                

    三、marquee标签

      参考:https://www.cnblogs.com/smiler/p/4892918.html

      marquee标签用于实现内容的滚动,在做表格时,单元格的内容可能会超出单元格的宽度,内容显示不全,可以设置为文字设置marquee标签,附加一些属性可以实现内容的滚动。

    四、Printwrite知识

      response.getWriter().write()只能打印文本格式的,不能打印对象。

      response.getWriter().write()和 response.getWriter().print()的区别 以及 PrintWriter对象 和 out对象 的区别:https://www.cnblogs.com/tfxz/p/13251776.html

     五、标签自定义属性及获取

      自定义div标签属性并获取

      

    <div style="margin-top: 100px;background: red; 100px;height: 100px;" value="divvalue" name="divname" data-value="divdata" 
       onclick
    ="testdiv(this)"> 111 </div>
    <script>
      function testdiv(data){
        console.log($(data).attr("name"))
        console.log($(data).attr("value"))
        console.log($(data).attr("data-value"))
      }
    </script>

      参考:https://blog.csdn.net/xyq286654901/article/details/72730012

  • 相关阅读:
    redis的几种模式
    redis ,memcache的对比
    忍龙sigma 不升级武器.图书馆百人斩包爽无脑操作攻略
    浏览器刷新或者关闭事件监听 beforeunload pagehide
    Element-Ui实现分页table缓存勾中数据
    [转载]Localtunnel使您可以轻松地在本地开发计算机上共享Web服务,而不会弄乱DNS和防火墙设置。
    cmder 分成四屏
    P3709 大爷的字符串题(莫队+离散化)
    P3604 美好的每一天(莫队+前缀和)
    P4462 [CQOI2018]异或序列(莫队+前缀和)
  • 原文地址:https://www.cnblogs.com/cxli99/p/13869539.html
Copyright © 2011-2022 走看看