點擊按鈕彈出模態對話框,包含表單內容,背景遮罩鎖定頁面交互。
<input type="button" value="高級搜索" id="click_test4" />
<script>
var content4 = "<center>高級搜索</center><form action='' method='post' id='formUserSuperSearch'>"
+ "用戶名 : <input type='text' name='username' id='username'>"
+ "<br/><br/>電子郵箱: <input type='text' id='email'/>"
+ "<br/><br/>單位: <input type='text' id='unit'/>"
+ "<br/><br/>電話:<input type='text' id='tel'/>"
+ "<br/><br/>手機: <input type='text' id='mobile'/>"
+ "<br/><br/><input type='button' onClick='UserSuperSearche()' value='取消'/>"
+ "<input type='button' onclick='UserSuperSearch()' value='確定'/>"
+ "</form>";
$('click_test4').onclick = function() {
TINY.box.show(content4, 0, 350, 250, 0);
};
</script>
TINY.box.show() 方法彈出層,參數依次為:內容 HTML、是否顯示關閉按鈕、寬度、高度、是否固定定位此為輕量級彈層實現方案,適合簡單業務場景快速集成。