<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div style="border: 1px solid #ddd;width: 600px;position: absolute;">
<div id="title" style="background-color: black;height: 40px;color: white;">
<strong>标题</strong>
</div>
<div style="height: 300px;">
内容
</div>
</div>
<script type="text/javascript" src="../../jquery-1.12.4.js"></script>
<script>
$(function () {
$('#title').mouseover(function () {
$(this).css('cursor','move');
}).mousedown(function (e) {
var _event = e || widows.event;
var ord_x = _event.clientX;
var ord_y = _event.clientY;
var parent_left = $(this).parent().offset().left;
var parent_top = $(this).parent().offset().top;
$(this).bind('mousemove',function (e) {
var _new_event = e || window.event;
var new_x = _new_event.clientX;
var new_y = _new_event.clientY;
var x = parent_left + (new_x - ord_x);
var y = parent_top + (new_y - ord_y);
$(this).parent().css('left',x+'px');
$(this).parent().css('top',y+'px');
})
}).mouseup(function () {
$(this).unbind('mousemove');
});
})
</script>
</body>
</html>
漂亮不能当饭吃,帅气也不能当日子过。说来说去,最后要找的那个人,总是可爱的,善良的,知道怎么陪你把日子过舒服的。所以,你别看人家老说喜欢美女,喜欢帅哥,其实聪明人家里,都藏着那么一个温和的,憨态可掬的有趣人。美颜这种事,还不就是情人眼里出西施么。