<?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>FlashBannerOnline &#187; MooTools</title>
	<atom:link href="http://blog.flashbanneronline.com/category/tutorials/javascript/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flashbanneronline.com</link>
	<description>Online Flash Banner Generator blog!</description>
	<lastBuildDate>Sun, 26 Jun 2011 11:38:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a Sliding Menu by MooTools Framework</title>
		<link>http://blog.flashbanneronline.com/2009/10/creating-a-sliding-menu-by-mootools-framework/</link>
		<comments>http://blog.flashbanneronline.com/2009/10/creating-a-sliding-menu-by-mootools-framework/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 14:03:34 +0000</pubDate>
		<dc:creator>Behrouz Pooladrag</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[content slide menu]]></category>
		<category><![CDATA[creating slider menu in html css]]></category>
		<category><![CDATA[css and javascript content slider framework]]></category>
		<category><![CDATA[css create box]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[how to create sliding menu codings]]></category>
		<category><![CDATA[javascript framework sliding box]]></category>
		<category><![CDATA[javascript slide effect tutorial]]></category>
		<category><![CDATA[Menu]]></category>
		<category><![CDATA[menu box sliding]]></category>
		<category><![CDATA[menu mootools]]></category>
		<category><![CDATA[mootools baner flash]]></category>
		<category><![CDATA[simple slide menu javascript]]></category>
		<category><![CDATA[slide menu in javascript]]></category>
		<category><![CDATA[Slideing]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.flashbanneronline.com/?p=109</guid>
		<description><![CDATA[MooTools is an object oriented framework created in JavaScript that could be used to create a rich interactive experience in HTML pages similar to that achieved in Flash but without actually using Flash, the benefit of using the MooTools over Flash is that your content will be easily accessible by search engines and it will [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mootools.net/">MooTools</a> is an object oriented framework created in JavaScript that could be used to create a rich interactive experience in HTML pages similar to that achieved in Flash but without actually using Flash, the benefit of using the MooTools over Flash is that your content will be easily accessible by search engines and it will not require the Flash player to be installed for it to run on any browser. Our tutorial here will show you how to create a sliding menu using the MooTools framework, you are required to have basic knowledge of HTML, you don&#8217;t need to know JavaScript to follow this tutorial, but JavaScript will help you understand what the code actually does.</p>
<p><img src="http://www.republicofcode.com/tutorials/webdevelopment/sliding_menu_mootools/sample.gif" alt="Sliding Menu - MooTools - Sample" width="320" height="71" /><br />
Click on the image above to see a sample of the sliding menu we&#8217;re going to create.</p>
<p>Our tutorial will be divided into three sections:</p>
<ol>
<li>Creating the HTML page containing our sliding menu.</li>
<li>Importing the MooTools JavaScript Framework.</li>
<li>Writing the JavaScript code required to create the sliding effect.</li>
</ol>
<h2><strong>Creating the HTML Page</strong></h2>
<p>Our HTML page will contain our actual content of the sliding menu. To create one open your your HTML editor and create a simple HTML page, the contents of the body should be as follows:</p>
<div>&lt;body&gt;<br />
&lt;div&gt;&amp;nbsp;&lt;/div&gt;<br />
&lt;div&gt;&amp;nbsp;&lt;/div&gt;<br />
&lt;/body&gt;</div>
<p>We will have to assign an <em>id</em> to each of our <em>div</em> tags, the first <em>div</em> should have have its <em>id</em> assigned as <em>menu_links</em>, and the second one as <em>menu</em>. You can now start putting your menu links in the first <em>div</em> as well.</p>
<div>&lt;div id=&#8221;menu_links&#8221;&gt;&lt;a href=&#8221;#&#8221;&gt;Oman3d&lt;/a&gt;|&lt;a href=&#8221;#&#8221;&gt;Tutorials&lt;/a&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;menu&#8221;&gt;Menu&lt;/div&gt;</div>
<p>This concludes the HTML part of our tutorial. We will now import the MooTools JavaScript Framework and then start creating the effect using JavaScript.</p>
<p>Save this page anywhere on your hard drive.</p>
<h2>Importing the MooTools JavaScript Framework</h2>
<p>Start off by downloading the MooTools framework JavaScipt file from its official website, save the script in a folder named <em>scripts</em> to be located in the same directory as your HTML file. Back to your HTML page, you have to import our MooTools JS Framework into our HTML page <em>header</em>. You are required to type the code shown below to be able to do this.</p>
<div>&lt;header&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;scripts/mootools-release-1.11.js&#8221;&gt;&lt;/script&gt;<br />
&lt;/header&gt;</div>
<p>Our preparations are all done now. We need to start scripting our sliding motion now.</p>
<h2>Creating the Sliding Effect</h2>
<p>The code for our sliding effect is pretty short. You can simply copy and paste this code to do the trick. We will explain in the following paragraphs how it works. Paste this code anywhere in the <em>body</em> of your HTML page.</p>
<div>var mySlide = new Fx.Slide(&#8216;menu_links&#8217;);<br />
$(&#8216;menu&#8217;).addEvent(&#8216;click&#8217;,function(o3dEvent){<br />
o3dEvent = new Event(o3dEvent);<br />
mySlide.toggle();<br />
o3dEvent.stop();<br />
})</div>
<p>We start off by creating a new instance of the <em>Fx.Slide()</em> class and assigned it to the variable called <em>mySlide</em>. As you can see, we passed the parameter <em>menu_links</em> to the <em>Fx.Slide()</em> object when we created it and that is the <em>id</em> or the <em>div</em> element we would like to slide.</p>
<div>var mySlide = new Fx.Slide(&#8216;menu_links&#8217;);</div>
<p>We then created a click event for our  <em>div</em> element that has the <em>id</em> <em>menu</em> so that when the user clicks on this <em>div</em> element a function attached to the click event is executed. It is necessary to pass the identifier of our event to this function.</p>
<div>$(‘menu’).addEvent(‘click’,function(o3dEvent))</div>
<p>Our function shall execute the o3dEvent  as follows. We will examine it in detail now.</p>
<div>function(o3dEvent){<br />
o3dEvent = new Event(o3dEvent);<br />
mySlide.toggle();<br />
o3dEvent.stop();<br />
})</div>
<p>We create a variable called <em>o3dEvent</em> and assigned it to an event handler, which is a method to manage events happening on stage.</p>
<div>o3dEvent = new Event(o3dEvent);</div>
<p>Our function will carry out this simply job using the  <em>toggle()</em> method which slides in and out the element with the <em>id</em> <em>menu_links</em> as we have previously defined in our code.</p>
<div>mySlide.toggle();</div>
<p>We finally have to stop the event when sliding is finished.</p>
<div>o3dEvent.stop();</div>
<p>Our actual code for creating the effect is done, but you might want to give it a proper graphical look by applying a style to it using CSS . This code is to be placed in the <em>header</em> of the HTML page.</p>
<div>&lt;style&gt;<br />
div#menu_links{height:20px; padding:5px 0; background-color:#333333; border:#CCCCCC solid 1px; text-align:center; color:#FFFFFF }<br />
div#link_contanier{ background-color:#CCCCCC;}<br />
div#menu{ background:#CCCCCC; font-size:12px; text-align:center; cursor:pointer}<br />
&lt;/style&gt;</div>
<p>That should do it, you can now test your HTML page to see your click-able menu that expands once clicked. You can download a working source file of this tutorial here. This concludes our tutorial, you can visit the official <a href="http://www.mootools.net/">MooTools</a> website to learn more about it</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashbanneronline.com/2009/10/creating-a-sliding-menu-by-mootools-framework/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/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 6/15 queries in 0.086 seconds using disk: basic
Object Caching 543/566 objects using disk: basic

Served from: blog.flashbanneronline.com @ 2012-02-11 13:55:06 -->
