Basics-jquery Tab

Source: Internet
Author: User

<div id= "box" class= "box" > <ul class= "tab" > <li class= "" > Da Vinci <span>◇</span></li&        Gt <li class= "" > Peripheral blood <span>◇</span></li> <li class= "" > Huatai <span>◇</span></             li> <li class= "" > Skrie </li> </ul> <div class= "Products" > <div class= "" > <a href= "#" ></a> </div> <div CLA Ss= "" > <a href= "#" ></a> </div> <div class=" "> <a href=" # "><i MG src= "https://timgsa.baidu.com/timg?image&quality=80&size=b10000_10000&sec=1471967865305&di= 4065ba9bd6aa7d2d7d0a8ceb5bcc1ee3&imgtype=jpg&src=http%3a%2f%2fh.hiphotos.baidu.com%2fzhidao%2fpic%            2fitem%2f377adab44aed2e734cbbfa998701a18b87d6fa31.jpg "></a> </div> <div class=" "> <a href= "#" ></a> </div> </div></div>

  

* {    margin:0;    border:0;    padding:0;} UL {    list-style-type:none;}. box {    width:1002px;    margin:100px Auto;    margin-bottom:0;}. box. tab {    Overflow:hidden;    width:320px;    height:34px;    border:1px solid #ddd;    border-bottom:0;}. box. tab LI {    position:relative;    Float:left;    width:80px;    height:34px;    line-height:34px;    border-top:4px solid #fff;    Text-align:center;    Cursor:pointer;}. box. tab li.selected {    border-color:red;}. Box tab Li span{    position:absolute;    right:0;    top:10px;    Background: #ddd;    width:1px;    height:14px;    Overflow:hidden;}. box. products{    Overflow:hidden;    border:1px solid #ddd;}. box. Products. normal{    float:left;    Display:none;}. box. Products. normal.selected{    Display:block;}. box. Products. normal a{    Display:block;}. box. Products. normal img{    width:1000px;}

  

$ (function () {    $ ("#box. tab li"). addclass ("normal");    $ ("#box. tab li"). EQ (0). addclass ("selected");    $ ("#box. Products div"). addclass ("normal");    $ ("#box. Products div"). EQ (0). addclass ("selected");    var OBox = $ ("#box"). Get (0);    $ ("#box. tab li"). MouseEnter (function () {        var $This = $ (this);        Obox.index = $This. Index ();        $This. AddClass ("selected"). Siblings ("Li"). Removeclass ("selected");        $ ("#box. Products div"). EQ (obox.index). AddClass ("selected"). Siblings ("div"). Removeclass ("selected");    });

  

  

Basics-jquery Tab

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.