Still, here I put the key code out, CSS style I for simple, simply is in the selection, replaced a background image just.
jquery Code:
$ (function () {$ ("Span.zdy-icon-radio"). Click (function () {$ (this). Toggleclass ("active"); }); $ ("#checkall"). Click (function () {if () hasclass (' active ')} {//If the currently clicked multi-box is selected $ ('. GWC-BG span.zdy-icon-radio '). AddClass ("active");} else{$ ('. GWC-BG span.zdy-icon-radio '). Removeclass ("active");}); });
HTML code:
<div class= "xp-content02" ><div class= "Headertop mui-clearfix order-border" ><div class= "Left_welcome" ><a href= ". /index.html "> Show </a></div><div class=" Right_pleaselogin "> Please first [<a href=] login.html "> Login </a> or [<a href=" register.html "> Register </a> ]<i class=" Iconfont " >& #xe60d </i> <a href= "#" > Shopping cart </a><span class= "CS" >0</ span> pieces </div></div><div class= "tt02" > Shopping cart </div> <div class= "Gouwuche" > <li class= "Mui-table-view-cell" > <div class= "Mui-slider-right mui-disabled" ><a class= "mui-btn mui-btn-red" > Delete </a></div><div class= "Orde-pay-baobei mui-slider-handle " ><div class=" Order-title mui-cleaRfix "><a href=" # "> Edit </a><a href=" # " ><span></span><span> (Ditto) </span><div class= women's clothing Monopoly" Choose-yours02 "></div></a></div><div class=" order-baobeicon gwc-bg Mui-clearfix "><div class=" Grc-lf "><span class=" Zdy-icon-radio "></span></div ><div class= "Small-img-lef" > </div><div class=" baobei-intro-rt wt06 " ><p class= "Baobei-title" ><a href= "#" > 2016 Spring and Summer women's new Heavy industry cartoon badge patch ice silk ... </a></p><p class= "GMSL" ><span>x 1</span> Color classification: Black, size l</p><p class= "HS" >¥ 259.00</p></div></div></div></li><div class= "Greybg02" ></div ><li class= "Mui-table-view-cell" > <div class= "mui-slider-right mui-disabled" ><a class= "mui-btn mui-btn-red "> Delete </a></div><div class=" Orde-pay-baobei mui-slider-handle " ><div class= "Order-title mui-clearfix" ><a href= "#" > Edit </a><a href= "#" ><span></span><span> (Ditto) </span><div class= women's clothing Monopoly" Choose-yours02 "></div></a></div><div class=" Gwc-bg mui-clearfix "><div class= "Grc-lf" ><span class= "zdy-icon-radio active" ></span></div><div class= "Small-img-lef" > </div><div class=" baobei-intro-rt wt06 " ><p class= "Baobei-title" ><a href= "#" > 2016 Spring and Summer women's new Heavy industry cartoon badge patch ice silk ... </a></p><p class= "GMSL" ><span>x&nbSp;1</span> Color Classification: Black, size l</p><p class= "HS" >¥ 259.00</p></div></ div></div></li><div class= "Greybg02" ></div> </div> <div class= "Gouwuche-jiesuan" > <div class= "grc-lf Quanxuan "><span class=" zdy-icon-radio " id=" Checkall "> select all </span></div>< div class= "Heji" > Total: <span>¥259.00</span></div><div class= "Jiesuan" ><a href= "submit-order.html" > Settlement </a></div> </div></div>
Preview:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/83/4B/wKiom1dvub-SYXJyAABXgbEJfXo447.jpg "title=" 36020160626191649699.jpg "alt=" Wkiom1dvub-syxjyaabxgbejfxo447.jpg "/>
Simple jquery emulation check box select all optional function