UNPKG

@egjs/rotate

Version:

Tiny custom rotate event binder

671 lines (270 loc) 11.7 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Namespace: rotate | egjs::rotate - API</title> <meta name="description" content="Tiny custom rotate event binder" /> <meta property="og:title" content=""/> <meta property="og:type" content="website"/> <meta property="og:image" content=""/> <meta property="og:url" content=""/> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <script src="scripts/jquery.min.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link rel="canonical" href="http://naver.github.io/egjs-rotate/release/latest/doc/"/> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css"> <link type="text/css" rel="stylesheet" href="styles/jaguar.css"> <script> var config = {"monospaceLinks":true,"cleverLinks":true,"default":{"outputSourceFiles":true},"applicationName":"eg.Rotate","disqus":"egjs","googleAnalytics":"UA-70842526-22","openGraph":{"title":"","type":"website","image":"","site_name":"","url":""},"meta":{"title":"egjs::rotate - API","description":"Tiny custom rotate event binder","keyword":""},"linenums":true,"link":{"canonical":"http://naver.github.io/egjs-rotate/release/latest/doc/"}}; </script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', config.googleAnalytics]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body> <div id="wrap" class="clearfix"> <div class="navigation"> <h3 class="applicationName"> <a href="//naver.github.io/egjs/"><img style="width:40px; height:20px;" src="img/type_white.svg"/></a> <!-- Homepage link (prefer link.home than applicationName) --> <a href="//naver.github.io/egjs-rotate/">Rotate</a> </h3> <div class="search"> <input id="search" type="text" class="form-control input-sm" placeholder="Search Documentations"> </div> <ul class="list"> <li class="item"> <span class="title"> <a href="index.html">README</a> </span> </li> <!-- Non Grouping Version --> <li class="item" data-name="eg.rotate"> <span class="title"> <a href="eg.rotate.html">eg.rotate</a> <span class="static">static</span> </span> <ul class="members itemMembers expends"> <span class="subtitle">Members</span> <li data-name="eg.rotate.VERSION"><a href="eg.rotate.html#.VERSION">VERSION</a></li> </ul> <ul class="typedefs itemMembers expends"> </ul> <ul class="methods itemMembers expends"> <span class="subtitle">Methods</span> <li data-name="eg.rotate.isVertical"><a href="eg.rotate.html#.isVertical">isVertical</a></li> <li data-name="eg.rotate.off"><a href="eg.rotate.html#.off">off</a></li> <li data-name="eg.rotate.on"><a href="eg.rotate.html#.on">on</a></li> </ul> <ul class="events itemMembers expends"> </ul> </li> </ul> </div> <div class="main"> <h1 class="page-title" data-filename="eg.rotate.html">Namespace: rotate</h1> <section> <header> <h2> <span>eg.rotate</span> </h2> <button id="toggle"> English </button> </header> <article> <div class="container-overview"> <div class="description"><p>Tiny custom rotate event binder.</p> <blockquote> <p><strong>NOTE:</strong></p> <ul> <li>It works for mobile environment only.</li> <li>For non-mobile environment, every methods will return 'false'.</li> </ul> <p><strong>참고:</strong></p> <ul> <li>모바일 환경에서만 동작 합니다.</li> <li>비모바일 환경에서는 모든 메서드들은 'false'를 반환합니다.</li> </ul> </blockquote></div> <dl class="details"> <!-- if data.codepen --> </dl> <h3>Example</h3> <pre class="prettyprint"><code><p>var handler = function(e, info){<br> info.isVertical;<br>}<br>// bind<br>eg.rotate.on(handler);</p> <p>// unbind<br>eg.rotate.off(handler);</p> <p>// unbind all event attached (call without listener param)<br>eg.rotate.off();</p></code></pre> </div> <h3 class="subsection-title">Members</h3> <dl> <dt> <div class="nameContainer"> <h4 class="name" id=".VERSION"><span class="type-signature static">static</span>eg.rotate.VERSION<span class="type-signature type string">String</span> </h4> </div> </dt> <dd> <div class="description en"> <p>Version info string</p> </div> <div class="description ko"> <p>버전정보 문자열</p> </div> <dl class="details"> <!-- if data.codepen --> </dl> <h5>Example</h5> <pre class="prettyprint"><code><p>eg.rotate.VERSION; // ex) 2.2.0</p></code></pre> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <div class="nameContainer"> <h4 class="name" id=".isVertical"> <span class="type-signature static">static</span>eg.rotate.isVertical<span class="signature">()</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Boolean}</span> </h4> <div class="tag-source"> <a href="rotate.js.html">rotate.js</a>, <a href="rotate.js.html#line246">line 246</a> </div> </div> </dt> <dd> <div class="description en"> <p>Get device is in vertical mode</p> </div> <div class="description ko"> <p>화면이 수직 방향인지 여부</p> </div> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> Boolean </td> <td class="description last"> <div class="en">The orientation of the device (true: portrait, false: landscape) </div> <div class="ko"><p>기기의 화면 방향(true: 수직 방향, false: 수평 방향)</p></div> </td> </tr> </tbody> </table> <h5>Example</h5> <pre class="prettyprint"><code><p>eg.rotate.isVertical(); // Check if device is in portrait mode</p></code></pre> <dl class="details"> <!-- if data.codepen --> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id=".off"> <span class="type-signature static">static</span>eg.rotate.off<span class="signature">(<span class="optional">listener</span>)</span> </h4> <div class="tag-source"> <a href="rotate.js.html">rotate.js</a>, <a href="rotate.js.html#line209">line 209</a> </div> </div> </dt> <dd> <div class="description en"> <p>Unbind rotate event<br>Without param, will unbind all binded listeners</p> </div> <div class="description ko"> <p>rotate 이벤트 바인딩 해제. 파라미터 없이 호출되는 경우, 바인딩된 모든 이벤트를 해제한다.</p> </div> <ul class="parameters"> <li> <!-- parameter name --> <div> <strong>listener</strong> <span class="optional">optional</span> </div> <!-- parameter type --> <div>Type: <span class="param-type">function</span> </div> <!-- Description --> <div> <div class="description en"><p>listener function </p></div> <div class="description ko"><p>이벤트 핸들러 함수</p></div> </div> <!-- Sub parameters --> </li> </ul> <dl class="details"> <!-- if data.codepen --> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id=".on"> <span class="type-signature static">static</span>eg.rotate.on<span class="signature">(listener)</span> </h4> <div class="tag-source"> <a href="rotate.js.html">rotate.js</a>, <a href="rotate.js.html#line187">line 187</a> </div> </div> </dt> <dd> <div class="description en"> <p>Bind rotate event</p> </div> <div class="description ko"> <p>rotate 이벤트 바인딩</p> </div> <ul class="parameters"> <li> <!-- parameter name --> <div> <strong>listener</strong> </div> <!-- parameter type --> <div>Type: <span class="param-type">function</span> </div> <!-- Description --> <div> <div class="description en"><p>listener function </p></div> <div class="description ko"><p>이벤트 핸들러 함수</p></div> </div> <!-- Sub parameters --> </li> </ul> <dl class="details"> <!-- if data.codepen --> </dl> </dd> </dl> </article> </section> <!-- disqus code --> <div id="disqus_thread"></div> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="//disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> <!-- // disqus code --> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 04 2018 17:35:19 GMT+0900 (대한민국 표준시) </footer> </div> </div> <script>prettyPrint();</script> <script src="scripts/main.js"></script> </body> </html>