zoukankan      html  css  js  c++  java
  • bootstrap课程7 jquery中结束之前动画用什么

    bootstrap课程7 jquery中结束之前动画用什么

    一、总结

    一句话总结:stop()方法。$('.navs').not($('.navs').eq(idx)).stop().hide(100);

    1、bootstrap导航效果移入对应li,这个li没有加active类,如何实现让它加上?

    自己加上js即可

    63 $('li').mouseenter(function(){
    64     $(this).addClass('active');
    65     $('li').not($(this)).removeClass('active');
    66 
    67     idx=$(this).index('li');
    68     $('.navs').eq(idx).stop().show(1000);
    69     $('.navs').not($('.navs').eq(idx)).stop().hide(100);
    70 });

    二、jquery中结束之前动画用什么

    1、相关知识

    输入框组:
    .input-group
    .input-group-addon
    .input-group-lg
    .input-group-sm
    .input-group-btn

    导航:
    .nav
    .nav-tabs
    .nav-pills
    .nav-stacked

     

    2、代码

    胶囊式导航实现个人中心

     1 <!doctype html>
     2 <html lang="en">
     3 <head>
     4     <meta charset="UTF-8">
     5     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
     6     <title>index</title>
     7     <style>
     8         *{
     9             font-family: 微软雅黑;
    10         }
    11         
    12         .navs{
    13             padding:15px 15px;
    14             display: none;
    15         }
    16     </style>
    17     <link rel="stylesheet" href="bs/css/bootstrap.css">
    18     <script src="bs/js/jquery.min.js"></script>
    19     <script src="bs/js/bootstrap.js"></script>
    20     <script src="bs/js/holder.min.js"></script>
    21 </head>
    22 <body>
    23     <div class="container">
    24         <h1 class='page-header'>Bootstrap前端框架</h1>
    25         <div class="row">
    26             <div class="col-md-2">
    27                 <ul class="nav nav-pills nav-stacked">
    28                     <li class='active'>
    29                         <a href="">linux</a>
    30                     </li>    
    31                     <li class=''>
    32                         <a href="">php</a>
    33                     </li>    
    34                     <li class=''>
    35                         <a href="">java</a>
    36                     </li>    
    37                 </ul>
    38             </div>
    39 
    40             <div class="col-md-10">
    41                 <div class="row navs">
    42                     <img src="a.jpg">
    43                     <p>linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!</p>
    44                 </div>
    45 
    46                 <div class="row navs">
    47                     <img src="b.jpg" alt="">
    48                     <p>php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!php is very much!</p>
    49                 </div>
    50 
    51                 <div class="row navs">
    52                     <img src="c.jpg" alt="">
    53                     <p>java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!java is very much!</p>
    54                 </div>
    55             </div>
    56         </div>    
    57         
    58 
    59         
    60     </div>
    61 </body>
    62 <script>
    63 $('li').mouseenter(function(){
    64     $(this).addClass('active');
    65     $('li').not($(this)).removeClass('active');
    66 
    67     idx=$(this).index('li');
    68     $('.navs').eq(idx).stop().show(1000);
    69     $('.navs').not($('.navs').eq(idx)).stop().hide(100);
    70 });
    71 
    72 $('.navs').eq(0).show(10);
    73 </script>
    74 </html>
     
  • 相关阅读:
    python struct详解
    python 二维矩阵及转byte知识点
    c# HttpListener拒绝访问
    c# 捕获一般获取不到的异常
    查看dll依赖项
    Javascript 进阶 作用域 作用域链
    【Android进阶】Gson解析json字符串的简单应用
    做web项目时对代码修改后浏览器端不生效的应对方法(持续更新)
    异常Exception in thread "AWT-EventQueue-XX" java.lang.StackOverflowError
    玩转web之json(五)---将表单通过serialize()方法获取的值转成json
  • 原文地址:https://www.cnblogs.com/Renyi-Fan/p/9354371.html
Copyright © 2011-2022 走看看