前台js代码
<script type="text/javascript">
$(function () {
$("#KinSlideshow").KinSlideshow({
moveStyle: "right",
titleBar: { titleBar_height: 30, titleBar_bgColor: "#08355c", titleBar_alpha: 0.5 },
titleFont: { TitleFont_size: 12, TitleFont_color: "#FFFFFF", TitleFont_weight: "normal" },
btn: { btn_bgColor: "#FFFFFF", btn_bgHoverColor: "#1072aa", btn_fontColor: "#000000",
btn_fontHoverColor: "#FFFFFF", btn_borderColor: "#cccccc",
btn_borderHoverColor: "#1188c0", btn_borderWidth: 1
}
});
})
</script>
使用一个table来放切换的图div层
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td style="width: 306px">
<div id="KinSlideshow" style="visibility: hidden; border: #2f613b 2px solid; height:250px;" >
<%=ImagesStr %>
</div>
</td>
</tr>
</table>
DataSet Hjrec = new DataSet();
Hjrec = BArt.GetList(5, "FrontShowPicPath IS NOT NULL", "DT desc"); //
if (Hjrec != null && Hjrec.Tables["TempRec"] != null && Hjrec.Tables["TempRec"].Rows.Count > 0)
{
for (int i = 0; i < Hjrec.Tables["TempRec"].Rows.Count; i++)
{
ImagesStr = ImagesStr + "<a href=\"Content.aspx?id=" + Hjrec.Tables["TempRec"].Rows[i]["ID"].ToString().Trim() + "\" target=\"_blank\"><img src=\"../../ShowPic/" +
Hjrec.Tables["TempRec"].Rows[i]["FrontShowPicPath"].ToString().Trim() + "\" alt=\"" + ((Hjrec.Tables["TempRec"].Rows[i]["Title"].ToString().Trim().Length > 10) ?
(Hjrec.Tables["TempRec"].Rows[i]["Title"].ToString().Trim().Substring(0, 10) + "...") : Hjrec.Tables["TempRec"].Rows[i]["Title"].ToString().Trim()) +
"\" width=\"306px\" height=\"250px\" /></a>";
}
}
else
{
ImagesStr = "暂无图片";
}
参考:http://www.lanrentuku.com/down/js/jiaodiantu-794/demo2.html
发表评论:
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。