jQuery Mobile でくるくる
2013年07月25日 18時15分26秒
こんにちは、ピーターです。
jQuery Mobile でページ全体にくるくる(読込中のあれ)を表示する方法を知りました。
簡単です。
// くるくる表示 $.mobile.loading('show'); // くるくる非表示 $.mobile.loading('hide');
デモページ
http://fiddle.jshell.net/HBEvu/7/show/light/
公式ドキュメント
http://api.jquerymobile.com/loader/
ソース
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>kurukuru</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" /> <style type="text/css"> div.ui-slider-switch { display: block; margin: 3em auto 0; } </style> </head> <body> <select id="loading" data-role="slider"> <option value="hide">Off</option> <option value="show">On</option> </select> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script> <script> (function($) { $('#loading').on('change', function(event) { $.mobile.loading( $(this).val() ); }); })(jQuery); </script> </body> </html>
最近のコメント