JQuery Wookmark Load waterfall stream layout example demonstration, jquerywookmark
Waterfall stream layout is very suitable for displaying a large number of images. When you change the layout of a cropped image in a uniform size, each image can be displayed completely and displayed in a different way.
- Version:
- JQuery v1.4.3 +
- JQuery Wookmark Load v1.4.8
- Note:
The width and height attributes of the img element in the project must be written; otherwise, the positioning will be inaccurate. (You can use JavaScript to obtain the width and height of an image in real time, but it is unreliable if there are too many images .)
Github
Online instance
Basic Example of instance preview Example
Instance preview AMD Loader
Instance preview Endless scroll unlimited scrolling
Instance preview Flexible width elastic Layout
Instance preview Lightbox supports the light window plug-in
Instance preview Load it all dynamic read image size
Instance preview Placeholders at the bottom of Placeholders
Instance preview PHP server PHP loading data
Instance preview Remote API load data
Instance preview Filtering Or Filtering
Instance preview Filtering And Filtering
Instance preview Filtering Only Filtering
Instance preview Filtering Fade Filtering
Basic example of instance preview sorting
Basic example of instance preview stamping
How to load JavaScript files
<script src="jquery.js"></script>
<script src="jquery.wookmark.js"></script>
Copy CSS styles
/*
* Parent container needs to set relative positioning
* The project needs to be hidden.
*/
#list{position:relative;}
#list li{display:none;}
Copy the DOM Structure
<!--
In this example, $ ("# list") is the parent container, and the internal li is the project for waterfall flow layout. Of course, you can also use div or other labels to write.
The width and height attributes of the img element in the project must be written; otherwise, the positioning will be inaccurate.
-->
<ul id="list">
<li><p>text</p></li>
<li><p>text</p></li>
...
<li><p>text</p></li>
</ul>
Copy and call Wookmark
$('#list li').wookmark();
// Call custom Parameters
$('#list li').wookmark({
container: $('#list'),
offset: 10,
itemWidth: 200
});
Manually trigger layout events by copying
// You can manually trigger re-layout as needed
$('#list').trigger('refreshWookmark');
Copy parameter description
Name |
Default Value |
Description |
Container |
$ ('Body ') |
Parent container. You need to set the CSS attribute "position: relative" for the parent container during customization ". |
Align |
'Center' |
Alignment direction, which can be set to "left", "right", and "center ". |
Direction |
Undefined |
Sorting direction. Can be set to: "left" (from left to right), "right" (from right to left) If this parameter is not set, when align is set to "right", direction is "right"; otherwise, the default value is "left ". |
AutoResize |
False |
Whether to re-layout when the browser window size changes. |
ResizeDelay |
50 |
Detects the interval (MS) for automatic relayout ). |
ItemWidth |
0 |
The width of the list item (px or % ). |
FlexibleWidth |
0 |
The maximum adaptive width of the list item. When this item is set, the value of itemWidth serves as the minimum width of the list item. |
Offset |
2 |
The spacing (px) of the list items. |
VerticalOffset |
Undefined |
The Vertical spacing (px) of the list items. The horizontal and vertical spacing can be set in combination with the offset. |
OuterOffset |
0 |
The outer spacing between the container and the parent container. |
IgnoreInactiveItems |
True |
Whether to hide filtered items. |
FillEmptySpace |
False |
Whether to fill in the placeholder at the bottom. The placeholder class is "wookmark-placeholder ". |
Comparator |
Null |
Custom sorting method. |
PossibleFilters |
[] |
|
OnLayoutChanged |
Undefined |
The function that is triggered when the layout changes. |
Download