PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/1.2/docs/html/demo/component/dd/demo1.html

https://github.com/yiminghe/kissyteam.github.com
HTML | 286 lines | 227 code | 28 blank | 31 comment | 0 complexity | eb062748fa39a29251628e7cdf8d964a MD5 | raw file
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>Draggable &amp; Proxy 使用示例 &mdash; KISSY v1.2 Documentation</title>
  6. <link rel="stylesheet" href="http://a.tbcdn.cn/s/kissy/1.2.0/css/reset.css"/>
  7. <link rel="stylesheet" href="../../../_static/kissy.css"/>
  8. <link rel="stylesheet" href="../../../_static/pygments.css"/>
  9. <link rel="shortcut icon" href="http://a.tbcdn.cn/s/kissy/favicon.ico" type="image/x-icon" />
  10. <link href='http://fonts.googleapis.com/css?family=Philosopher' rel='stylesheet' type='text/css'>
  11. <script>
  12. var DOCUMENTATION_OPTIONS = {
  13. URL_ROOT: '../../../',
  14. VERSION: '',
  15. COLLAPSE_INDEX: false,
  16. FILE_SUFFIX: '.html',
  17. HAS_SOURCE: true
  18. };
  19. (function(){
  20. var js=[],h=window.location.href,d=document;
  21. js.push("../../../_static/jquery.js");
  22. js.push("../../../_static/underscore.js");
  23. js.push("../../../_static/doctools.js");
  24. for(var i=0;i<js.length;i++){
  25. var j=js[i];
  26. if(h.indexOf("localhost/kissy_git/")==-1&&j.indexOf("jquery.js")!=-1){
  27. d.write('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"><\/script>');
  28. }else{
  29. d.write('<script type="text/javascript" src="'+ j +'"><\/script>');
  30. }
  31. }
  32. })();
  33. </script>
  34. <script>
  35. var _gaq = _gaq || [];
  36. _gaq.push(['_setAccount', 'UA-31470541-1']);
  37. _gaq.push(['_trackPageview']);
  38. (function() {
  39. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  40. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  41. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  42. })();
  43. </script>
  44. </head>
  45. <body><div id="header">
  46. <h1 class="logo"><a alt="KISSY" href="http://docs.kissyui.com">
  47. <img src="http://a.tbcdn.cn/s/kissy/logo.png" />
  48. </a></h1>
  49. <ul class="navigation">
  50. <li><a href="http://docs.kissyui.com">首页</a></li>
  51. <li><a href="../../../../html/tutorials/index.html" >Tutorials</a></li>
  52. <li><a href="../../../../html/api/index.html" >API</a></li>
  53. <li><a href="../../../../html/demo/index.html" >DEMO</a></li>
  54. <li><a href="https://groups.google.com/group/kissy-ui" >Google Group</a></li>
  55. <li><a href="http://www.github.com/kissyteam" >Source Code</a></li>
  56. <li><a href="http://docs.kissyui.com/kissy/docs/" >English API Docs</a></li>
  57. </ul>
  58. <div id="searchbox" style="display: none" class="searchbox">
  59. <form class="search" action="../../../search.html" method="get">
  60. <input type="text" name="q" size="28" class="ipt"/>
  61. <input type="submit" value="Go" class="btn"/>
  62. <input type="hidden" name="check_keywords" value="yes" />
  63. <input type="hidden" name="area" value="default" />
  64. </form>
  65. </div>
  66. <script type="text/javascript">$('#searchbox').show(0);</script>
  67. </div>
  68. <div id="content">
  69. <div class="layout grid-s6m0">
  70. <div class="col-main">
  71. <div class="main-wrap">
  72. <div class='related'>
  73. <h3>Navigation</h3>
  74. <ul>
  75. <li class="right" style="margin-right: 10px">
  76. <a href="../../../genindex.html" title="General Index"
  77. accesskey="I">index</a></li>
  78. <li class="right" >
  79. <a href="../../../py-modindex.html" title="Python Module Index"
  80. >modules</a> | </li>
  81. <li class="right" >
  82. <a href="demo2.html" title="Droppable 基本使用"
  83. accesskey="N">next</a> | </li>
  84. <li class="right" >
  85. <a href="index.html" title="DD 使用示例"
  86. accesskey="P">previous</a> | </li>
  87. <li><a href="../../../index.html">KISSY v1.2 Documentation</a> &#187; </li>
  88. <li><a href="../../index.html" >Demos</a> &#187; </li>
  89. <li><a href="../index.html" >Component</a> &#187; </li>
  90. <li><a href="index.html" accesskey="U">DD 使用示例</a> &#187; </li>
  91. </ul>
  92. </div>
  93. <div class="section" id="draggable-proxy">
  94. <h1>Draggable &amp; Proxy 使用示例<a class="headerlink" href="#draggable-proxy" title="Permalink to this headline"></a></h1>
  95. <div class="section" id="class">
  96. <h2>Class<a class="headerlink" href="#class" title="Permalink to this headline"></a></h2>
  97. <blockquote>
  98. <div><ul class="simple">
  99. <li><a class="reference internal" href="../../../api/component/dd/draggable.html#dd.Draggable" title="dd.Draggable"><tt class="xref py py-class docutils literal"><span class="pre">Draggable</span></tt></a></li>
  100. </ul>
  101. </div></blockquote>
  102. </div>
  103. <div class="section" id="id1">
  104. <h2>Draggable &amp; Proxy 使用示例<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
  105. <blockquote>
  106. <div><iframe width="100%" height="200" class="iframe-demo" src="../../../_static/demo/dd/demo1.html"></iframe><p><strong>引入 kissy.js</strong></p>
  107. <div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;script </span><span class="na">src=</span><span class="s">&#39;http://a.tbcdn.cn/s/kissy/1.2.0/kissy-min.js&#39;</span><span class="nt">&gt;&lt;/script&gt;</span>
  108. </pre></div>
  109. </div>
  110. <p><strong>组织HTML</strong></p>
  111. <div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;box&quot;</span> <span class="na">id=</span><span class="s">&quot;test-drag&quot;</span><span class="nt">&gt;</span>
  112. <span class="nt">&lt;s</span> <span class="na">class=</span><span class="s">&quot;box-tp&quot;</span><span class="nt">&gt;&lt;b&gt;&lt;/b&gt;&lt;/s&gt;</span>
  113. <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;box-hd&quot;</span><span class="nt">&gt;</span>
  114. <span class="nt">&lt;h3&gt;</span>Drag Me<span class="nt">&lt;/h3&gt;</span>
  115. <span class="nt">&lt;/div&gt;</span>
  116. <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;box-bd&quot;</span><span class="nt">&gt;</span>
  117. 鼠标拖动
  118. <span class="nt">&lt;/div&gt;</span>
  119. <span class="nt">&lt;s</span> <span class="na">class=</span><span class="s">&quot;box-bt&quot;</span><span class="nt">&gt;&lt;b&gt;&lt;/b&gt;&lt;/s&gt;</span>
  120. <span class="nt">&lt;/div&gt;</span>
  121. </pre></div>
  122. </div>
  123. <p><strong>设置代理节点样式</strong></p>
  124. <div class="highlight-css"><div class="highlight"><pre><span class="nc">.ks-dd-proxy</span> <span class="p">{</span>
  125. <span class="k">opacity</span><span class="o">:</span><span class="m">0</span><span class="o">.</span><span class="m">6</span><span class="p">;</span>
  126. <span class="o">*</span><span class="n">filter</span><span class="o">:</span><span class="n">alpha</span><span class="p">(</span><span class="k">opacity</span><span class="o">=</span><span class="m">60</span><span class="p">);</span>
  127. <span class="p">}</span>
  128. </pre></div>
  129. </div>
  130. <p><strong>初始化 draggable 对象</strong></p>
  131. <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">KISSY</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="s2">&quot;dd&quot;</span><span class="p">,</span><span class="kd">function</span><span class="p">(</span><span class="nx">S</span><span class="p">,</span><span class="nx">DD</span><span class="p">){</span>
  132. <span class="kd">var</span> <span class="nx">drag</span><span class="o">=</span><span class="k">new</span> <span class="nx">DD</span><span class="p">.</span><span class="nx">Draggable</span><span class="p">({</span>
  133. <span class="nx">node</span><span class="o">:</span><span class="s1">&#39;#test-drag&#39;</span><span class="p">,</span>
  134. <span class="nx">cursor</span><span class="o">:</span><span class="s1">&#39;move&#39;</span><span class="p">,</span>
  135. <span class="nx">move</span><span class="o">:</span><span class="kc">true</span>
  136. <span class="p">});</span>
  137. <span class="p">});</span>
  138. </pre></div>
  139. </div>
  140. <p><strong>初始化 proxy 对象</strong></p>
  141. <div class="highlight-javascript"><div class="highlight"><pre><span class="k">new</span> <span class="nx">Proxy</span><span class="p">().</span><span class="nx">attach</span><span class="p">(</span><span class="nx">drag</span><span class="p">);</span>
  142. </pre></div>
  143. </div>
  144. </div></blockquote>
  145. </div>
  146. </div>
  147. <div class='related'>
  148. <h3>Navigation</h3>
  149. <ul>
  150. <li class="right" style="margin-right: 10px">
  151. <a href="../../../genindex.html" title="General Index"
  152. accesskey="I">index</a></li>
  153. <li class="right" >
  154. <a href="../../../py-modindex.html" title="Python Module Index"
  155. >modules</a> | </li>
  156. <li class="right" >
  157. <a href="demo2.html" title="Droppable 基本使用"
  158. accesskey="N">next</a> | </li>
  159. <li class="right" >
  160. <a href="index.html" title="DD 使用示例"
  161. accesskey="P">previous</a> | </li>
  162. <li><a href="../../../index.html">KISSY v1.2 Documentation</a> &#187; </li>
  163. <li><a href="../../index.html" >Demos</a> &#187; </li>
  164. <li><a href="../index.html" >Component</a> &#187; </li>
  165. <li><a href="index.html" accesskey="U">DD 使用示例</a> &#187; </li>
  166. </ul>
  167. </div>
  168. <div id="disqus_thread"></div>
  169. <script>
  170. if((window.location.hostname.indexOf("kissyui.com")!=-1 )&& window.localStorage.getItem("kissy-commment")!="0"){
  171. /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
  172. var disqus_shortname = 'kissy-docs'; // required: replace example with your forum shortname
  173. // The following are highly recommended additional parameters. Remove the slashes in front to use.
  174. //var disqus_identifier = '/anim';
  175. //var disqus_url = window.location;
  176. /* * * DON'T EDIT BELOW THIS LINE * * */
  177. (function() {
  178. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  179. dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
  180. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  181. })();
  182. }
  183. </script>
  184. <!--<div id="google-search-box">
  185. <div id="cse" style="width: 100%;">Loading</div>
  186. <script>
  187. if(window.location.hostname.indexOf("kissyui.com")!=-1){
  188. document.write('<script src="http://www.google.com/jsapi" type="text/javascript"><'+'/script>');
  189. }
  190. </script>
  191. <script>
  192. if(window.location.hostname.indexOf("kissyui.com")!=-1){
  193. google.load('search', '1', {language : 'zh-CN', style : google.loader.themes.MINIMALIST});
  194. google.setOnLoadCallback(function() {
  195. var customSearchControl = new google.search.CustomSearchControl('012347804910294994683:n4uzb24gqdm');
  196. customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
  197. customSearchControl.draw('cse');
  198. }, true);
  199. }
  200. </script>
  201. </div>-->
  202. </div>
  203. </div>
  204. <div class="col-sub"><ul class="s-box demo-toctree">
  205. <h2 class="s-box-hd">Seed</h2>
  206. <ul class="s-box-bd">
  207. <li><a href="../../seed/loader/index.html">loader</a></li>
  208. <li><a href="../../seed/lang/index.html">lang</a></li>
  209. <!--<li><a href="../../seed/kissy/index.html">kissy</a></li>
  210. <li><a href="../../seed/web/index.html">web</a></li>-->
  211. </ul>
  212. </ul>
  213. <ul class="s-box core-toctree">
  214. <h2 class="s-box-hd">Core</h2>
  215. <ul class="s-box-bd">
  216. <!--<li><a href="../../core/ua/index.html">ua</a></li>
  217. <li><a href="../../core/dom/index.html">DOM</a></li>
  218. <li><a href="../../core/event/index.html">event</a></li>
  219. <li><a href="../../core/node/index.html">node</a></li>
  220. <li><a href="../../core/json/index.html">json</a></li>
  221. <li><a href="../../core/ajax/index.html">ajax</a></li>
  222. <li><a href="../../core/cookie/index.html">cookie</a></li>
  223. <li><a href="../../core/base/index.html">base</a></li>-->
  224. <li><a href="../../core/anim/index.html">anim</a></li>
  225. </ul>
  226. </ul>
  227. <ul class="s-box component-toctree">
  228. <h2 class="s-box-hd">Component</h2>
  229. <ul class="s-box-bd">
  230. <li><a href="../mvc/index.html">mvc</a></li>
  231. <!--<li><a href="https://github.com/jquery/sizzle/wiki/Sizzle-Home">sizzle</a></li>
  232. <li><a href="../template/index.html">template</a></li>-->
  233. <li><a href="../datalazyload/index.html">datalazyload</a></li>
  234. <!--<li><a href="../flash/index.html">flash</a></li>-->
  235. <li><a href="index.html">dd</a></li>
  236. <li><a href="../resizable/index.html">resizable</a></li>
  237. <li><a href="../switchable/index.html">switchable</a></li>
  238. <li><a href="../suggest/index.html">suggest</a></li>
  239. <li><a href="../calendar/index.html">calendar</a></li>
  240. <li><a href="../imagezoom/index.html">imagezoom</a></li>
  241. <li><a href="../overlay/index.html">overlay</a></li>
  242. <li><a href="../button/index.html">button</a></li>
  243. <li><a href="../menu/index.html">menu</a></li>
  244. <li><a href="../menubutton/index.html">menubutton</a></li>
  245. <li><a href="../tree/index.html">tree</a></li>
  246. <li><a href="../waterfall/index.html">waterfall</a></li>
  247. <li><a href="http://docs.kissyui.com/kissy/src/validation/demo/" target="_blank">validation</a></li>
  248. <li><a href="../editor/index.html">editor</a></li>
  249. </ul>
  250. </ul>
  251. </div>
  252. </div>
  253. </div>
  254. <div id="footer">
  255. &copy; Copyright 2010~2012, KISSY Team. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>
  256. </div>
  257. </body>
  258. </html>