<?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>Thijs Lensselink&#039;s Blog &#187; Mootools</title>
	<atom:link href="http://lenss.nl/tag/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://lenss.nl</link>
	<description>Webdevelopment and stuff...</description>
	<lastBuildDate>Thu, 26 Apr 2012 21:48:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Load MOOdalBoxes without clicking links</title>
		<link>http://lenss.nl/2008/10/load-moodalboxes-without-clicking-links/</link>
		<comments>http://lenss.nl/2008/10/load-moodalboxes-without-clicking-links/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 14:27:45 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[MOOdalBox]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://lenss.nl/?p=141</guid>
		<description><![CDATA[The MOOdalBox script is a great addition to the mootools library. The interface is pretty slick. And easy to style with just CSS. Răzvan Brateş did a great job here. And every now and then i have to implement one of those MOOdalBoxes in a web application. No problem here. Until today all MOOdalBoxes i [...]]]></description>
			<content:encoded><![CDATA[<p>The MOOdalBox script is a great addition to the <a href="http://mootools.net/" target="_blank">mootools</a> library. The interface is pretty slick. And easy to style with just CSS. <a href="http://www.e-magine.ro/" target="_blank">Răzvan Brateş</a> did a great job here. And every now and then i have to implement one of those MOOdalBoxes in a web application. No problem here.</p>
<p>Until today all MOOdalBoxes i used were triggered by simply clicking a link on a page. But today i needed to load a MOOdalBox window on page load. The screen represented some sort of QuickStart menu. Which can be disabled. I had no idea how to trigger the MOOdalBox from javascript. But once i read through the source. It became clear that it should be as easy as calling:</p>
<pre name="code" class="javascript">
MOOdalBox.open(url, title, sizes);
</pre>
<p>This kept giving me the following error:</p>
<p>this.overlay is undefined</p>
<p>Looking through the MOOdalBox source. I noticed the this.overlay property was set inside the init() method. So let&#8217;s try that before we call the open() method.</p>
<pre name="code" class="javascript">
MOOdalBox.init();
MOOdalBox.open(url, title, sizes);
</pre>
<p>This actually worked. I was pretty happy with the result. untill i opened IE 7 to test the same page. Nothing happened. No error&#8217;s and no MOOdalBox. Let&#8217;s try something else. Whenever i need to load something on page load in IE i use the window.onload method.</p>
<pre name="code" class="javascript">
window.onload = function()
    MOOdalBox.init();
    MOOdalBox.open(url, title, sizes);
}
</pre>
<p>Now the overlay was loaded. But still no MOOdalBox on top of it. I figured it had something to do with the DOM not being fully loaded. But i couldn&#8217;t really think of a solution. So of to Google. After a bit of browsing i found somebody with the same problem. And a <a href="http://forum.e-magine.ro/topic/please-help-with-ie" target="_blank">reply</a> from the original author of MOOdalBox. Add a domready event to make it work.</p>
<pre name="code" class="javascript">
window.addEvent('domready', loadMOOdal);
function loadMOOdal() {
    MOOdalBox.open('Quickstart/load', '', '700 500');
}
</pre>
<p>This did it. And my only goal was to make it function properly inside of IE 7. but this also fixes the same problem for IE 6. So a big thanks to Răzvan for creating MOOdalBox and for supplying the fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2008/10/load-moodalboxes-without-clicking-links/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mootools FX.Slide Flicker bug II</title>
		<link>http://lenss.nl/2008/06/mootools-fxslide-flicker-bug-ii/</link>
		<comments>http://lenss.nl/2008/06/mootools-fxslide-flicker-bug-ii/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 18:39:19 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://we.designandco.de/?p=13</guid>
		<description><![CDATA[Today i got a question from Richard. About the flicker bug and how to implement the fix. The problem that he had with Javascript throwing an illegal character error was because of copy pasting from this blog. I&#8217;m not sure why the single quotes get screwed up. But i will have a look at it. [...]]]></description>
			<content:encoded><![CDATA[<p>Today i got a question from <a href="http://www.usablenet.co.uk/" target="_blank">Richard</a>. About the flicker bug and how to implement the fix. The problem that he had with Javascript throwing an illegal character error was because of copy pasting from this blog. I&#8217;m not sure why the single quotes get screwed up. But i will have a look at it. I also didn&#8217;t state which version of <a href="http://mootools.net/" target="_blank">mootools</a> i was using. It was 1.1 at the time. And i was using the full uncompressed version.</p>
<p>But since then version 1.2 of <a href="http://mootools.net/" target="_blank">mootools</a> came out. And id didn&#8217;t really had time yet to look into it. But this version also has the same annoying bug. So i looked at the code. The <a href="http://docs.mootools.net/Plugins/Fx.Slide" target="_blank">FX.Slide</a> class changed a bit. And the core and  plugins are split up into separate files now. But the fix remains the same. And since i don&#8217;t really want to write a whole article about it right now. I decided to create two sets of archives. One with the fix for version 1.1 and one for version 1.2. The changes i made are explained in the previous article. But for 1.1 they are around line 4453 and 4458. For 1.2 if you only use the FX.Slide plugin it&#8217;s around line 17 and 29.</p>
<p>You can download the archives here:<br />
<a href="http://we.designandco.de/code/mootools.1.1.slide.flickerbug.tar.gz" target="_blank">version 1.1</a><br />
<a href="http://we.designandco.de/code/mootools.1.2.slide.flickerbug.tar.gz" target="_blank">version 1.2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2008/06/mootools-fxslide-flicker-bug-ii/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mootools FX.Slide Flicker bug</title>
		<link>http://lenss.nl/2008/06/mootools-fxslide-flicker-bug/</link>
		<comments>http://lenss.nl/2008/06/mootools-fxslide-flicker-bug/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 12:43:19 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://we.designandco.de/?p=5</guid>
		<description><![CDATA[When my coworker decided to use mootools for a project we are working on. I decided to give it a try also. I decided to use the FX.Slide effect on some tab based boxes. This was pretty straight forward. The mootools library is pretty easy in usage. And the documentation is darn good. Bellow i [...]]]></description>
			<content:encoded><![CDATA[<p>When my coworker decided to use <a href="http://mootools.net/" target="_blank">mootools</a> for a project we are working on. I decided to give it a try also.</p>
<p>I decided to use the <a href="http://docs.mootools.net/Plugins/Fx.Slide" target="_blank">FX.Slide</a> effect on some tab based boxes. This was pretty straight forward. The mootools library is pretty easy in usage. And the documentation is darn good. Bellow i will show how to add the most basic FX.Slide effect. This is directly copied from the mootools <a href="http://docs.mootools.net/" target="_blank">manual</a>.</p>
<p>To create the sliding effect all you need is the following lines of javascript.</p>
<pre class="javascript">window.addEvent('domready', function() {

    // create an instance of the FX.Slide object
    var mySlide = new Fx.Slide('test');

    // Attach the click event to the wrapper div
    $('toggle').addEvent('click', function(e) {
        e = new Event(e);
	mySlide.toggle();
	e.stop();
    });
});</pre>
<p>And of course some HTML to represent the sliding elements.</p>
<pre class="html">&lt;h3 class="section"&gt;Fx.Slide Vertical&lt;/h3&gt;

&lt;a id="toggle" href="#"&gt;toggle&lt;/a&gt;
&lt;div id="test"&gt;
foo
&lt;/div&gt;</pre>
<p>And some CSS to cover it all in a nice sauce.</p>
<pre class="css">#test {
    background: #222;
    color: #fff;
    padding: 10px;
    margin: 20px;
    border: 10px solid pink;
}</pre>
<p>So this looks great. It functions well. And the sliding is very smooth. There is one small problem though. When the wrapper contains an element with a style attribute overflow set to &#8220;auto&#8221;. The sliding will cause a flicker effect on the page. This is probably caused by rescaling the wrapper. Witch in it&#8217;s turn rescales the element with attribute overflow set to auto.</p>
<p>I didn&#8217;t really try to figure out why this happens. Maybe that&#8217;s a later project. But i did come up with a small fix. When a slide object is created. FX.Slide wraps a div around the container that will slide in and out. This wrapper has the attribute overflow set to hidden. I couldn&#8217;t figure out why overflow is set to hidden on this wrapper. So i added the ability to set it through the options object. When overflow is set to auto the flicker bug disappears. To add this feature we need to add some small changes to the FX.Slide class.</p>
<pre class="javascript">options: {
	mode: 'vertical'
},</pre>
<p>First we change the code above to reflect the code below:</p>
<pre class="javascript">options: {
	mode: 'vertical',
	overflow: 'hidden'
},</pre>
<p>Then on the third line of the initialize function we change:</p>
<pre class="javascript">this.wrapper = new Element('div', {'styles': $extend(this.element.getStyles('margin'), {'overflow': "hidden"})}).injectAfter(this.element).adopt(this.element);</pre>
<p>To:</p>
<pre class="javascript">this.wrapper = new Element('div', {'styles': $extend(this.element.getStyles('margin'), {'overflow': this.options.overflow})}).injectAfter(this.element).adopt(this.element);</pre>
<p>When all this is done and we want to create a FX.Slide object without the flicker bug. We add the options parameter. The constructor will make sure the right value is used.</p>
<pre class="javascript">var mySlide2 = new Fx.Slide('test', {overflow: 'auto'});

$('toggle').addEvent('click', function(e){
    e = new Event(e);
    mySlide2.toggle();
    e.stop();
});</pre>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2008/06/mootools-fxslide-flicker-bug/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
