<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> ..... </style> <script type="text/javascript" src="https://www.jb51.net/move.js"></script> <script type="text/javascript"> window.onload=function () { var oBtn=document.getElementById('but'); var oBottom=document.getElementById('zns_bottom'); var oBox=document.getElementById('zns_box'); var oBtnClose=document.getElementById('btn_close'); oBox.style.display='block'; var initBottomRight=parseInt(getStyle(oBottom, 'right')); var initBoxBottom=parseInt(getStyle(oBox, 'bottom')); oBox.style.display='none'; oBtn.onclick=openHandler; oBtnClose.onclick=closeHandler; function openHandler() { startMove(oBottom, {right: 0}, function (){ oBox.style.display='block'; startMove(oBox, {bottom: 0}); }); oBtn.className='but_hide'; oBtn.onclick=closeHandler; } function closeHandler() { startMove(oBox, {bottom: initBoxBottom}, function (){ oBox.style.display='none'; startMove(oBottom, {right: initBottomRight}, function (){ oBtn.className='but_show'; }); }); oBtn.onclick=openHandler; } }; </script> </head> <body> ...... </body> </html>
javascript运动详解(4)
内容版权声明:除非注明,否则皆为本站原创文章。