<html>
<head>
<script type="text/javascript">
$(document).ready(function() {
$("#login").click(function(){
$.XYTipsWindow({
___title:"登录",
___content:"iframe:login.html",
___width:"460",
___height:"150",
___showbg:true,
___drag:"___boxTitle"
});
});
$("#reg").click(function(){
$.XYTipsWindow({
___title:"注册",
___content:"iframe:reg.html",
___width:"460",
___height:"450",
___showbg:true,
___drag:"___boxTitle"
});
});
})
</script>
</head>
<body>
<div class="toolbar">
<a href="reg.html" id="reg" class="toolbar-item toolbar-item-feedback"></a>
<a href="login.html" id="login" class="toolbar-item toolbar-item-app"></a>
</div>
</body>
</html>
怎么用a标签替代按钮实现弹窗,还是需要修改下jq里边的代码啊?
把a标签的href改成javascript:;如果要跳转,就在点击事件下面加个window.location.href
<a href="javascript:;" id="reg" class="toolbar-item toolbar-item-feedback"></a>
<a href="javascript:;" id="login" class="toolbar-item toolbar-item-app"></a>
目测写的没毛病啊,已经给2个A标签绑定事件了,是不是没引入jquery.js?