Pure js-like QQ mail pop-up confirmation box _ javascript skills

Source: Internet
Author: User
The pop-up layer of QQ mail is like a confirmation box. it mainly uses firebug of Firefox to buckle html and css. if it is not encapsulated, a drag event is defined. you can encapsulate your own pop-up window! The code is very simple, so there is not much nonsense here.

Pop-Up layer of QQ mail
 Script //////// drag and drop tool class // var DragUtil = (function () {var doc = document; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; return {/*** register and drag * enter the id of the entire form id and the title part */regist: function (winId, titleId) {// add the following to the page header ://// Otherwise, var width = doc.doc umentElement may be faulty. clientWidth; var height = doc.doc umentElement. clientHeight; var title = doc. getElementById (titleId); var win = doc. getElementById (winId); title. onmousedown = function () {var evt = DragUtil. _ getEvent (); moveable = true; moveX = evt. clientX; moveY = evt. clientY; moveTop = parseInt (win. style. top); moveLeft = parseInt (win. style. left); doc. onmousemove = function () {if (moveable) {var evt = DragUtil. _ getEvent (); var x = moveLeft + evt. clientX-moveX; var y = moveTop + evt. clientY-moveY; var w = parseInt (win. style. width); var h = parseInt (win. style. height); if (x> 0 & (x + w <width) & y> 0 & (y + h 
  

Confirm deletion

After the email is permanently deleted, the email cannot be restored. Are you sure you want to delete it?

Confirm deletion

After the email is permanently deleted, the email cannot be restored. Are you sure you want to delete it?

The above is all the content of this article. I hope you will like it.

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.