在ie中拖动会选定文本,只兼容电脑.ff、opera、safari、Chrome
<div id="f" style="background-color:#FFF;border:solid 1px #08C;position:fixed;top:0px;left:0px;z-index:101;">
<div id="title" style="background-color:#08C;cursor:move;height:5px;"></div>
<a href="javascript:scroll(0,0)"title="回顶↑">TOP</a>
</div><div style="padding-top:25px"></div>
<script type="text/javascript">
var posX;
var posY;
fdiv = document.getElementById("f");
document.getElementById("title").onmousedown=function(e)
{
if(!e) e = window.event; //IE
posX = e.clientX - parseInt(fdiv.style.left);
posY = e.clientY - parseInt(fdiv.style.top);
document.onmousemove = mousemove;
}
document.onmouseup = function()
{
document.onmousemove = null;
}
function mousemove(ev)
{
if(ev==null) ev = window.event;//IE
fdiv.style.left = (ev.clientX - posX) + "px";
fdiv.style.top = (ev.clientY - posY) + "px";
}
</script>
可以在网页插件中测试