大家直接自己看吧,請多多指教,這個是幾個月前寫的,現在全部整理一下。 複製程式碼 程式碼如下: <BR>body,div,a,span{margin: 0;padding:0;} <BR>.g-pt-10{ padding-top:10px; } <BR>.g-ta-c{ text-align:center; } <BR>.g-fz-16 { font-size:16px; } <BR>.g-d-b{ display:block; } <BR>.g-f-l{ float:left; } <BR>.g-c-w{ color:#fff; } <BR>.g-fz- 18{ font-size:18px; } <br>.g-d-ib{ display:inline-block; } <br>.g-cf:after { content:""; clear:both; display:table; } <BR>.g-cf { zoom:1; } <BR><BR><BR>a:hover{ text-decoration:none; color:#ff0000; } <BR>.box{ width:705px; height:242px; margin:50px auto; background:#f5f9fe; border:1px solid #6888a1; } <BR>div.mid{ width:330px; margin:20px auto; } <BR>a.support{ width:124px; background:#008DCA url("support.png"); margin-right:80px; } <BR>a.oppose{ width:124px; height:73px; background:#F78106 url("oppose.png"); } <br>.g-mt-45{ margin-top:45px; } <br>span.line{ width:380px; height:17px; margin:0 auto; background:#008DCA; } <BR>s.line2{ widthDCA; } <BR>s.line2{ width. :80px; height:17px; background:#F78106; } <br><br> 如果微信將會進行收費,你會怎麼做? 0 0 0% 0% <BR>var sup=parseInt($('#supamount') .text()); <BR>var opp=parseInt($('#oppamount').text()); <BR><BR>function support(){ <BR>sup =1; <BR>$( '#supamount').text(sup.toString()); <BR>$('#suppercent').text((sup/(sup opp))*100).toFixed(0).toString()) ; <BR>$('#opppercent').text((100-(sup/(sup opp))*100).toFixed(0).toString()); <BR>$('#supline'). attr("style","width:" 380*(sup/(sup opp)) "px"); <BR>} <BR>function oppose(){ <BR>opp =1; <BR>$(' #oppamount').text(opp.toString()); <BR>$('#suppercent').text((sup/(sup opp))*100).toFixed(0).toString()); <BR>$('#opppercent').text((100-(sup/(sup opp))*100).toFixed(0).toString()); <BR>$('#supline').attr ("style","width:" 380*(sup/(sup opp)) "px"); }