jquery Exercise Two Team move

Source: Internet
Author: User

<! DOCTYPE HTML Public"-//W3C//DTD XHTML 1.0 transitional//en" "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD">"http://www.w3.org/1999/xhtml">"Content-type"Content="text/html; Charset=utf-8"/><title> Untitled Document </title><script type="Text/javascript"Src=".. /.. /popwindow/jquery-1.11.2.min.js"></script><style type="Text/css">. t{Width: -%; Text-Align:center;    top:10px;    height:130px; Background: #00C;}. left{Width: +%;    top:150px;    height:500px;    Background: #C69;    Position:absolute;    left:0px; }.middle{Width: -%;    top:150px;    height:500px;    Background: #CF0;    Position:absolute; Left: +%;}. right{Width: +%;    top:150px;    height:500px;    Background: #C69;    Position:absolute;    right:0px; }.leftb{Width: -%;    height:500px; Left: the%; Position:absolute;}. rightb{Width: -%;    height:500px; Right: the%; Position:absolute;}. le{margin-top:5px; Width: -%; Text-Align:center; Background: #3F0;}. ri{margin-top:5px; Width: -%; Text-Align:center; Background: #3F0;}.    btn1{top:200px; Width: -%;    height:30px; Text-Align:center; Left: the%;    Position:absolute;    Background: #F30;    }.btn2{bottom:200px; Width: -%;    height:30px; Text-Align:center; Left: the%;    Position:absolute; Background: #F30;}</style>class="T">class=" Left"><divclass="LeftB"><divclass="le"> Real Madrid </div><divclass="le"> Manchester United </div><divclass="le"> Milan </div></div></div><divclass="Middle"><divclass="BTN1">>></div><divclass="btn2">></div></div><divclass=" Right"><divclass="RIGHTB"><script type="Text/javascript">$ (document). Ready (function (e) {//Mouse Selected//Mouse Click to select Event$(". Le"). Click (function (e) {//Initialize$(". Le"). CSS ("background","#3F0")    $(". Le"). attr ("CZ","0")//Add Tag//the selected style$( This). CSS ("background","#FFF")    $( This). attr ("CZ","1")//Change Marker    }); //Click the middle button to move to the right$(". BTN1"). Click (function (e) {varMz= $ (". Le")//Save all the names in the name MZ        for(varI=0; i<mz.length;i++)//Find       {              //Judging the selected item           if(Mz.eq (i). attr ("CZ")=="1")//eq () determine if the CZ label is a checked label 1           {                   varzhi= Mz.eq (i). Text ()//put the selected value in Zhi//determine if the value exists              if(has (zhi)) {varStr="<div class= ' ri ' >"+zhi+"</div>";//Zhi The contents of a value into a div output string$(". RIGHTB"). append (str);//The div you want to output is spelled to the right window            }           }       }       }); //Select All Mobile$(". BTN2"). Click (function (e) {//left show all checked status$(". Le"). CSS ("background","#FFF")          //put all the names in the value       varlist=$ (". Le")          //Loop Add            for(varI=0; i<list.length;i++)           {              varZhi=List.eq (i). Text ()if(Has (zhi))//Go heavy            {             varStr="<div class= ' ri ' >"+zhi+"</div>";//Zhi The contents of a value into a div output string$(". RIGHTB"). append (str);//The div you want to output is spelled to the right window            }           }               }); }); function has (zhi)//judge whether to repeat{    varlist=$ (". Ri"); varisok=true;  for(varI=0; i<list.length;i++)    {        if(List.eq (i). Text () = =zhi) {isOK=false;  Break; }    }    returnisOK; }</script>

jquery Exercise Two Team move

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.