raf*_*llo 8 jquery layout fixed draggable
它在firefox中运行得很完美,但是在chrome和opera中它不起作用.
<div> has position:fixed, and is .draggable()
Run Code Online (Sandbox Code Playgroud)
它除了firefox之外不起作用
ZiT*_*TAL 11
不要在CSS中设置固定:它适用于firefox,chromium,safari,iexplore
var div = $('#id');
div.resizable(
{
stop: function(event, ui)
{
var top = getTop(ui.helper);
ui.helper.css('position', 'fixed');
ui.helper.css('top', top+"px");
}
});
div.draggable(
{
stop: function(event, ui)
{
var top = getTop(ui.helper);
ui.helper.css('position', 'fixed');
ui.helper.css('top', top+"px");
}
});
function getTop(ele)
{
var eTop = ele.offset().top;
var wTop = $(window).scrollTop();
var top = eTop - wTop;
return top;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13635 次 |
| 最近记录: |