<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<script src="jquery-1.2.6.js" type="text/javascript"></script>
<style type="text/css">
#openwin{width: 300px; font-size: 12px; border: 1px solid rgb(112, 156, 210);}
.hd{background: #709cd2; padding: 5px 2px; color: #fff; border: 1px solid #fff;}
h2{ margin: 0; padding: 0; font-size: 14px;}
.closewin{float: right; width: 18px; background: url(dialogclose.gif) left center; height: 17px;}
p{margin: 0; padding: 5px 6px; text-indent: 2em;}
</style>
<script type="text/javascript">
<!--
$.fn.extend({
drag: function(parent, limit, sFunc, mFunc, eFunc){//limit range, start handler, moving handler, end handler
return this.each(function(){
var _this = parent ? this.parentNode : this;
if($.browser.msie) {
this.onselectstart = function(){return false};
if($(_this).css("backgroundColor") == "transparent")_this.style.background = "#fff";
}
if($.browser.mozilla) this.style.MozUserSelect = 'none';
this.style.cursor = "move";
$(this).mousedown(function(e){
sFunc && sFunc.call(_this);
var offset = $(_this).offset();
var screenX = e.screenX, screenY = e.screenY, w = _this.offsetWidth, h = _this.offsetHeight;
$(document).mousemove(function(e2){
if($.browser.msie && e.which != 1) return ($(document).unbind(), eFunc.call(_this));
var curLeft = offset.left + e2.screenX - screenX, curTop = offset.top + e2.screenY - screenY;
if(!limit) limit = {minX: -20000, maxX: 20000, minY: -20000, maxY : 20000};
curLeft = curLeft < limit.minX ? limit.minX : ((curLeft + w) > limit.maxX ? (limit.maxX - w) : curLeft);
curTop = curTop < limit.minY ? limit.minY : ((curTop + h) > limit.maxY ? (limit.maxY - h) : curTop);
$(_this).css({position: "absolute", left: curLeft, top: curTop});
if($.browser.msie && _this.tagName == "IMG") e2.preventDefault();
mFunc && mFunc.call(_this);
});
$(document).mouseup(function(){
$(document).unbind();
eFunc && eFunc.call(_this);
});
if(this.tagName == "IMG") e.preventDefault();
});
});
}
});
$(function(){
$(".hd").drag(true);
});
//-->
</script>
</head>
<body>
<div id="openwin">
<div class="hd">
<div class="closewin"></div>
<h2>窗口名字</h2>
</div>
<div id="bd">
<p>福建炼厂PP装置现产拉丝T30S,今日挂牌价普降1500元/吨。最新拉丝T30S挂牌价7500元/吨,膜料T36F挂牌价7500元/吨。厂家销售正常。</p>
</div>
</div>
<img align="absmiddle" src="dialogclose.gif" />
</body>
</html>
回复 更多评论