JSP - 滑动图像

时间:2012-06-12 17:00:29

标签: jquery html

我正在使用<marquee>在jsp页面中滑动图像。但是,我找不到如何从jsp页面的右侧顶部到右侧底部滑动图像。有人可以帮我怎么做吗?

1 个答案:

答案 0 :(得分:1)

您可以使用jQuery的native animate()函数:

HTML:

<img height="100" width="100" id="box" src="#" />

CSS:

#box{
    position:absolute;
    right:0px;
    top:0px;
}​

jQuery的:

$(function() {
    $theBox = $("#box");
    $theBox.animate({
        top:$(window).height()-$theBox.height()
    }, 1000);
}); ​

http://jsfiddle.net/hNYDe/