定位在浏览器窗口右边

1
2
3
4
5
6
7
8
9
function fixed_to_right(element, top) {
        this.move_score_show = function(){
                var arr = document.viewport.getScrollOffsets();
                var x = arr[0];
                var y = arr[1] + top;
                element.setStyle({top: y + "px"});
        }
        new PeriodicalExecuter(this.move_score_show, 0.1);
}

<span style="position: absolute; border: 1px solid; width: 110px; background-color: #f8f8f8; right: 10px;" id="score_<%= @exam_user.id -%>"><%= render :partial => "score", :object => @exam_user %></span>

    Posted by holin At September 16, 2008 02:10

请登录以发表评论。