Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

203 lines (182 sloc) 28.659 kb
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Socialite.js</title>
<link rel="stylesheet" href="demo.css">
<!--[if lt IE 9]>
<script type="text/javascript">
(function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f=f||m(c);var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(a){return r.shivMethods?n(a):b.createElem(a)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)})(this,document)
</script>
<![endif]-->
</head>
<body>
<div class="text">
<h1>Scroll Demo</h1>
<p><strong>Activate buttons once the parent article is visible.</strong></p>
</div>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<article class="text">
<h2>Article Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut suscipit felis. Duis massa lectus, vulputate a condimentum eget, pulvinar eget erat. Aliquam erat volutpat. Integer viverra nunc at metus interdum nec luctus felis dapibus. Cras blandit ipsum vel nibh cursus sed condimentum ante hendrerit. Aliquam pulvinar tincidunt dui quis consequat. Donec erat odio, faucibus ac hendrerit et, iaculis vitae enim. Sed volutpat aliquet tempus. Suspendisse sodales mollis varius. Morbi libero turpis, elementum ac hendrerit ac, lobortis a ligula. In hac habitasse platea dictumst.</p>
<p>Praesent euismod tincidunt felis, quis elementum lorem suscipit sed. Ut adipiscing, tortor elementum hendrerit blandit, lorem lectus tempor magna, vitae semper metus turpis ac leo. Nulla in dui sit amet nulla condimentum ornare. Maecenas sed egestas felis. Nulla porta leo sit amet augue ullamcorper rhoncus. Donec sodales, dui luctus sollicitudin scelerisque, dui risus iaculis magna, id ultricies ipsum arcu eu dui. Etiam gravida sagittis nunc, ut molestie enim placerat et. Ut imperdiet sapien nec est pulvinar ullamcorper. Etiam ac risus diam, vitae rutrum diam. Donec et nulla dolor.</p>
<ul class="social-buttons cf">
<li><a href="http://twitter.com/share" class="socialite twitter-share" data-text="Socialite.js" data-url="http://socialitejs.com" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a></li>
<li><a href="https://plus.google.com/share?url=http://socialitejs.com" class="socialite googleplus-one" data-size="tall" data-href="http://socialitejs.com" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://www.socialitejs.com&amp;t=Socialite.js" class="socialite facebook-like" data-href="http://socialitejs.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://socialitejs.com&amp;title=Socialite.js" class="socialite linkedin-share" data-url="http://socialitejs.com" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a></li>
</ul>
</article>
<div class="text">
<p>Copyright &copy; <a rel="author" href="http://dbushell.com/">David Bushell</a>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="../socialite.js"></script>
<script>
// Only use jQuery if the website already makes extensive use of it!
$(document).ready(function()
{
var articles = $('article.text'), socialised = { }, win = $(window), updateArticles, onUpdate, updateTimeout;
updateArticles = function()
{
// viewport bounds
var wT = win.scrollTop(),
wL = win.scrollLeft(),
wR = wL + win.width(),
wB = wT + win.height();
// check which articles are visible and socialise!
for (var i = 0; i < articles.length; i++) {
if (socialised[i]) {
continue;
}
// article bounds
var art = $(articles[i]),
aT = art.offset().top,
aL = art.offset().left,
aR = aL + art.width(),
aB = aT + art.height();
// vertial point inside viewport
if ((aT >= wT && aT <= wB) || (aB >= wT && aB <= wB)) {
// horizontal point inside viewport
if ((aL >= wL && aL <= wR) || (aR >= wL && aR <= wR)) {
socialised[i] = true;
Socialite.load(articles[i]);
}
}
}
};
onUpdate = function()
{
if (updateTimeout) {
clearTimeout(updateTimeout);
}
updateTimeout = setTimeout(updateArticles, 100);
};
win.on('resize', onUpdate).on('scroll', onUpdate);
setTimeout(updateArticles, 100);
});
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.