Sunday, 07 June 2009 01:02
Some of you may have noticed the box at the bottom of the screen that keeps track of the page's vertical position. I wrote this in Mootools to sort of mimic some command line Linux tools like "less", "more", and "man".
window.addEvent( 'load', function() { var more = new Element( 'div', { 'id': 'more' }).setStyles({ 'position': 'fixed', 'bottom': '0px', 'left': '0px', 'z-index': '5', 'color': '#000', 'font-size': '0.8em', 'font-weight': 'bold', 'background-color': 'white', 'width': '120px', 'text-align': 'center', 'opacity': '0.7' }).appendText( '' ); document.body.appendChild( more ); setInterval( "doMore()", 200 ); }); function doMore() { var bodySize = window.getSize(); var pct = Math.round( ( bodySize.size.y + bodySize.scroll.y ) / bodySize.scrollSize.y * 100 ); var txt = pct < 100 ? '--More--('+pct+'%)' : '(END)'; $E('div#more').setText( txt ); }
Last Updated on Saturday, 05 December 2009 13:14
Add your comment
Featured Extensions
|
$3.00
FREE You Save: $3.00 |
$3.00
FREE You Save: $3.00 |
$10.00
FREE You Save: $10.00 |
$1.00
FREE You Save: $1.00 |
Latest Articles
Most Popular
The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries. Jeff Channell is not affiliated with or endorsed by Open Source Matters or the Joomla!® Project.



