<?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>Marilyn Burgess &#187; mooTools</title>
	<atom:link href="http://marilynburgess.com/tag/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://marilynburgess.com</link>
	<description></description>
	<lastBuildDate>Mon, 29 Aug 2011 16:33:14 +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>Put a handle on mooTools Drag.Move</title>
		<link>http://marilynburgess.com/2010/01/put-a-handle-on-mootools-drag-move/</link>
		<comments>http://marilynburgess.com/2010/01/put-a-handle-on-mootools-drag-move/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 17:54:45 +0000</pubDate>
		<dc:creator>marilyn</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Drag.Move]]></category>
		<category><![CDATA[Handle]]></category>
		<category><![CDATA[mooTools]]></category>
		<category><![CDATA[not clickable inputs]]></category>

		<guid isPermaLink="false">http://blog.listcentral.me/?p=543</guid>
		<description><![CDATA[In the next version of List Central the little popup form that enables the user to edit list items will be dragable so that the list maker can move it to where ever they would prefer to have it. It is a great little feature that really adds to the usability of List Central. When [...]]]></description>
			<content:encoded><![CDATA[<p>In the next version of List Central the little popup form that enables the user to edit list items will be dragable so that the list maker can move it to where ever they would prefer to have it. It is a great little feature that really adds to the usability of List Central.</p>
<p>When I was implementing the dragable popup form feature I was pleased at how easy it was to use <a href="http://mootools.net/docs/more/Drag/Drag.Move">mooTool&#8217;s Drag.Move</a>. My little form was easily moved to anywhere in the browser window, just as I intended. A problem arose when I tried to <em>use</em> the form inside the dragable element. The input elements of the form were not clickable, I could not get them to have focus, as if they were behind an invisible layer, which is actually what was going on. The form elements inside the dragable div they sitting in were not clickable, because they were dragable! Ack!</p>
<p>Happily I was able to find a solution for my problem: the dragable element required a <em>handle</em>.</p>
<p><a href="http://marilynburgess.com/images/2010/01/edit.gif"><img class="alignnone size-medium wp-image-544" title="edit" src="http://marilynburgess.com/images/2010/01/edit-300x157.gif" alt="" width="300" height="157" /></a></p>
<p>The above image shows the Drag.Move handle in the upper right corner of the edit list item form div. You cannot move that dragable element unless you grab it by the handle, the move icon. Using a handle frees up the rest of the element for other clickable elements, like a form.</p>
<p>The JavaScript for including a handle in your Drag.Move element is as follows:</p>
<pre class="brush: javascript">
new Drag.Move(&#039;dragableDivID&#039;, {handle: &#039;dragHandleID&#039;});
</pre>
<p>and the HTML, with some CSS:</p>
<pre class="brush: html">
&lt;style&gt;
.dragHandle{
    background:transparent url(/images/move.png) no-repeat scroll 0 0;
    cursor:move;
    float:right;
    height:30px;
    margin:15px 15px 0 0;
    width:30px;
}
&lt;/style&gt;
&lt;div class=&#039;dragableBox&#039; id=&#039;dragableDivID&#039;&gt;
     &lt;div class=&#039;dragHandle&#039; id=&#039;dragHandleID&#039;&gt;&lt;/div&gt;
     &lt;div class=&#039;dragableInner&#039;&gt; The content goes here&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>In looking for this solution I found this great tutorial series by <a href="http://www.consideropen.com/">Consider:open</a> called <a href="http://www.consideropen.com/blog/tag/30-days-of-mootools/"><strong>30 Days of mooTools</strong></a>.  The entire series is very well done. Web developers at any level are likely to learn something new about mooTools there. Check out thethe <a href="http://www.consideropen.com/blog/2008/08/30-days-of-mootools-12-tutorials-day-12-drag-and-drop-using-dragmove/">tutorial on Drag.Move</a> from the series that helped me out.</p>
<h3  class="related_post_title">You might also like...</h3><ul class="related_post"><li><a href="http://marilynburgess.com/2010/01/maintaining-dynamic-height-on-a-fx-slide-element-with-mootools/" title="Maintaining Dynamic Height on a Fx.Slide element with Mootools">Maintaining Dynamic Height on a Fx.Slide element with Mootools</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://marilynburgess.com/2010/01/put-a-handle-on-mootools-drag-move/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Maintaining Dynamic Height on a Fx.Slide element with Mootools</title>
		<link>http://marilynburgess.com/2010/01/maintaining-dynamic-height-on-a-fx-slide-element-with-mootools/</link>
		<comments>http://marilynburgess.com/2010/01/maintaining-dynamic-height-on-a-fx-slide-element-with-mootools/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 03:04:35 +0000</pubDate>
		<dc:creator>marilyn</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[dynamic height]]></category>
		<category><![CDATA[Fx.Slide]]></category>
		<category><![CDATA[mooTools]]></category>

		<guid isPermaLink="false">http://blog.listcentral.me/?p=475</guid>
		<description><![CDATA[List Central uses mooTools for it&#8217;s JavaScript framework. I love it! It makes developing in JavaScript a pleasure, with increased reliability, and nifty eye candy to play with. I recently started using FX.Slide in the next iteration of the List Central interface. It lets the user open and close &#8220;sliders&#8221; (div&#8217;s with content in them) [...]]]></description>
			<content:encoded><![CDATA[<p>List Central uses <a href="http://mootools.net/">mooTools</a> for it&#8217;s JavaScript framework. I love it! It makes developing in JavaScript a pleasure, with increased reliability, and nifty eye candy to play with.  </p>
<p>I recently started using FX.Slide in the next iteration of the List Central interface. It lets the user open and close &#8220;sliders&#8221; (div&#8217;s with content in them) as they want them. Check out the < a href="http://demos.mootools.net/Fx.Slide">mooTools demo to see FX.Slide in action</a>.</p>
<p>I had one little problem with Fx.Slide though. The problem was that I wanted to be able to dynamically add content to an Fx.Slide, changing the height of the slider div after it has been opened. To my dismay, the implementation of Fx.Slide set the height of the div to specific numbers in pixel to achieve the vertical slider effect. This means that any content I added to the bottom of the div after it was opened would not be shown. In order for the height of the slider div to remain dynamic, I needed the height to be set to &#8220;auto&#8221;, not a specific number.</p>
<p>I had to figure out a way to maintain the the div&#8217;s ability to change in height while still using FX.Slide. I did some fiddling in mooTools source to try to achieve the effect I desired. I changed where FX.Slide set the height of the div to &#8220;auto&#8221;.  After trying it out, I was astonished that it worked! I had moved on to some other development when I realized that my change to the mooTools source brock the fluid motion of my slider. It now opened all choppy and jumpy. It was no longer pleasing to the eye. I had to put the source back the way I found it. I may have learned some about the inner workings of mooTools though the process, but really, messing with the framework&#8217;s source is a path to trouble. </p>
<p>As with many problems, this one&#8217;s solution didn&#8217;t come to me until I put the problem away for a while, and worked on other things. The solution then came to me, and like many other solutions, it seemed so simple, once I knew it.</p>
<p>The trick to maintain dynamic height on a Fx.Slide is to add an onComplete function on to the slider that sets the height of the slider to &#8220;auto&#8221; if the slider is open, like this:</p>
<pre class="brush: javascript">

var formSlide = new Fx.Slide(&#039;FormSlider&#039;, {
        onComplete: function(){
            if(this.wrapper.getStyle(&#039;height&#039;) != &quot;0px&quot;){
                // Check if the slider is open
                this.wrapper.setStyle(&#039;height&#039;, &#039;auto&#039;);
            }
        }
    }).hide();
</pre>
<p>That&#8217;s it! It works like a charm now, just as I want it to. So much trouble, for such a simple solution!</p>
<p>I expect that this solution would work the same on the width for horizontal FX.Slide&#8217;s, though I haven&#8217;t tested it. </p>
<h3  class="related_post_title">You might also like...</h3><ul class="related_post"><li><a href="http://marilynburgess.com/2010/01/put-a-handle-on-mootools-drag-move/" title="Put a handle on mooTools Drag.Move">Put a handle on mooTools Drag.Move</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://marilynburgess.com/2010/01/maintaining-dynamic-height-on-a-fx-slide-element-with-mootools/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

