<asp:ListBox ID="lbResearcher" runat="server" Width="130px" Rows="12" AutoPostBack="true"
OnSelectedIndexChanged="lbResearcher_SelectedIndexChanged" SelectionMode="Multiple" ToolTip="单击"
CssClass="uc_lbResearcher" ></asp:ListBox>
// 滚动条的选中位置
function ScrollSelectedHeight(allcount, index) {
//滚动条的总高度
var allHeight = $(".uc_lbResearcher")[0].scrollHeight;
//选中项在listbox的中间位置
$(".uc_lbResearcher").scrollTop((index / allcount) * allHeight - $(".uc_lbResearcher").height()/2);
}
protected void lbResearcher_SelectedIndexChanged(object sender, EventArgs e)
///
//后台要处理的功能代码
///
//定位滚动条的高度 执行前台js方法
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "key", "ScrollSelectedHeight('" + lbResearcher.Items.Count + "','" + lbResearcher.SelectedIndex + "');", true);