<?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>dingobytes &#187; effect</title>
	<atom:link href="http://www.dingobytes.com/tag/effect/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dingobytes.com</link>
	<description>what your nephew can't make you</description>
	<lastBuildDate>Tue, 17 Jan 2012 22:24:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Lame Mouse Over Effect</title>
		<link>http://www.dingobytes.com/tutorial/lame-mouse-over-effect</link>
		<comments>http://www.dingobytes.com/tutorial/lame-mouse-over-effect#comments</comments>
		<pubDate>Thu, 03 Apr 2008 07:07:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[mouseover]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=8</guid>
		<description><![CDATA[So at work today, I wanted to see if I could create a lame mouse over effect to let feel like they were highlighting a listing. I wanted to pop out the moused over listing on the page by putting a thin border around the moused over div and then change the background. I was [...]]]></description>
			<content:encoded><![CDATA[<p>So at work today, I wanted to see if I could create a lame mouse over effect to let feel like they were highlighting a listing.  I wanted to pop out the moused over listing on the page by putting a thin border around the moused over div and then change the background. I was able to create the effect with javascript and coldfusion very easily. Because I don&#8217;t host this site on a coldfusion server, I will just show the javascript with some rendered HTML.</p>
<p>To save some time, I will explain the javascript and how to call it. You can grab the css from the example page.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
//&lt;![CDATA[
var listing = {
g:function(id) {
    return document.getElementById(id);
},
// function to change the background and border of listing on mouse over
highlight:function(id) {
    listing_el = listing.g(&quot;listing&quot; + id);
    if(id != 1) { //this is what to do for all divs other then first one
        id_above = id - 1;
        listing_above_el = listing.g(&quot;listing&quot; + id_above);
        //removes border on result above highlighted
        listing_above_el.style.border = &quot;#fff 2px solid&quot;;
        listing_el.style.backgroundColor = &quot;#fffae7&quot;;
        listing_el.style.border = &quot;#837b97&quot;;
    }
    else {
        listing_el.className = &quot;highlight_el&quot;;
        listing_el.style.backgroundColor = &quot;#fffae7&quot;;
        listing_el.style.border = &quot;#837b97&quot;;
    }
},
normal:function(id) {
    listing_el = listing.g(&quot;listing&quot; + id);
    if(id != 1) {
        id_above = id - 1;
        listing_above_el = listing.g(&quot;listing&quot; + id_above);
        //restores border to result above highlighted
        listing_above_el.style.borderBottom = &quot;#cccccc 2px dotted&quot;;
	listing_el.style.backgroundColor = &quot;#ffffff&quot;;
	listing_el.style.border = &quot;#ffffff 2px solid&quot;;
        listing_el.style.borderBottom = &quot;#cccccc 2px dotted&quot;;
    }
    else {
        listing_el.className = &quot;normal_el&quot;;
        listing_el.style.backgroundColor = &quot;#ffffff&quot;;
	listing_el.style.border = &quot;#ffffff 2px solid&quot;;
        listing_el.style.borderBottom = &quot;#cccccc 2px dotted&quot;;
    }
}
//]]&gt;
&lt;/script&gt;
</pre>
<p>The HTML can be spit through some query or loop and is straight forward.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;listing1&quot; class=&quot;listing&quot; onmouseover=&quot;listing.highlight('1');&quot; onmouseout=&quot;listing.normal('1');&quot;&gt;
&lt;div id=&quot;listing_top&quot;&gt;
&lt;span class=&quot;left&quot;&gt;
&lt;a href=&quot;javascript:void(0);&quot; title=&quot;121 Initech Rd&quot;&gt;121 Initech Rd&lt;/a&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id=&quot;listing_left&quot;&gt;
&lt;a href=&quot;javascript:void(0);&quot; title=&quot;121 Initech Rd&quot;&gt;&lt;img src=&quot;images/inventory/thumbs/0/0/0/000976.jpg&quot; alt=&quot;121 Initech Rd&quot; class=&quot;displayed&quot; width=&quot;151&quot; /&gt;&lt;/a&gt;
2.00 bed 3.00 bath 1296 sqft&lt;br /&gt;
Lake Home&lt;br /&gt;
Listing: 08-1979
&lt;/div&gt;
&lt;div id=&quot;listing_right&quot;&gt;&lt;span class=&quot;large_price&quot;&gt;$198699&lt;/span&gt; One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked. &quot;What's happened to me? &quot; he thought. It wasn't a dream.&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/code&gt;

&lt;code&gt;&lt;div id=&quot;listing2&quot; class=&quot;listing&quot; onmouseover=&quot;listing.highlight('2');&quot; onmouseout=&quot;listing.normal('2');&quot;&gt;
&lt;div id=&quot;listing_top&quot;&gt;
&lt;span class=&quot;left&quot;&gt;
&lt;a href=&quot;javascript:void(0);&quot; title=&quot;121 Initech Rd&quot;&gt;121 Initech Rd&lt;/a&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id=&quot;listing_left&quot;&gt;
&lt;a href=&quot;javascript:void(0);&quot; title=&quot;121 Initech Rd&quot;&gt;&lt;img src=&quot;images/inventory/thumbs/0/0/0/000976.jpg&quot; alt=&quot;121 Initech Rd&quot; class=&quot;displayed&quot; width=&quot;151&quot; /&gt;&lt;/a&gt;
2.00 bed 3.00 bath 1296 sqft&lt;br /&gt;
Lake Home&lt;br /&gt;
Listing: 08-1979
&lt;/div&gt;
&lt;div id=&quot;listing_right&quot;&gt;&lt;span class=&quot;large_price&quot;&gt;$198699&lt;/span&gt; His room, a proper human room although a little too small, lay peacefully between its four familiar walls. A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer.&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>This can be completed repeated and by dynamically changing the value <em>i</em> you can populate the results so that</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;listing&lt;em&gt;i&lt;/em&gt;&quot; class=&quot;listing&quot; onmouseover=&quot;listing.highlight('&lt;em&gt;i&lt;/em&gt;');&quot; onmouseout=&quot;listing.normal('&lt;em&gt;i&lt;/em&gt;');&quot;&gt;
</pre>
<p>You can see the <a title="finished product" href="http://www.dingobytes.com/example/results.html" target="_blank">finished product here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/tutorial/lame-mouse-over-effect/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.dingobytes.com @ 2012-02-05 21:40:03 -->
