html瀑布流布局实例,jQuery Wookmark 瀑布流布局 Example 基本示例 - 手册网

jQuery Wookmark 瀑布流布局

Example 基本示例

所有图片的宽度和高度都已设置,这样可以在图片加载之前就进行布局。

调整浏览器窗口大小,或者单击列表中的项目时,会触发列表布局更新。

  • image_1.jpg

    1

  • image_2.jpg

    2

  • image_3.jpg

    3

  • image_4.jpg

    4

  • image_5.jpg

    5

  • image_6.jpg

    6

  • image_7.jpg

    7

  • image_8.jpg

    8

  • image_9.jpg

    9

  • image_10.jpg

    10

  • image_1.jpg

    11

  • image_2.jpg

    12

  • image_3.jpg

    13

  • image_4.jpg

    14

  • image_5.jpg

    15

  • image_6.jpg

    16

  • image_7.jpg

    17

  • image_8.jpg

    18

  • image_9.jpg

    19

  • image_10.jpg

    20

  • image_1.jpg

    21

  • image_2.jpg

    22

  • image_3.jpg

    23

  • image_4.jpg

    24

  • image_5.jpg

    25

  • image_6.jpg

    26

  • image_7.jpg

    27

  • image_8.jpg

    28

  • image_9.jpg

    29

  • image_10.jpg

    30

(function ($){

var handler = $('#tiles li');

handler.wookmark({

// Prepare layout options.

autoResize: true, // This will auto-update the layout when the browser window is resized.

container: $('#main'), // Optional, used for some extra CSS styling

offset: 5, // Optional, the distance between grid items

outerOffset: 10, // Optional, the distance to the containers border

itemWidth: 210 // Optional, the width of a grid item

}

);

// Capture clicks on grid items.

handler.click(function(){

// Randomize the height of the clicked item.

var newHeight = $('img', this).height() + Math.round(Math.random() * 300 + 30);

$(this).css('height', newHeight+'px');

// Update the layout.

handler.wookmark();

}

);

}

)(jQuery);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值