Este artigo descreve o efeito de implementar o DV na página por JS. Compartilhe -o para sua referência, como segue:
<style type = "text/css"> corpo {margem: 0px;}#div1 {display: nenhum; Posição: Absoluto; Z-Index: 1000; Altura: 100%; largura: 100%; Antecedentes: #000000; filtro: alfa (opacidade = 30);}#div2 {display: Nenhum; Posição: Absoluto; Altura: 100%; largura: 100%; Top de preenchimento: 10%; Z-Index: 1001;}#div3 {display: block; Posição: Absoluto; Z-Index: 999;} </style> <script type = "text/javascript"> // define o objeto em movimento e as coordenadas em movimento var mouse_obj = "nenhum", _ x, _y; // função do objeto de arrasto (automático) document.onMouMove = function () {se (mouse_obj! document.getElementById (mouse_obj) .style.left = _x+event.x; document.getElementById (mouse_obj) .style.top = _y+event.y; event.returnValue = false; }} // Stop Dragging Function (automaticamente) document.onMouseUp = function () {mouse_obj = "nenhum";} // determine que a função de objeto arrastado o é a função de objeto arrastado m (o) {mouse_obj = o; _x = parseint (document.getElementById (mouse_obj) .style.left) -vent.x; _y = parseInt (document.getElementById (mouse_obj) .style.top) -vent.y;} </script> <div id = "div1"> </div> <div id = "div2" onMousedown = "m (this.id)" style = "esquerda: 0px; top: 0px; #ff7300; posição: static; filtro: progid: dxxETransform.microsoft.dropshadow (color =#666666, offx = 4, offy = 4, positivos = true) "align =" esquerd "> <til =" cursor: move; align = "direita"> <input type = "button" value = "x" onclick = "document.getElementById ('div1'). style.display = 'nenhum'; document.getElementById ('div2'). style.display = 'nenhum';" Style = "Cursor: Hand;"> </td> </tr> <td colspan = "2" bgcolor = "#ffffff" align = "Middle"> Bem -vindo a <a href = "// www.vevb.com"> // www.vevb.com </a> </td> </tr> type = "Button" value = "Open Layer" onclick = "document.getElementById ('div1'). style.display = 'block'; document.getElementById ('div2'). style.display = 'block';"> </div>For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation effects and techniques", "Summary of JavaScript errors and debugging techniques", "Summary of JavaScript data structures and algorithm skills", "Summary of Javascript Algoritmos e Técnicas de Traversal "e" Resumo do Uso do Javascript Mathematic Operations "
Espero que este artigo seja útil para a programação JavaScript de todos.