├── i └── download.png ├── readme.md ├── c ├── gs.css ├── style.css └── gs-reference.css ├── t └── background-load.html ├── j ├── jquery.stalactite.min.js └── jquery.stalactite.js └── index.html /i/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonobr1/stalactite/HEAD/i/download.png -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## stalactite 2 | 3 | For most up-to-date information check out the public facing [page](http://jonobr1.github.com/stalactite). 4 | 5 | By [jonobr1](http://jonobr1.com/) and [jQuery](http://jquery.com/) -------------------------------------------------------------------------------- /c/gs.css: -------------------------------------------------------------------------------- 1 | .container_9{margin-left:auto;margin-right:auto;width:945px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9{display:inline;float:left;position:relative;margin-left:3px;margin-right:2px}.alpha{margin-left:0}.omega{margin-right:0}.container_9 .grid_1{width:100px}.container_9 .grid_2{width:205px}.container_9 .grid_3{width:310px}.container_9 .grid_4{width:415px}.container_9 .grid_5{width:520px}.container_9 .grid_6{width:625px}.container_9 .grid_7{width:730px}.container_9 .grid_8{width:835px}.container_9 .grid_9{width:940px}.container_9 .prefix_1{padding-left:105px}.container_9 .prefix_2{padding-left:210px}.container_9 .prefix_3{padding-left:315px}.container_9 .prefix_4{padding-left:420px}.container_9 .prefix_5{padding-left:525px}.container_9 .prefix_6{padding-left:630px}.container_9 .prefix_7{padding-left:735px}.container_9 .prefix_8{padding-left:840px}.container_9 .suffix_1{padding-right:105px}.container_9 .suffix_2{padding-right:210px}.container_9 .suffix_3{padding-right:315px}.container_9 .suffix_4{padding-right:420px}.container_9 .suffix_5{padding-right:525px}.container_9 .suffix_6{padding-right:630px}.container_9 .suffix_7{padding-right:735px}.container_9 .suffix_8{padding-right:840px}.container_9 .push_1{left:105px}.container_9 .push_2{left:210px}.container_9 .push_3{left:315px}.container_9 .push_4{left:420px}.container_9 .push_5{left:525px}.container_9 .push_6{left:630px}.container_9 .push_7{left:735px}.container_9 .push_8{left:840px}.container_9 .pull_1{left:-105px}.container_9 .pull_2{left:-210px}.container_9 .pull_3{left:-315px}.container_9 .pull_4{left:-420px}.container_9 .pull_5{left:-525px}.container_9 .pull_6{left:-630px}.container_9 .pull_7{left:-735px}.container_9 .pull_8{left:-840px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:after{clear:both;content:' ';display:block;font-size:0;line-height:0;visibility:hidden;width:0;height:0}.clearfix{display:inline-block}* html .clearfix{height:1%}.clearfix{display:block} -------------------------------------------------------------------------------- /t/background-load.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Does $.load method listen to background images? 5 | 6 | 7 | 29 | 30 | 31 | 57 | 58 | 59 | 60 |
    61 |
  1. Background image applied in <styles> in the head:
  2. 62 |
  3. 63 |
  4. Background image applied via JavaScript:
  5. 64 |
  6. 65 |
  7. Element placed by jQuery:
  8. 66 |
  9. 67 |
  10. $.load methods triggered:
  11. 68 |
69 | 70 | -------------------------------------------------------------------------------- /c/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | body { 7 | font-family: Helvetica, Arial, sans-serif; 8 | font-weight: 500; 9 | word-spacing: 2px; 10 | font-size: 11px; 11 | color: #333; 12 | /* background: #fff url('../i/stalactite.png') top right no-repeat;*/ 13 | } 14 | 15 | h2 { 16 | color: #444; 17 | font-size: 20px; 18 | line-height: 30px; 19 | font-weight: 500; 20 | word-spacing: 1px; 21 | } 22 | 23 | h3.active { 24 | background: #999; 25 | } 26 | 27 | h3 { 28 | 29 | width: 200px; 30 | margin: 5px 0; 31 | padding: 5px; 32 | text-align: center; 33 | text-transform: uppercase; 34 | letter-spacing: 2px; 35 | font-weight: 100; 36 | text-align: left; 37 | font-size: 10px; 38 | 39 | background: #ccc; 40 | color: #fff; 41 | 42 | -webkit-border-radius: 5px; 43 | -moz-border-radius: 5px; 44 | border-radius: 5px; 45 | } 46 | 47 | h3 a:link, h3 a:visited { 48 | color: #fff; 49 | text-decoration: none; 50 | } 51 | h3 a:hover, h3 a:active { 52 | background: none; 53 | color: #fff; 54 | text-decoration: underline; 55 | } 56 | 57 | p { 58 | margin: 0 0 25px 0; 59 | line-height: 17px; 60 | font-size: 11px; 61 | } 62 | 63 | img { 64 | border: 0 !important; 65 | } 66 | 67 | a#download:link, a#download:visited { 68 | margin-top: -20px; 69 | display: block; 70 | width: 100px; 71 | height: 100px; 72 | 73 | border: 1px dashed #333; 74 | -webkit-border-radius: 100px; 75 | -moz-border-radius: 100px; 76 | border-radius: 100px; 77 | } 78 | 79 | a#download:hover, a#download:active { 80 | background: #efefef; 81 | } 82 | 83 | .mute { font-size: 9px; color: #444; } 84 | 85 | a:link, a:visited { 86 | text-decoration: underline; 87 | color: #333; 88 | } 89 | a:hover, a:active { 90 | text-decoration: none; 91 | background: #ff0; 92 | } 93 | 94 | .container_9 {; 95 | border-bottom: 1px solid #efefef; 96 | } 97 | 98 | #text_cascade .character { 99 | 100 | height: 55px; 101 | float: left; 102 | 103 | text-transform: uppercase; 104 | font-weight: 900; 105 | letter-spacing: 2px; 106 | text-align: center; 107 | 108 | color: #333; 109 | background: #ccc; 110 | 111 | padding: 45px 0 0 0; 112 | margin: 2px 3px 2px 2px; 113 | } 114 | 115 | #text_cascade .character:hover { 116 | background: #efefef; 117 | } 118 | 119 | .content { 120 | text-align: left; 121 | } 122 | .content * { 123 | padding: 5px; 124 | } 125 | 126 | .container_9 .grid6 { 127 | width: 625px; 128 | } 129 | .container_9 .grid9 { 130 | width: 940px; 131 | } 132 | .container_9 .grid4 { 133 | width: 415px; 134 | } 135 | 136 | footer, .section { 137 | margin-top: 50px; 138 | margin-bottom: 50px; 139 | } -------------------------------------------------------------------------------- /j/jquery.stalactite.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery Stalactite : Lightweight Element Packing 3 | * Examples and documentation at: http://jonobr1.github.com/stalactite 4 | * Copyright (c) 2011 Jono Brandel 5 | * Version: 0.1 (8-SEPTEMBER-2011) 6 | * Requires: jQuery v1.6.2 or later 7 | * 8 | * Copyright 2011 jonobr1 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | (function(a){function D(h){h=h[0];for(var a=0;a=e.length&&(e=a('
82 |

stalactite

83 |
84 | 85 |
86 |

87 | A jquery plugin that slowly and lazily packs the contents of an element. Unlike most packing libraries that try to do all the math and sorting up front, stalactite takes a lazy approach and sorts each child element sequentially. This can add a sense of curation as it makes your viewer aware of the browser's decisions. 88 |

89 |
90 |
91 | Download 92 |
93 | Download the minified version (4kb) 94 |
95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 |

103 | It sorts all types of content and is especially diligent about images, videos, and iframes making sure to load all media before assessing proper widths and heights. 104 |

105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 |

114 | It does this by setting all children of an element to display: inline-block; As a result this plugin requires a modern browser and plays well with Ben Barnett's Animate Enhanced. Scroll to the bottom to see usage. 115 |

116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 |
126 | 127 |
128 |
129 |

Usage

130 |
131 | 132 | $("#container").stalactite({
133 | duration: 350,                        // Duration of animation.
134 | easing: 'swing',                      // Easing method.
135 | cssPrefix: '.stalactite',             // The css naming convention.
136 | cssPrep: true,                        // Should stalactite structurally modify css of children?
137 | fluid: true,                          // Should stalactite recalculate on window resize?
138 | loader: '<img />',                    // The contents of the loader. Defaults to a dataURL animated gif.
139 | styles: {}                            // A style object to place on the child elements
140 | complete: function(v) { return v; }  // Callback function
141 | });

142 | // or $("#container").stalactite(); — these are all optional params. 143 |
144 |
145 |
146 | 147 |
148 | Examples (click to see example): 149 |

Fluid Example

150 |

Custom CSS

151 |
152 |
153 | 154 | 171 | 172 | 189 | 190 |
191 | By jonobr1 — only for jQuery. Images from Gimmebar. 192 |
193 | 194 | --------------------------------------------------------------------------------