<script type="text/javascript">

function openwindow(url,name,iWidth,iHeight)
{
var url; //转向网页的地址;
var name; //网页名称,可为空;
var iWidth; //弹出窗口的宽度;
var iHeight; //弹出窗口的高度;
//window.screen.height获得屏幕的高,window.screen.width获得屏幕的宽
var iTop = (window.screen.height-30-iHeight)/2; //获得窗口的垂直位置;
var iLeft = (window.screen.width-10-iWidth)/2; //获得窗口的水平位置;
window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
} </script>

<a href="javascript:void(0);" onclick="javascript:openwindow('a.html','',400,200);">转到a</a>

还有一种方法,这个是cnblogs发帖时最下面Tag标签的代码:

 <div class="itemspace">
Tag标签:
<input name="Editor$Edit$Advanced$txbTag" type="text" id="Editor_Edit_Advanced_txbTag" style="width: 500px" />
<a onclick="leftVal = (screen.width - 300) / 2;topVal = (screen.height - 500) / 2;window.open( 'InsertTag.aspx','_blank','width=300,height=500,toolbars=yes,resizable=yes,scrollbars=yes,left='+leftVal+',top='+topVal);return false" href="#">插入已有标签</a> (多个关键字之间用“,”分隔,最多不超过10个)</div>
<div class="itemspace">

最新文章

  1. 一对一还是一对多? MVP设计前提
  2. PHP-SplDoublyLinkedList
  3. mysql优化杂记
  4. zTree开发下拉树
  5. 【Java】Java 深入探讨 单例模式的实现
  6. jquery简单动画
  7. ThinkPHP3.2判断是否为手机端访问并跳转到另一个模块的方法
  8. linux 杀死进程的方法
  9. Android IOS WebRTC 音视频开发总结(二七)-- whatsapp之转发优先
  10. mysql可以运行在不同sql mode模式下面,sql mode模式定义了mysql应该支持的sql语法,数据校验等
  11. 调试Android USB遇到的令人费解的问题
  12. 解决android锁屏或解锁后activity重启的问题
  13. TP开发小技巧
  14. 忘记了SqlServer的SA密码怎么办
  15. asm: Writing Inline Assembly
  16. Lesson 2-2(列表,元组)
  17. 实现ssr服务端渲染
  18. XH与PH排线的区别
  19. 【js】深拷贝一文中的几个错误点
  20. C++中返回值

热门文章

  1. phpstorm 报错及解决
  2. sigar开发(java)
  3. mac安装sublime text 3,含注册码
  4. Java使用HTTPClient3.0.1开发的公众平台消息模板的推送功能
  5. 兼容IE-FireFox-Chrome的背景音乐播放
  6. GS使用HTTPS登录的设置过程
  7. Mac上brew&amp;thrift安装 以及在thrift架构下,自己新作了maven的小例 Demo
  8. Flutter &amp; Dart
  9. 【Java】 内部类
  10. Nginx PREACCESS阶段 如何限制每个客户端的并发连接数