JavaScript國旗變換效果代碼

來源:互聯網
上載者:User

1.頁面的HTML代碼如下:

<img id="flag" src="Flags/cn_flag[1].gif" alt="" />
<select name="Country" accesskey="c" id="Country" onchange="change_flag(this);" runat="server" o>
<option value="AR">Argentina</option>
<option value="AM">Armenia</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="BA">Bosnia and Herzegovina</option>
<option value="BD">Bangladesh</option>
<option value="BY">Belarus</option>
<option value="BE">Belgium</option>
<option value="BG">Bulgaria</option>
<option value="BO">Bolivia</option>
<option value="BW">Botswana</option>
<option value="BR">Brazil</option>
<option value="BG">Bulgaria</option>
<option value="CA">Canada</option>
<option value="CL">Chile</option>
<option value="CN" selected="selected">China</option>
<option value="CO">Colombia</option>
<option value="CR">Costa Rica</option>
<option value="HR">Croatia</option>
<option value="CU">Cuba</option>
<option value="CZ">Czech Republic</option>
<option value="DK">Denmark</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="EE">Estonia</option>
<option value="FI">Finland</option>
<option value="FR">France</option>
<option value="DE">Germany</option>
<option value="GB">Great Britain</option>
<option value="UK">United Kingdom</option>
<option value="GE">Georgia</option>
<option value="GR">Greece</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="IN">India</option>
<option value="ID">Indonesia</option>
<option value="IE">Ireland</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JP">Japan</option>
<option value="JO">Jordan</option>
<option value="KZ">Kazakhstan</option>
<option value="KG">Kyrgyzstan</option>
<option value="LA">Laos</option>
<option value="LV">Latvia</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MA">Morocco</option>
<option value="MY">Malaysia</option>
<option value="MT">Malta</option>
<option value="MX">Mexico</option>
<option value="NG">Nigeria</option>
<option value="NL">Netherlands</option>
<option value="NZ">New Zealand</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PA">Panama</option>
<option value="PK">Pakistan</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="QA">Qatar</option>
<option value="RO">Romania</option>
<option value="RU">Russia</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="SG">Singapore</option>
<option value="SK">Slovakia</option>
<option value="SI">Slovenia</option>
<option value="ZA">South Africa</option>
<option value="KR">South Korea</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SR">Suriname</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="TW">Taiwan</option>
<option value="TH">Thailand</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="UA">Ukraine</option>
<option value="UK">United Kingdom</option>
<option value="US">United States</option>
<option value="UY">Uruguay</option>
<option value="VE">Venezuela</option>
<option value="VN">Vietnam</option>
<option value="VU">Vanuatu</option>
<option value="ZM">Zambia</option>
</select>2.change_flag函數 <script>
function change_flag( object ){
var img = document.getElementById("flag");
if( img ){
img.src = "Flags/" + object.value +"_flag[1].gif";
}

}
</script>
線上示範http://img.jb51.net/online/guoqi/Flags.html
打包下載http://img.jb51.net/online/guoqi/guoqi.rar

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.