首页 技术 正文
技术 2022年11月16日
0 收藏 783 点赞 2,650 浏览 1345 个字

昨天给大家介绍了一款基于jquery ui漂亮的可拖动div实例,今天要给大家分享一款基于jquery的可拖动div。这款可拖动div只要引用jquery就可以,无需引用jquery ui。还实时记录的鼠标的坐标。一起看下效果图吧。

基于jquery的可拖动div

在线预览   源码下载

实现的代码。

html代码:

  <span class="text noselect">DRAGGIN' WINDOWS<br />
<a href="http://www.w2bc.com" rel="external nofollow" >This is an old one. Click HERE for access the newer one.</a></span>
<div class="window noselect">
<div class="pew">
Header
</div>
<div class="container">
The Cords
</div>
</div>

css代码:

  .noselect
{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
} html
{
width: 100%;
height: 100%;
} body
{
background: radial-gradient(#ACBEC8, #3A4E57);
margin:;
width: 100%;
height: 100%;
font-family: 'Raleway' , sans-serif;
} .testtext
{
width: 100%;
color: white;
text-align: center;
display: inline-block;
padding-top: 30vh;
font-size: 48px;
text-shadow: 0 0 6px #333;
} .text
{
width: 100%;
color: white;
text-align: center;
display: inline-block;
padding: 40px 0;
font-size: 48px;
line-height: 30px;
} .text a
{
text-decoration: none;
font-size: 15px;
line-height: 20px;
color: white;
} .window
{
width: 500px;
height: 300px;
background: #181818;
margin-left: -250px;
left: 50%;
position: absolute;
} .pew
{
width: 100%;
height: 30px;
text-align: center;
line-height: 30px;
color: #111;
background: #E31836;
cursor: default;
} .container
{
width: 100%;
height: calc(100% - 30px);
color: #eee;
padding: 35px 0 0 0;
text-align: center;
font-size: 36px;
}

注:本文爱编程原创文章,转载请注明原文地址:http://www.w2bc.com/Article/8756

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,490
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,290