【发布时间】:2012-03-02 06:48:01
【问题描述】:
感谢您给我机会得到帮助。
我想创建一个切换页脚(滑动面板)。
我发现下面的代码可以正常工作,但我希望能够在滑动面板时更改图像:打开和关闭的图像不同(向上箭头 --> 向下箭头)。
我应该如何继续将此功能与此代码集成?
提前非常感谢!
代码如下:
<script type="text/javascript">
jQuery(function($) {
var slide = false;
var height = $('#footer_content').height();
$('#footer_button').click(function() {
var docHeight = $(document).height();
var windowHeight = $(window).height();
var scrollPos = docHeight - windowHeight + height;
$('#footer_content').animate({ height: "toggle"}, 1000);
if(slide == false) {
if($.browser.opera) { //Fix opera double scroll bug by targeting only HTML.
$('html').animate({scrollTop: scrollPos+'px'}, 1000);
} else {
$('html, body').animate({scrollTop: scrollPos+'px'}, 1000);
}
slide = true;
} else {
slide = false;
}
});
});
</script>
【问题讨论】: