我想制作一个没有可点击内容的 DIV,因为我使用以下 jquery 代码:
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#whole").click(function () {
window.location = $(this).attr("href");
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
它工作正常,但链接始终在同一窗口中打开。我需要如何更改代码才能使 div 在新窗口中打开?
$("#whole").click(function () {
window.open($(this).attr("href"), '_blank');
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6116 次 |
| 最近记录: |