原程式網頁的網頁點我
但如果是連動例如DropDownList1連動DropDownList2就必需要用jquery live(邊學邊做系列有教大家可以去看看)
好像要jQuery 1.3.2版後才有這功能喔
$(function() { $("#ctl00_ContentPlaceHolder1_DropDownList2") .live("focus", function() { $(this).data("selectWidth", $(this).css("width")).css("width", "auto"); $(this).css({ position: "absolute" }); }) $("#ctl00_ContentPlaceHolder1_DropDownList2") .live("blur", function() { $(this).css("width", $(this).data("selectWidth")); }) });