jQuery 点击等待 点击显示loading

XML/HTML Code
- <div id="demo-basic">
- <button type="button" class="waiting">► start waiting</button>
- <button type="button" class="waiting-done">■ waiting done</button>
- <pre>
- // Default behaviour is a loading spinner positioned absolute, centered and with an overlay.
- $('#demo-basic .content').waiting();
- </pre>
- <div class="content">
- 这个内容会被覆盖
- </div>
- </div>
- <script type="text/javascript">
- $('#demo-basic button.waiting').on('click', function () {
- $(this).siblings('.content').waiting();
- });
- </script>
- <div id="demo-position">
- <button type="button" class="waiting">► start waiting</button>
- <button type="button" class="waiting-done">■ waiting done</button>
- <pre>
- // You can position the indicator/spinner by setting position to one of the following values:
- // 'center',
- // 'top left', 'top center', 'top right',
- // 'center left', 'center right',
- // 'bottom left', 'bottom center' or 'bottom right'
- // If you don't want to use the predefined CSS classes you can set position to 'custom',
- // in that case you have to take care of the CSS yourself.
- $('#demo-position .content').waiting({ position: 'top left' });
- </pre>
- <div class="content">
- <Br><Br>
- 自定义位置
- <Br><Br><Br>
- 顶部左侧<Br><Br>
- </div>
- </div>
- <script type="text/javascript">
- $('#demo-position button.waiting').on('click', function () {
- $(this).siblings('.content').waiting({ position: 'top left' });
- });
- </script>
- <div id="demo-overlay-false">
- <button type="button" class="waiting">► start waiting</button>
- <button type="button" class="waiting-done">■ waiting done</button>
- <pre>
- // You can simply append the indicator by setting overlay to false
- $('#demo-overlay-false .content').waiting({ overlay: false });
- </pre>
- <div class="content">
- 不覆盖本内容
- </div>
- </div>
- <script type="text/javascript">
- $('#demo-overlay-false button.waiting').on('click', function () {
- $(this).siblings('.content').waiting({ overlay: false });
- });
- </script>
- <div id="demo-fixed">
- <button type="button" class="waiting">► start waiting</button>
- <button type="button" class="waiting-done">■ waiting done</button>
- <pre>
- // By setting fixed to true you can expand the overlay over the whole page
- $('#demo-overlay-false .content').waiting({ fixed: true });
- </pre>
- <div class="content">
- 自动退出loading
- </div>
- </div>
- <script type="text/javascript">
- $('#demo-fixed button.waiting').on('click', function () {
- var that = this;
- $(this).siblings('.content').waiting({ fixed: true });
- setTimeout(function() {
- $(that).siblings('button').click();
- }, 3000);
- });
- </script>
原文地址:http://www.freejs.net/article_jquerywenzi_215.html
最近更新
- CSS3鼠标悬停图片遮罩层变形动画特...
- 响应式全屏手风琴菜单,同时支持垂直方...
- 分组select选择器,支持多选和单...
- jQuery时间日期选择器代码日历插...
- Select 选择器 可以清空的单选...
- jQuery json 无刷新翻页 ...
我爱薅羊毛
点击最多
广告赞助
相关文章
- jquery点击显示或隐藏内容,可以一次展开多个和...
- tooltips/弹出层/消息提示效果,支持点击与...
- jQuery幸运大转盘抽奖活动代码
- jquery来实现的添加商品和减少商品数量,用于购...
- jQuery手机端弹出层提示对话框
- php js实现拖动滑块完成拼图验证码