jquery----常用的函數

來源:互聯網
上載者:User

標籤:3.1   rem   doc   多個   --   win   bsp   app   nbsp   

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>insertBefore() 方法在您指定的已有子節點之前插入新的子節點。 </title>    <script src=‘../jquery-3.1.1.min.js‘></script>    <script>        $(function(){            // insertBefore() 方法在您指定的已有子節點之前插入新的子節點。 添加在前面            // $(‘span‘).insertBefore($(‘div‘));                      // insertAfter() 方法在您指定的已有子節點之前插入新的子節點。 添加在後面            // $(‘div‘).insertAfter($(‘span‘));                        //appendTo()把元素內放到div屬於最後一個兄弟節點            //$(‘span‘).appendTo($(‘div‘));          //prepend()把元素內放到div屬於第一個兄弟節點            //$(‘span‘).prepend($(‘div‘));                      //刪除span元素            //$(‘span‘).remove();                //單個點擊運行事件           // $(‘div‘).on(‘click‘,function(){alert(‘div點擊‘);}            //    );         //多個點擊運行一個事件         //  $(‘div‘).on(‘click mousemove‘,function(){alert(‘div點擊加撫摸‘);});          //多個點擊運行多個事件          //$(‘div‘).on({          //    ‘click‘:function(){alert(‘點擊事件‘);},           //‘mouseover‘:function(){alert(‘撫摸事件‘);}});           //off關閉事件操作           // $(‘div‘).on(‘click‘, function(){           //      alert(‘清理事件‘);                         //      $(‘div‘).off(); });       //關閉單個撫摸事件      //     $(‘div‘).on(‘click mouseover‘,function(){alert(‘清理撫摸事件‘);      //         $(‘div‘).off(‘mouseover‘)      // });                //捲軸的寬高          $(document).on(‘click‘,function(){alert($(window).scrollTop());})         })            </script></head><body style="height: 2000px;">    <div>div div</div>    <span>span span</span></body></html>

 

jquery----常用的函數

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.