<?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>Azure Web Design &#187; Javascript</title>
	<atom:link href="http://www.azurewebdesign.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.azurewebdesign.com</link>
	<description>We Know Web</description>
	<lastBuildDate>Thu, 15 Apr 2010 04:28:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Mootools 101: A Disappearing (Fading) Notification Message</title>
		<link>http://www.azurewebdesign.com/mootools-101-a-disappearing-fading-notification-message/</link>
		<comments>http://www.azurewebdesign.com/mootools-101-a-disappearing-fading-notification-message/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 05:00:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://www.azurewebdesign.com/blog/?p=54</guid>
		<description><![CDATA[What I wanted to achieve: I wanted a disappearing notification message that pops up and fades out when a button is pressed. What you need: Mootools Core How I did it: Read up on Apress Mootools Essentials for about an hour and experimented on it. 1. Include mootools  and the script in the head. &#60;script [...]]]></description>
			<content:encoded><![CDATA[<h2>What I wanted to achieve:</h2>
<p>I wanted a disappearing notification message that pops up and fades out when a button is pressed.</p>
<h2>What you need:</h2>
<p>Mootools Core</p>
<h2>How I did it:</h2>
<p>Read up on Apress Mootools Essentials for about an hour and experimented on it.</p>
<p>1. Include mootools  and the script in the head.</p>
<pre>&lt;script src="mootools-1.2.1-core.js"&gt;&lt;/script&gt;</pre>
<pre>&lt;script type="text/javascript"&gt;

    function blink() {
        $('blinker').set('opacity',1);
        $('blinker').fade('out');
    }

    window.addEvent('domready',function(){
        $('blinker').set('opacity',0);
    });

&lt;/script&gt;</pre>
<p>2. Type in the notification message and the button</p>
<pre>&lt;div&gt;
    &lt;p id="blinker"&gt;This is a disappearing notification message&lt;/p&gt;
&lt;/div&gt;

&lt;button onclick="blink()"&gt;Poink&lt;/button&gt;</pre>
<p>That&#8217;s it folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azurewebdesign.com/mootools-101-a-disappearing-fading-notification-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highlighting the Current Navigation Tab with Javascript and PHP</title>
		<link>http://www.azurewebdesign.com/highlighting-the-current-navigation-tab-with-javascript-and-php/</link>
		<comments>http://www.azurewebdesign.com/highlighting-the-current-navigation-tab-with-javascript-and-php/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 08:55:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XHTML/CSS]]></category>

		<guid isPermaLink="false">http://www.azurewebdesign.com/blog/?p=23</guid>
		<description><![CDATA[One of our projects required highlighting of the current navigation tab. So naturally, I googled and here&#8217;s what I found: http://www.alistapart.com/articles/keepingcurrent http://www.hicksdesign.co.uk/journal/highlighting-current-page-with-css http://www.websiteoptimization.com/speed/tweak/current/ However, none of them was the solution to what we exactly needed because of our file structure. We had a unique sidebar navigation include (nav.inc.php) for every subdirectory. The ALA solution was [...]]]></description>
			<content:encoded><![CDATA[<p>One of our projects required highlighting of the current navigation tab. So naturally, I googled and here&#8217;s what I found:</p>
<ul>
<li>http://www.alistapart.com/articles/keepingcurrent</li>
<li>http://www.hicksdesign.co.uk/journal/highlighting-current-page-with-css</li>
<li>http://www.websiteoptimization.com/speed/tweak/current/</li>
</ul>
<p>However, none of them was the solution to what we exactly needed because of our file structure. We had a unique sidebar navigation include (nav.inc.php) for every subdirectory.</p>
<p>The ALA solution was ugly, they inserted php snippets in every &lt;li&gt; entry. Hicksdesign&#8217;s solution was ok, but it required coding in a unique ID on every individual page, which was not a good idea for us.</p>
<p>So we came up with our own solution.</p>
<p>Here&#8217;s what we did:</p>
<ol>
<li>Get the Page&#8217;s name. In this case, our URL was structured in this way, http://website.com/category1/section1/page-name</li>
<li>Set IDs to each of the sidebar navigation links, to match the page names.</li>
<li>Invoke javascript to set class=&#8221;selected&#8221; to the navigation link where the current page is on.</li>
</ol>
<p>Here&#8217;s the Javascript code that was used:</p>
<pre>&lt;script language="javascript"&gt;
function set_current_nav()
{
	document.getElementById('&lt;?=$current_page?&gt;').setAttribute('class','selected');
}
set_current_nav();
&lt;/script&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.azurewebdesign.com/highlighting-the-current-navigation-tab-with-javascript-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
