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>
     
  • 相关阅读:
    2019 USP Try-outs 练习赛
    XDTIC2019招新笔试题 + 官方解答
    2019 ICPC 南昌网络赛
    ICPC 2019 徐州网络赛
    Berlekamp Massey算法求线性递推式
    ICPC 2018 徐州赛区网络赛
    CCPC 2019 网络赛 1006 Shuffle Card
    CCPC 2019 网络赛 1002 array (权值线段树)
    CCF-CSP题解 201803-4 棋局评估
    CCF-CSP题解 201803-3 URL映射
  • 原文地址:https://www.cnblogs.com/Renyi-Fan/p/9354371.html
Copyright © 2011-2022 走看看