<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bigjim-network &#187; scroll</title>
	<atom:link href="http://bigjim-network.be/tag/scroll/feed/" rel="self" type="application/rss+xml" />
	<link>http://bigjim-network.be</link>
	<description></description>
	<lastBuildDate>Mon, 08 Aug 2011 09:52:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>hide div while scrolling</title>
		<link>http://bigjim-network.be/2009/05/06/hide-div-while-scrolling/</link>
		<comments>http://bigjim-network.be/2009/05/06/hide-div-while-scrolling/#comments</comments>
		<pubDate>Wed, 06 May 2009 12:19:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[scrolling]]></category>

		<guid isPermaLink="false">http://bigjim-network.be/?p=41</guid>
		<description><![CDATA[Here is a trick that I&#8217;ve used in the intranet of my company that have an insane use of rdp protocol avor slow internet connections. The problem was that scrolling down in web pages containing some images was incredibly slow in firefox. That was due to the redraw of image while scrolling so I&#8217;ve decided [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a trick that I&#8217;ve used in the intranet of my company that have an insane use of rdp protocol avor slow internet connections.</p>
<p>The problem was that scrolling down in web pages containing some images was incredibly slow in firefox. That was due to the redraw of image while scrolling so I&#8217;ve decided to find a trick to hide some parts of the page during the time of scrolling.</p>
<p>After adding the javascript code to your page, just add the class &laquo;&nbsp;scrollhide&nbsp;&raquo; to objects that you want hide when scrolling.</p>
<p>exemple of use:</p>
<p>&lt;div class=&nbsp;&raquo;scrollhide&nbsp;&raquo;&gt;text to hide while scrolling&lt;/div&gt;</p>
<p>&lt;img src=&nbsp;&raquo;./img/imagetohide&nbsp;&raquo; class=&nbsp;&raquo;scrollhide&nbsp;&raquo;/&gt;</p>
<p>You could easily use it to what ever you want during the onscroll event.</p>
<p>!!! Tested with firefox 3 and IE 7 !!!</p>
<pre id="line15">var curdate = new Date()
var lastOnscroll = curdate.getTime();

function getElementsByClass(searchClass,node,tag) {
    var classElements = new Array();
    if ( node == null )
        node = document;
    if ( tag == null )
        tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
    for (i = 0, j = 0; i &lt; elsLen; i++) {
        if ( pattern.test(els[i].className) ) {
            classElements[j] = els[i];
            j++;
        }
    }
    return classElements;
}

function timeHideBanner() {

    var newcurdate = new Date()
    if ((newcurdate.getTime() - lastOnscroll) &gt; 200  ) {
        var myEls = getElementsByClass('scrollhide');
        for ( i=0;i&lt;myEls.length;i++ ) {
        // do stuff here with myEls[i]
            myEls[i].style.visibility = 'visible';
        }
        //document.getElementById('banner').style.visibility = 'visible';
    }
}

function hideBanner() {
    var newcurdate = new Date()
    lastOnscroll = newcurdate.getTime();

    var myEls = getElementsByClass('scrollhide');
    for ( i=0;i&lt;myEls.length;i++ ) {
    // do stuff here with myEls[i]
        myEls[i].style.visibility = 'hidden';
    }
    //document.getElementById('banner').style.visibility = 'hidden';
    var t=setTimeout("timeHideBanner()",300);
}

window.onscroll = function(){ hideBanner(); }

window.mouseup = function(){ document.getElementById('banner').style.visibility = 'visible'; }</pre>
]]></content:encoded>
			<wfw:commentRss>http://bigjim-network.be/2009/05/06/hide-div-while-scrolling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

