jquery-based Draggable div

Source: Internet
Author: User

Yesterday, we introduced a beautiful example of a draggable div based on the jquery UI, and today we are going to share a draggable div that is based on jquery. This draggable div is just a reference to jquery, without the need to reference the jquery UI. The coordinates of the mouse are also recorded in real time. Let's see it together.

Online preview Source Download

The implemented code.

HTML code:

  <spanclass= "Text Noselect">Draggin ' WINDOWS<BR/>        <ahref= "Http://www.w2bc.com">This is a old one. Click here for access the newer one.</a></span>    <Divclass= "Window Noselect">        <Divclass= "Pew">Header</Div>        <Divclass= "Container">The Cords</Div>    </Div>

CSS code:

. 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:0;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; }

Note: This article Love programming original article, reproduced please specify the original address: http://www.w2bc.com/Article/8756

jquery-based Draggable div

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.