Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] 怎么制作一个点击后 弹出层 就像登陆和注册一样的效果 高手进来帮帮忙呀

[复制链接]
sunlinanb46 发表于 2010-10-17 21:53:25 | 显示全部楼层
本帖最后由 sunlinanb46 于 2010-10-17 21:54 编辑

回复 【錯愛號】 的帖子

不知道你是用于dz论坛还是别的。

调用dz论坛弹出层的方法:

在论坛的版模任何地方修改链接为下面的代码
  1. <a onclick="showDialog('你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!你是笨蛋!<br />', 'info', '帮助', null, 1)" href="javascript:;">点击我看看</a>
复制代码
回复

使用道具 举报

wlqc 发表于 2010-10-17 22:10:43 | 显示全部楼层
楼上有点邪恶啊。呵呵

简单点就是这样

  1. <a onclick=showDialog("我路过的,真的路过。","notice","叫你不要点了嘛",null,0) href="javascript:;">你不要点我</a>
复制代码

回复

使用道具 举报

lansfb 发表于 2010-10-17 23:31:57 | 显示全部楼层
怎么调用一个HTML页面呢?
回复

使用道具 举报

cr180 发表于 2010-10-17 23:34:49 | 显示全部楼层
回复 lansfb 的帖子

<a onclick=showDialog("我路过的,真的路过。","notice","叫你不要点了嘛",null,0) href="javascript:;">你不要点我</a>



把javascript:;换成连接地址就可以了
回复

使用道具 举报

lansfb 发表于 2010-10-17 23:44:49 | 显示全部楼层
回复 cr180 的帖子

不会以弹出层形式出现?怎么办
回复

使用道具 举报

 楼主| 【錯愛號】 发表于 2010-10-18 01:03:13 | 显示全部楼层
回复 sunlinanb46 的帖子

我怎么调用代码 文字可以显示
但 帮助下面 有个复制地址  调不出来

回复

使用道具 举报

sunlinanb46 发表于 2010-10-18 13:40:51 | 显示全部楼层
回复 【錯愛號】 的帖子
  1. document.write('html代码');
复制代码
这样就行了
回复

使用道具 举报

 楼主| 【錯愛號】 发表于 2010-10-18 14:02:30 | 显示全部楼层
本帖最后由 【錯愛號】 于 2010-10-18 14:27 编辑

回复 sunlinanb46 的帖子

  1. <a onclick="showDialog('document.write('html代码写这里'); 'info', '帮助', null, 1)" href="javascript:;">点击我看看</a>
复制代码

?????????是这样吗
你把下面的保存为HTML文件 浏览下效果  上面有字 也有复制地址 我套的就是这样的效果 怎么用到DZ里
这个我已经用到里面了 可代码太多 想借用DZ本身的弹出 来做出这个效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>div弹出层</title>
<style type="text/css">
*{ margin:0px; padding:0px;}
body{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
.CityBox{
padding:15px;
clear:both;
color:#333;
border:5px solid #ccc;
width:520px;
height:180px;
background:#fff;
overflow-y:scroll;
scrollbar-shadow-color: #ffffff;
scrollbar-highlight-color: #ffffff;
scrollbar-face-color: #d9d9d9;
scrollbar-3dlight-color: #d9d9d9;
scrollbar-darkshadow-color: #d9d9d9;
scrollbar-track-color: #ffffff;
scrollbar-arrow-color: #f30
}
.CloseDiv{
float:right;
color:#fff;
text-decoration:none;
margin-right:20px;
width:100px;
text-align:right;
}
.CloseDiv a{ color:#000; text-decoration:none}
.LCnormaltab{ background:#000;display:block; color:#fff;}
.LChovertab{ background:#fff; color:#000;display:block;}
.LCdis{display:block;}
.LCundis{display:none;}
</style>
</head>
<body>
<a id="togglecity2" href="#">点击我2</a>   
<div id="citycont2" style="display:none;">
<div id="clearcity1" onclick='city_clearDiv()' class="CloseDiv"><a  href="#">关闭</a></div>
    <div class="CityBox">
    <div class="heading">
         <h3>把豆单贴到我的博客或BBS</h3><div id="clearcity2" onclick='city_clearDiv()' class="CloseDiv"><a  href="#">关掉我</a>
</div>
<div class="container">
<table>
<tr><th>HTML代码:</th><td><input keyid="2" value='<embed src="http://www.tudou.com/l/l7nGwGo-SAA" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="480" height="400"></embed>' id="clipHTML" size="53" class="text"/></td><td><input type="button" keyid="3" class="submit" value="复制" /></td></tr>
<tr><th></th><td colspan="2">贴到 <em>MSN space</em>、<em>新浪博客</em></td></tr>
<tr><th>FLASH代码:</th><td><input keyid="7" value="http://www.tudou.com/l/l7nGwGo-SAA" id="clipPlayer" size="53" class="text"/></td><td><input keyid="8" type="button" class="submit" value="复制" /></td></tr>
<tr><th></th><td colspan="2">贴到 <em>Blogbus</em>、<em>51.com</em>、<em>搜狐</em>、<em>网易</em>、<em>QQ日志</em>、<em>pcpop</em>、<em>I贴吧</em></td></tr>
<tr><th>播放页地址:</th><td><input keyid="4" value="http://www.tudou.com/playlist/playindex.do?lid=10485639" id="clipURL" size="53" class="text"/></td><td><input keyid="5" type="button" class="submit" value="复制" /></td></tr>
<tr><th></th><td colspan="2">贴到 <em>开心</em>、<em>人人</em>、<em>豆瓣</em>、<em>QQ空间</em>、<em>白社会</em>、<em>新浪微博</em>、<em>百度空间</em></td></tr>
</table>
</div>
    </div>
</div>
<script type="text/javascript">
//控制弹出层的ID ,数字为改变弹出层的DIV
toggleCity("togglecity2","citycont2","clearcity2",600,400);
//---------------------主要部分------------------------------
  //activeObj:触发时间的元素id
  //contObj:要显示内容的id
  //clearObj:清除显示层的id
  //newDivWidth:显示层的宽度
  //newDivHeight:显示层的高度
function toggleCity(activeObj,contObj,clearObj,newDivWidth,newDivHeight){
var ocity=document.getElementById(activeObj);
var citycont=document.getElementById(contObj);
var oclearcity=document.getElementById(clearObj);
ocity.onclick=function(){findselect();city_createDiv(citycont,newDivWidth,newDivHeight);}
}
function findselect(){//查找并隐藏select
var oselect=document.getElementsByTagName("select");
if(oselect.length>0){
  for(var i=0;i<oselect.length;i++){
   oselect.style.display="none";
  }
}
}
function showselect(){//显示select
var oselect=document.getElementsByTagName("select");
if(oselect.length>0){
  for(var i=0;i<oselect.length;i++){
   if(oselect.style.display=="none"){
    oselect.style.display="inline";
   }
  }
}
}
function owinWidth(){//当前窗口的width
  var winWidth;
  if (window.innerWidth){
      winWidth = window.innerWidth;
  }
     else if ((document.body) && (document.body.clientWidth)){
      winWidth = document.body.clientWidth;
  }
     if (document.documentElement  && document.documentElement.clientWidth){
      winWidth = document.documentElement.clientWidth;
  }
  return winWidth;
}
function owinHeight(){//当前窗口的height
  var winHeight;
  if (window.innerHeight){
      winHeight = window.innerHeight
  }else if ((document.body) && (document.body.clientHeight)){
      winHeight = document.body.clientHeight
  }
  if (document.documentElement  && document.documentElement.clientHeight){
      winHeight = document.documentElement.clientHeight;
  }
  return winHeight;
}
function city_createDiv(pinner,newDivWidth,newDivHeight){//创建背景
var obody=document.body;
document.documentElement.style.overflowY="auto";
document.documentElement.style.overflowX="hidden";
var newDiv=document.createElement("div");
newDiv.id="bgdiv";

var winWidth=owinWidth();
var winHeight=owinHeight();
if(obody.offsetWidth>winWidth){
  newDiv.style.width=obody.offsetWidth+"px";
}else{
  newDiv.style.width=winWidth+'px';
}
if(obody.offsetHeight>winHeight){
  newDiv.style.height=obody.offsetHeight+"px";
}else{
  newDiv.style.height=winHeight+'px';
}
newDiv.style.background="#000";
newDiv.style.position="absolute";
if(typeof(newDiv.style.filter)=="string"){
  newDiv.style.filter="alpha(opacity=60)";
}else{
  newDiv.style.opacity="0.3";
}
newDiv.style.top=0;
newDiv.style.left=0;
var newP=city_createP(winWidth,winHeight,newDivWidth,newDivHeight);
if(pinner){
newP.innerHTML=pinner.innerHTML;
}
obody.appendChild(newDiv);
obody.appendChild(newP);
}
function city_createP(winWidth,winHeight,newDivWidth,newDivHeight){//创建显示层
var obody=document.body;
var newP=document.createElement("div");
newP.id="contdiv";
newP.className="book_new_p";
newP.style.width=newDivWidth+"px";
newP.style.height=newDivHeight+"px";
newP.style.position="absolute";
//newP.style.background="#fff";
newP.style.top=(winHeight-newDivHeight)/2+"px";
newP.style.left=(winWidth-newDivWidth)/2+"px";
return newP;
}
function city_clearDiv(){//清除生成背景和容器层
var bgd=document.getElementById("bgdiv");
var contd=document.getElementById("contdiv");
document.body.removeChild(contd);
document.body.removeChild(bgd);
document.documentElement.style.overflowY="auto";
showselect();
}
</script>
</body>
</html>
回复

使用道具 举报

lansfb 发表于 2010-10-18 20:26:01 | 显示全部楼层
请问怎么直接调用HTML文件 14#版主的方法不行!
回复

使用道具 举报

cr180 发表于 2010-10-18 20:31:14 | 显示全部楼层
本帖最后由 cr180 于 2010-10-18 20:31 编辑

回复 lansfb 的帖子

<A class=fastre
href="forum.php?mod=viewthread&tid=271&extra=page%3D1">回复</A>


试试吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-2 12:09 , Processed in 0.096414 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表