zoukankan      html  css  js  c++  java
  • H50075:html中 书写 代码 code

    1,

        <div class="col-12@sm">
          <h3>添加元素</h3>
          <p>无论您在DOM中添加元素的哪个位置,它都会显示在网格中(假设您使用默认的排序方式)。 考虑到这一点,您可以追加,前置或插入元素,以便让它们以正确的顺序显示。</p>
          
          <div class="code-block">
            <pre rel="JavaScript">
              <code class="language-javascript">
                Demo.prototype.setupEvents = function () {
                  document.querySelector('#append').addEventListener('click', this.onAppendBoxes.bind(this));
                };
    
                /**
                * Create some DOM elements, append them to the shuffle container, then notify
                * shuffle about the new items. You could also insert the HTML as a string.
                */
                Demo.prototype.onAppendBoxes = function () {
                  var elements = this._getArrayOfElementsToAdd();
    
                  elements.forEach(function (element) {
                    this.element.appendChild(element);
                  }, this);
    
                  // Tell shuffle elements have been appended.
                  // It expects an array of elements as the parameter.
                  this.shuffle.add(elements);
                };
              </code>
            </pre>
          </div>

    琥珀君的博客
  • 相关阅读:
    Nexus3.0私服搭建
    JavaScript
    Spring基础
    Hibernate注解
    HTML5
    Apache Tomcat
    Java安装(Ubuntu)
    C++ 日期 & 时间
    C++ 引用
    C++ 指针
  • 原文地址:https://www.cnblogs.com/eliteboy/p/14688170.html
Copyright © 2011-2022 走看看