0

我正在为页面设置以下内容(顺便说一下,同位素砌体系统工作得很好,只是不是那种):

<script type="text/javascript">
$(function(){

  var $container = $('#wall');

  $container.isotope({
    itemSelector : '.block2',
    getSortData : {
      name : function ( $elem ) {
        return $elem.find('.name').text();
      }
    },
    getSortData : {
      site : function ( $elem ) {
        return $elem.find('.site').text();
      }
    }
  });

  $container.infinitescroll({
    navSelector  : '#page_nav',    // selector for the paged navigation 
    nextSelector : '#page_nav a',  // selector for the NEXT link (to page 2)
    itemSelector : '.block2',     // selector for all items you'll retrieve
    loading: {
        finishedMsg: 'No more pages to load.',
        img: 'http://i.imgur.com/qkKy8.gif'
      }
    },
    // call Isotope as a callback
    function( newElements ) {
      $container.isotope( 'appended', $( newElements ) ); 
    }
  );
});
</script>

带有示例数据:

<div class="block2">
<li class="list_item">
<div class="list_item_view">
<div class="list_item_name" title="JETS Journey 2011" style=font-size:11px;>
<span class="name">Jets Journey 2011</span></div>
<div class="site"><span class="site">abc.com</span></div></div></div>

<div class="block2">
<li class="list_item">
<div class="list_item_view">
<div class="list_item_name" title="Killers" style=font-size:11px;>
<span class="name">Killers</span></div>
<div class="site"><span class="site">ydc.com</span></div></div></div>

<div class="block2">
<li class="list_item">
<div class="list_item_view">
<div class="list_item_name" title="Best yet" style=font-size:11px;>
<span class="name">Best yet</span></div>
<div class="site"><span class="site">cagey.com</span></div></div></div>

并调用排序更改:

<a href=#sortBy=name>name</a> <a href=#sortBy=site>site</a>

但是当我单击排序链接时根本没有任何反应——我是否在某处遗漏了一个简单的点?

4

1 回答 1

2

有关工作示例,请参见此处的小提琴。将第一个排序出来并按升序和降序排序

于 2012-08-07T09:47:49.533 回答