isotope/masonry 使用jQuery.sortable

來源:互聯網
上載者:User

標籤:des   style   blog   http   color   使用   

 1        function goMasonry() { 2                // if ($container.data(‘masonry‘) != undefined) { 3                     $container.isotope(‘destroy‘); 4                 } 5                 $container.isotope({ 6                     itemSelector: ‘.element‘, 7                     // transformsEnabled: false, 8                     animationEngine: ‘jquery‘, 9                     animationOptions: {10                         duration: 750,11                         easing: ‘swing‘,12                         queue: true13                     },14                     masonry: {15                         columnWidth: columnWidthT,16                         gutterWidth: gutterWidthT,17                         cornerStampSelector: ‘.corner-stamp‘18                     }19                 }, myCallBack);20             }
isotope方法
 1             $(‘#container‘).sortable({ 2                 placeholder: { 3                     element: function (currentItem) { 4                         return $("<li class=‘thumb element isotope-item rqq‘ style=‘margin: 1px; height: " + (currentItem.height() - 4) + "px; width: " + (currentItem.width() - 4) + "px; vertical-align: middle; text-align: center; outline: none; border: 1px dashed black; background-color: #97dd52;‘></li>")[0]; 5                     }, 6                     update: function (container, p) { 7                         return; 8                     } 9                 },10                 tolerance: function (currentItem) {11                     return ‘pointer‘;12                 },13                 items: ‘li‘,14                 opacity: 0.6,15                  16                 helper: function (event, element) {17                     var clone = $(element).clone();18                     clone.removeClass(‘isotope-item‘);19                     clone.removeClass(‘element‘);20                     element.removeClass(‘isotope-item‘);21                     element.removeClass(‘element‘);22                     return clone;23                 },24                 stop: function (event, ui) {25                     ui.item.addClass("isotope-item");26                     ui.item.addClass("element");27                     goMasonry();28 29                 },30                 change: function () {31                    32                 },33                 sort: function () {34                     goMasonry();35                    36                 }37             });
sortable方法
1 <ul  id="container">2      <li class="thumb  element"></li>3      <li class="thumb  element"></li>4      <li class="thumb  element"></li>5      <li class="thumb  element"></li>6 </ul>7            
Html 格式

http://api.jqueryui.com/sortable/

http://masonry.desandro.com/

http://isotope.metafizzy.co/docs/introduction.html

執行個體  http://tyler-designs.com/masonry-ui/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.