Discuz:调用弹出层
从discuz7.0开始,登录注册等页面都改为了弹出层的形式.我们如何调用呢?现在把方法贴给大家.
第一步,调用discuz的js.
代码1:
1 2 3 4 | <script type="text/javascript">var STYLEID = '7', IMGDIR = 'images/default', VERHASH = 'FnD', charset = 'gbk', discuz_uid = 0, cookiedomain = '', cookiepath = '/', attackevasive = '0', allowfloatwin = '1', creditnotice = '1|推广|,2|薪金币|个', gid = parseInt('0'), fid = parseInt('0'), tid = parseInt('0')</script> |
这段代码你可以打开你的论坛首页,自己查找.
代码2:
1 | <script src="/include/js/common.js?FnD" type="text/javascript"></script> |
注意路径哦.我的页面是在根目录所以路径是include/js/common.js?FnD
第二步:增加相关连接
增加登录连接代码如下:
1 2 | <a href="http://www.XXX.com/logging.php?action=login"
onclick="floatwin('open_login', this.href, 600, 400);return false;">登录</a> |
其实这些代码你可以在论坛网页源代码中找到的.只是注意ajax提交时的提交地址.
代码实例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Discuz:调用弹出层--crazyfrom.com </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<script type="text/javascript">var STYLEID = '7', IMGDIR = 'images/default', VERHASH = 'FnD', charset = 'gbk', discuz_uid = 0, cookiedomain = '', cookiepath = '/', attackevasive = '0', allowfloatwin = '1', creditnotice = '1|推广|,2|薪金币|个', gid = parseInt('0'), fid = parseInt('0'), tid = parseInt('0')</script>
<script src="http://www.xxx.com/include/js/common.js?FnD" type="text/javascript"></script>
<BODY>
<div id="wrap" class="wrap s_clear"></div>
<div id="append_parent"></div>
<a href="http://www.xxx.com/logging.php?action=login" onclick="floatwin('open_login', this.href, 600, 400 target=_blank target=_blank);return false;">登录</a>
</BODY>
</HTML> |
注意:
1 2 | <div id="wrap" class="wrap s_clear"></div> <div id="append_parent"></div> |
这段代码在html中是不可缺少的!


欢迎留言