Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vanilla - Sticky v 0.4 : Better calc, resize calc, margin:0 on elemen…
…t by default, demo
- Loading branch information
Showing
3 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
layout: default | ||
--- | ||
<script> | ||
window.domReady(function() { | ||
var els = $$_('h3', document.getElementById('sticky')); | ||
for (var el in els) { | ||
if (els.hasOwnProperty(el) && typeof els[el] == 'object' && ('tagName' in els[el])) { | ||
new vanillaSticky(els[el], { | ||
stickyParent: els[el].parentNode | ||
}); | ||
} | ||
} | ||
}); | ||
</script> | ||
<div id="sticky"> | ||
<div> | ||
<h3>az</h3> | ||
<p>If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on.</p> | ||
</div> | ||
<div> | ||
<h3>bz</h3> | ||
<p>If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on.</p> | ||
</div> | ||
<div> | ||
<h3>cz</h3> | ||
<p>If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on.</p> | ||
</div> | ||
</div> |