如何在jquery中添加窗口关闭按钮代码 [英] how to add window close button code in jquery
本文介绍了如何在jquery中添加窗口关闭按钮代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在jquery中添加窗口关闭按钮代码
how to add window close button code in jquery
推荐答案
查看此w3schools示例
< a href =http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_close> http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_close [< a href =http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_closetarget =_ blanktitle =New Window> ^ ]
如果你想在同一个窗口上添加关闭按钮,试试这个简单的网页示例。复制此代码并将其另存为html文件并查看。
See this w3schools example
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_close[^]
If you want to add close button on same window try this simple web page example. Coppy this code and save it as html file and see.
<!DOCTYPE html>
<html>
<body>
<input type="button" onclick="window.close();" />
<script>
( document )。ready( function (){
(document).ready(function(){
( 。close)。click( function (){
window .close();
});
});
< / script >
< / body >
< / html >
(".close").click(function(){ window.close(); }); }); </script> </body> </html>
这篇关于如何在jquery中添加窗口关闭按钮代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文