2.在构造时(此时传值不同于apply,因为它调用的是Call而不是Construct)
3.构造字面量数组/对象
[ h1 ^]\x0d\x0a||\x0d\x0a|div1 |\x0d\x0a||\x0d\x0a\x0d\x0a如图所示:h1是你说贴出的两个图(展开、收起)\x0d\x0adiv1是你要展开后弹出的层\x0d\x0a\x0d\x0a$("#h1").click(function () {\x0d\x0a$("#div1").toggle("slow",function () {\x0d\x0aif ($(this).attr("style").toLowerCase().indexOf("none") == -1) {\x0d\x0a$("#imgBasicInfo").attr("src", "../../Images/BarUp.gif")\x0d\x0a}\x0d\x0aelse {\x0d\x0a$("#imgBasicInfo").attr("src", "../../Images/BarOpen.gif")\x0d\x0a}\x0d\x0a})\x0d\x0a})\x0d\x0aimgBasicInfo为你要显示的展开、收起的图片动态<script type="text/javascript">window.onload = function showdiv(){
document.getElementById("strHref").onclick = function(){
document.getElementById("hpn").style.display = "block"
}
}
</script>
这样试试应该可以,没测试。希望对你有帮助。