All Components

TabStrip / Basic usage

  • Paris
  • New York
  • London
  • Moscow
 

17ºC

Rainy weather in Paris.

 

29ºC

Sunny weather in New York.

 

21ºC

Sunny weather in London.

 

16ºC

Cloudy weather in Moscow.

HTML5/JavaScript 源码

<!DOCTYPE html>
<html>
 <head> 
  <title>Basic usage</title> 
  <meta charset="utf-8"> 
  <link href="../content/shared/styles/examples-offline.css" rel="stylesheet"> 
  <link href="../../styles/kendo.common.min.css" rel="stylesheet"> 
  <link href="../../styles/kendo.rtl.min.css" rel="stylesheet"> 
  <link href="../../styles/kendo.default.min.css" rel="stylesheet"> 
  <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet"> 
  <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet"> 
  <script src="../../js/jquery.min.js"></script> 
  <script src="../../js/kendo.all.min.js"></script> 
  <script src="../content/shared/js/console.js"></script> 
  <script>
        
    </script> 
 </head> 
 <body> 
  <a class="offline-button" href="../index.html">Back</a> 
  <div id="example"> 
   <div class="demo-section k-content"> 
    <div id="tabstrip"> 
     <ul> 
      <li class="k-state-active"> Paris </li> 
      <li> New York </li> 
      <li> London </li> 
      <li> Moscow </li> 
     </ul> 
     <div> 
      <span class="rainy"> </span> 
      <div class="weather"> 
       <h2>17<span>ºC</span></h2> 
       <p>Rainy weather in Paris.</p> 
      </div> 
     </div> 
     <div> 
      <span class="sunny"> </span> 
      <div class="weather"> 
       <h2>29<span>ºC</span></h2> 
       <p>Sunny weather in New York.</p> 
      </div> 
     </div> 
     <div> 
      <span class="sunny"> </span> 
      <div class="weather"> 
       <h2>21<span>ºC</span></h2> 
       <p>Sunny weather in London.</p> 
      </div> 
     </div> 
     <div> 
      <span class="cloudy"> </span> 
      <div class="weather"> 
       <h2>16<span>ºC</span></h2> 
       <p>Cloudy weather in Moscow.</p> 
      </div> 
     </div> 
    </div> 
   </div> 
   <style>
                .sunny, .cloudy, .rainy {
                    display: block;
                    margin: 30px auto 10px;
                    width: 128px;
                    height: 128px;
                    background: url('../content/web/tabstrip/weather.png') transparent no-repeat 0 0;
                }

                .cloudy{
                    background-position: -128px 0;
                }

                .rainy{
                    background-position: -256px 0;
                }

                .weather {
                    margin: 0 auto 30px;
                    text-align: center;
                }

                #tabstrip h2 {
                    font-weight: lighter;
                    font-size: 5em;
                    line-height: 1;
                    padding: 0 0 0 30px;
                    margin: 0;
                }

                #tabstrip h2 span {
                    background: none;
                    padding-left: 5px;
                    font-size: .3em;
                    vertical-align: top;
                }

                #tabstrip p {
                    margin: 0;
                    padding: 0;
                }
            </style> 
   <script>
                $(document).ready(function() {
                    $("#tabstrip").kendoTabStrip({
                        animation:  {
                            open: {
                                effects: "fadeIn"
                            }
                        }
                    });
                });
            </script> 
  </div>   
 </body>
</html>