彈框內容:
<div class='boxy' style="display:none;" id="boxy"> //將div設置成隱藏效果 <form id='jvForm' method='post' action='/fcms/LoginAloneSubmit.jspx' target='loginframe' onsubmit='return checkInfo();'> <div class='boxy-div1'> 用戶名:<input id='username' class='input1' name='username' type='text' style='color:#666666' /> </div> <div class='boxy-div1'> 密 碼: <input id='password' type='password' class='input1' name='password'/> </div> <div class='boxy-div2'> 使用其他網站賬號登錄: <a href='/sites/login/weibo1.htm' target='_blank'><img src='/image/sinalogo.png' width='20px' height='20px'/></a> <a href='/sites/login/qq1.htm' target='_blank'><img src='/image/qqlogo.png' width='20px' height='20px'/></a><br/> <input type='hidden' name='redirectUrl' value='http://${web.domain}/lala/LaTopicDetail.htm?fid=${fid}&aid=${aid}'/> <input type='submit' class='btn1' value='登 錄'/> <input id='cancer' type='button' class='btn1' value='取 消'/> </div> </form> </div>
補充:為了更好的調試頁面上JS效果,可以在html頁面內的JS腳本里加入
console.log(document.getElementById("boxy"));
接下來引入artDialog.js和default.css,然后呢就是如何使用插件了。
$("#login").bind("click",function(){ var dialog = art.dialog(); dialog.title('快捷登錄'); dialog.lock(true); dialog.content(document.getElementById("boxy")); $("#cancer").click(function (){ dialog.close(); }); });