Home > Web Front-end > JS Tutorial > Code for a pop-up window with prompts to confirm and cancel functions_javascript skills

Code for a pop-up window with prompts to confirm and cancel functions_javascript skills

WBOY
Release: 2016-05-16 19:15:01
Original
944 people have browsed it

I don't know what this function is called, and I haven't found it after searching for a long time, so I came to ask for your help. Thank you.

My purpose is to pop up a new window based on the original page. At the same time, the original page is gray and cannot be operated. The operation of the original window must be restored after the new window that pops up is closed. . The specific effect is a bit like lightbox and thickbox. Now I want to use thickbox, which can achieve the effect of graying out the old page, but there is no way to prevent the old page from being inoperable. (It needs to be used under both Firefox and IE. IE’s showModalDialog can achieve this purpose, but it cannot be used under Firefox)


[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]<script> var isDrag = false; function execCode(){ var newWin = window.open(); newWin.document.write(tt.value); } var oldX=0,oldY=0; function init(){ isDrag=true; oldX=event.x; oldY=event.y; } function end(){ isDrag=false; } function moveIt(){ if(isDrag){ var x =window.event.x; var y = window.event.y; hdl.parentNode.style.left = parseInt(hdl.parentNode.style.left.replace("px","")) + (x - oldX); hdl.parentNode.style.top = parseInt(hdl.parentNode.style.top.replace("px","")) + (y - oldY); oldX = x; oldY = y; } } </script>
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template