<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_DHTML%2FAjax_Layer%2FDrag_Constrain</id>
		<title>JavaScript DHTML/Ajax Layer/Drag Constrain - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_DHTML%2FAjax_Layer%2FDrag_Constrain"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_DHTML/Ajax_Layer/Drag_Constrain&amp;action=history"/>
		<updated>2026-04-05T09:57:59Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_DHTML/Ajax_Layer/Drag_Constrain&amp;diff=4160&amp;oldid=prev</id>
		<title> в 09:58, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_DHTML/Ajax_Layer/Drag_Constrain&amp;diff=4160&amp;oldid=prev"/>
				<updated>2010-05-26T09:58:48Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 09:58, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_DHTML/Ajax_Layer/Drag_Constrain&amp;diff=4161&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_DHTML/Ajax_Layer/Drag_Constrain&amp;diff=4161&amp;oldid=prev"/>
				<updated>2010-05-26T07:49:04Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Drag and drop: constrain to parent element==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)&lt;br /&gt;
Permission is hereby granted, free of charge, to any person obtaining&lt;br /&gt;
a copy of this software and associated documentation files (the&lt;br /&gt;
&amp;quot;Software&amp;quot;), to deal in the Software without restriction, including&lt;br /&gt;
without limitation the rights to use, copy, modify, merge, publish,&lt;br /&gt;
distribute, sublicense, and/or sell copies of the Software, and to&lt;br /&gt;
permit persons to whom the Software is furnished to do so, subject to&lt;br /&gt;
the following conditions:&lt;br /&gt;
The above copyright notice and this permission notice shall be&lt;br /&gt;
included in all copies or substantial portions of the Software.&lt;br /&gt;
THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND,&lt;br /&gt;
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF&lt;br /&gt;
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND&lt;br /&gt;
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE&lt;br /&gt;
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION&lt;br /&gt;
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION&lt;br /&gt;
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;br /&gt;
        &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xml:lang=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;script.aculo.us Drag and drop functional test file&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;meta http-equiv=&amp;quot;content-type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/prototype.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/scriptaculous.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/unittest.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;style type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot;&amp;gt;&lt;br /&gt;
    div.box { background: green; width:100px; height:100px }&lt;br /&gt;
    div.box-container { background: yellow; width:200px; height:200px }&lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;script.aculo.us Drag and drop functional test file&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Draggables/Droppables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-normal&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  Normal box&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-numeric&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: 25&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-array&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: [5,25]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-procedural&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: procedural (e.g. constrain to box)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;box-container&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;box-grid-procedural-gets-draggable&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
    snap: procedural (e.g. constrain to parent element)&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;
  new Draggable(&amp;quot;box-normal&amp;quot;,{snap:false,revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-numeric&amp;quot;,{snap:25,revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-array&amp;quot;,{snap:[5,25],revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-procedural&amp;quot;,{&lt;br /&gt;
    snap: function(x,y) {&lt;br /&gt;
      return[&lt;br /&gt;
        x&amp;lt;100 ? (x &amp;gt; 0 ? x : 0 ) : 100,&lt;br /&gt;
        y&amp;lt;50 ? (y &amp;gt; 0 ? y : 0) : 50];&lt;br /&gt;
    },&lt;br /&gt;
    revert:true&lt;br /&gt;
  });&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-procedural-gets-draggable&amp;quot;,{&lt;br /&gt;
    snap: function(x,y,draggable) {&lt;br /&gt;
      function constrain(n, lower, upper) {&lt;br /&gt;
        if (n &amp;gt; upper) return upper;&lt;br /&gt;
        else if (n &amp;lt; lower) return lower;&lt;br /&gt;
        else return n;&lt;br /&gt;
      }&lt;br /&gt;
     &lt;br /&gt;
      element_dimensions = Element.getDimensions(draggable.element);&lt;br /&gt;
      parent_dimensions = Element.getDimensions(draggable.element.parentNode);&lt;br /&gt;
      return[&lt;br /&gt;
        constrain(x, 0, parent_dimensions.width - element_dimensions.width),&lt;br /&gt;
        constrain(y, 0, parent_dimensions.height - element_dimensions.height)];&lt;br /&gt;
    },&lt;br /&gt;
    revert:true&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&amp;lt;A href=&amp;quot;http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip&amp;quot;&amp;gt;scriptaculous-js-1.6.4.zip( 139 k)&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Drag and drop: snap 25==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)&lt;br /&gt;
Permission is hereby granted, free of charge, to any person obtaining&lt;br /&gt;
a copy of this software and associated documentation files (the&lt;br /&gt;
&amp;quot;Software&amp;quot;), to deal in the Software without restriction, including&lt;br /&gt;
without limitation the rights to use, copy, modify, merge, publish,&lt;br /&gt;
distribute, sublicense, and/or sell copies of the Software, and to&lt;br /&gt;
permit persons to whom the Software is furnished to do so, subject to&lt;br /&gt;
the following conditions:&lt;br /&gt;
The above copyright notice and this permission notice shall be&lt;br /&gt;
included in all copies or substantial portions of the Software.&lt;br /&gt;
THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND,&lt;br /&gt;
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF&lt;br /&gt;
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND&lt;br /&gt;
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE&lt;br /&gt;
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION&lt;br /&gt;
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION&lt;br /&gt;
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;br /&gt;
        &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xml:lang=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;script.aculo.us Drag and drop functional test file&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;meta http-equiv=&amp;quot;content-type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/prototype.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/scriptaculous.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/unittest.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;style type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot;&amp;gt;&lt;br /&gt;
    div.box { background: green; width:100px; height:100px }&lt;br /&gt;
    div.box-container { background: yellow; width:200px; height:200px }&lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;script.aculo.us Drag and drop functional test file&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Draggables/Droppables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-normal&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  Normal box&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-numeric&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: 25&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-array&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: [5,25]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-procedural&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: procedural (e.g. constrain to box)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;box-container&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;box-grid-procedural-gets-draggable&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
    snap: procedural (e.g. constrain to parent element)&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;
  new Draggable(&amp;quot;box-normal&amp;quot;,{snap:false,revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-numeric&amp;quot;,{snap:25,revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-array&amp;quot;,{snap:[5,25],revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-procedural&amp;quot;,{&lt;br /&gt;
    snap: function(x,y) {&lt;br /&gt;
      return[&lt;br /&gt;
        x&amp;lt;100 ? (x &amp;gt; 0 ? x : 0 ) : 100,&lt;br /&gt;
        y&amp;lt;50 ? (y &amp;gt; 0 ? y : 0) : 50];&lt;br /&gt;
    },&lt;br /&gt;
    revert:true&lt;br /&gt;
  });&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-procedural-gets-draggable&amp;quot;,{&lt;br /&gt;
    snap: function(x,y,draggable) {&lt;br /&gt;
      function constrain(n, lower, upper) {&lt;br /&gt;
        if (n &amp;gt; upper) return upper;&lt;br /&gt;
        else if (n &amp;lt; lower) return lower;&lt;br /&gt;
        else return n;&lt;br /&gt;
      }&lt;br /&gt;
     &lt;br /&gt;
      element_dimensions = Element.getDimensions(draggable.element);&lt;br /&gt;
      parent_dimensions = Element.getDimensions(draggable.element.parentNode);&lt;br /&gt;
      return[&lt;br /&gt;
        constrain(x, 0, parent_dimensions.width - element_dimensions.width),&lt;br /&gt;
        constrain(y, 0, parent_dimensions.height - element_dimensions.height)];&lt;br /&gt;
    },&lt;br /&gt;
    revert:true&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&amp;lt;A href=&amp;quot;http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip&amp;quot;&amp;gt;scriptaculous-js-1.6.4.zip( 139 k)&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Drag and drop: snap to a box==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)&lt;br /&gt;
Permission is hereby granted, free of charge, to any person obtaining&lt;br /&gt;
a copy of this software and associated documentation files (the&lt;br /&gt;
&amp;quot;Software&amp;quot;), to deal in the Software without restriction, including&lt;br /&gt;
without limitation the rights to use, copy, modify, merge, publish,&lt;br /&gt;
distribute, sublicense, and/or sell copies of the Software, and to&lt;br /&gt;
permit persons to whom the Software is furnished to do so, subject to&lt;br /&gt;
the following conditions:&lt;br /&gt;
The above copyright notice and this permission notice shall be&lt;br /&gt;
included in all copies or substantial portions of the Software.&lt;br /&gt;
THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND,&lt;br /&gt;
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF&lt;br /&gt;
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND&lt;br /&gt;
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE&lt;br /&gt;
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION&lt;br /&gt;
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION&lt;br /&gt;
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;br /&gt;
        &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xml:lang=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;script.aculo.us Drag and drop functional test file&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;meta http-equiv=&amp;quot;content-type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/prototype.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/scriptaculous.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;script src=&amp;quot;./scriptaculous-js-1.6.4src/unittest.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;style type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot;&amp;gt;&lt;br /&gt;
    div.box { background: green; width:100px; height:100px }&lt;br /&gt;
    div.box-container { background: yellow; width:200px; height:200px }&lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;script.aculo.us Drag and drop functional test file&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Draggables/Droppables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-normal&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  Normal box&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-numeric&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: 25&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-array&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: [5,25]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box-grid-procedural&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
  snap: procedural (e.g. constrain to box)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;box-container&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;box-grid-procedural-gets-draggable&amp;quot; class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
    snap: procedural (e.g. constrain to parent element)&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;
  new Draggable(&amp;quot;box-normal&amp;quot;,{snap:false,revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-numeric&amp;quot;,{snap:25,revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-array&amp;quot;,{snap:[5,25],revert:true});&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-procedural&amp;quot;,{&lt;br /&gt;
    snap: function(x,y) {&lt;br /&gt;
      return[&lt;br /&gt;
        x&amp;lt;100 ? (x &amp;gt; 0 ? x : 0 ) : 100,&lt;br /&gt;
        y&amp;lt;50 ? (y &amp;gt; 0 ? y : 0) : 50];&lt;br /&gt;
    },&lt;br /&gt;
    revert:true&lt;br /&gt;
  });&lt;br /&gt;
  new Draggable(&amp;quot;box-grid-procedural-gets-draggable&amp;quot;,{&lt;br /&gt;
    snap: function(x,y,draggable) {&lt;br /&gt;
      function constrain(n, lower, upper) {&lt;br /&gt;
        if (n &amp;gt; upper) return upper;&lt;br /&gt;
        else if (n &amp;lt; lower) return lower;&lt;br /&gt;
        else return n;&lt;br /&gt;
      }&lt;br /&gt;
     &lt;br /&gt;
      element_dimensions = Element.getDimensions(draggable.element);&lt;br /&gt;
      parent_dimensions = Element.getDimensions(draggable.element.parentNode);&lt;br /&gt;
      return[&lt;br /&gt;
        constrain(x, 0, parent_dimensions.width - element_dimensions.width),&lt;br /&gt;
        constrain(y, 0, parent_dimensions.height - element_dimensions.height)];&lt;br /&gt;
    },&lt;br /&gt;
    revert:true&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&amp;lt;A href=&amp;quot;http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip&amp;quot;&amp;gt;scriptaculous-js-1.6.4.zip( 139 k)&amp;lt;/a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>