当前位置:编程学习 > JAVA >>

jquery弹出注册框,同样的东西,为什么相差很大

http://www.oreevogue.com/1.html

两个同样元素,点击“我要评论”,两个按钮一样,为什么有不同的显示,希望jquery高手来帮帮忙解答

应用http://www.oreevogue.com/oree/buy/ jquery 应用 --------------------编程问答-------------------- --------------------编程问答-------------------- 不要只点头嘛,帮我看看 --------------------编程问答-------------------- 可能由于1.html和234.html内部代码不同引起的。 --------------------编程问答-------------------- 我在本地调用好像是可以的 --------------------编程问答-------------------- 因为href后面的地址不一样啊。 --------------------编程问答-------------------- 不明白同样的同学是什么意思,他们两个的链接都是不一样的,为什么是同样的东西呢?, --------------------编程问答-------------------- 【授人以渔不如授人以渔干】


首先F12看源代码:

<!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=utf-8" />
<title>一流素材网-用于弹出登录框的JQuery弹出浮动层</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/thickbox_plus.js"></script>
<link rel="stylesheet" type="text/css" href="css/thickbox.css"/>
</head>
<body>
<span><a href="images/234.html?height=160;width=400" title="应聘该职位并投递简历" class="pl" >我要评论</a></span>
<span><a href="oree/buy/2013-09-14/1.html?height=300;width=400" title="应聘该职位并投递简历" class="pl" >我要评论</a></span>

</body>
<!--一流素材网收藏整理:www.16sucai.com-->
</html>




他不是有两个链接吗,点击第一个进去(第二个貌似失效了)


<!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=utf-8" />
<title>无标题文档</title>
</head>
<style type="text/css">
*{margin:0px;border:0px;padding:0px;}
body{font:12px "宋体";}
a{color:#000;text-decoration:none;}
a:hover{color:#F30;text-decoration:underline;}
input{padding:0px;margin:0px;}
.txtbox{border:1px solid #E79F50;height:20px;line-height:22px;width:120px;}
.bfont{font:700 12px "宋体"};
#login{width:400px;height:100%;overflow:hidden;margin:0px auto;}
#title{width:400px;height:25px;line-height:25px;color:#F60;font-weight:700;background-color:#FDEBD9;text-align:center;margin:0px auto;}
#loginbox{width:185px;height:60px;margin:10px 20px;float:left;display:inline;}
#btnlogin{width:55px;height:60px;float:right;margin:10px 30px 10px 5px;}
#forget{width:200px;margin:0px auto;height:25px;line-height:25px;text-align:center;}
#forget span{width:80px;display:inline;margin:0px 10px;}
</style>
<body>
<div id="login">
<div id="title">个人登录后才能投递简历,没有注册请先注册成为个人会员。</div>
    <div style="width:320px;height:80px;margin:0px auto;">
        <table  border="0">
      <tr>
        <td align="left">[!--picsay--]</td>
      </tr>
      <tr>
        <td align="left">[!--temp.pl--]</td>
      </tr>
    </table>
 <!--一流素材网收藏整理:www.16sucai.com-->
</div>
</body>
</html>



剩下的你自己看看去~~~~~ --------------------编程问答-------------------- 这个不是很清楚 --------------------编程问答--------------------

function TB_show(caption, url) { //function called when the user clicks on a thickbox link
try {
jQuery("body")
.append("<div id='TB_overlay'></div><div id='TB_window'></div>");
jQuery("#TB_overlay").css("opacity","0.6");
jQuery("#TB_overlay").css("filter","alpha(opacity=60)");
jQuery("#TB_overlay").css("-moz-opacity","0.6");
jQuery(window).resize(TB_position);
jQuery("body").append("<div id='TB_load'><div id='TB_loadContent'><img src='images/circle_animation.gif' /></div></div>");
jQuery("#TB_overlay").show();
var urlString = /.jpg|.jpeg|.png|.gif|.html|.htm/g;
var urlType = url.match(urlString);

if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif'){//code to show images

var imgPreloader = new Image();
imgPreloader.onload = function(){

// Resizing large images added by Christian Montoya
var de = document.documentElement;
var x = (self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth) - 50;
var y = (self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight) - 80;
if(imgPreloader.width > x) { 
imgPreloader.height = imgPreloader.height * (x/imgPreloader.width); 
imgPreloader.width = x; 
if(imgPreloader.height > y) { 
imgPreloader.width = imgPreloader.width * (y/imgPreloader.height); 
imgPreloader.height = y; 
}

else if(imgPreloader.height > y) { 
imgPreloader.width = imgPreloader.width * (y/imgPreloader.height); 
imgPreloader.height = y; 
if(imgPreloader.width > x) { 
imgPreloader.height = imgPreloader.height * (x/imgPreloader.width); 
imgPreloader.width = x;
}
}
// End Resizing

TB_WIDTH = imgPreloader.width + 30;
TB_HEIGHT = imgPreloader.height + 60;
jQuery("#TB_window").append("<img id='TB_Image' src='"+url+"' width='"+imgPreloader.width+"' height='"+imgPreloader.height+"' alt='"+caption+"'/>"+ "<div id='TB_caption'>"+caption+"</div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton'>关闭</a></div>"); 
jQuery("#TB_closeWindowButton").click(TB_remove);
jQuery("#TB_Image").click(TB_remove); // close when image clicked added by Christian Montoya
TB_position();
jQuery("#TB_load").remove();
jQuery("#TB_window").slideDown("normal");
}
  
imgPreloader.src = url;
}

if(urlType == '.htm' || urlType == '.html'){//code to show html pages

var queryString = url.replace(/^[^\?]+\??/,'');
var params = parseQuery( queryString );

TB_WIDTH = (params['width']*1) + 30;
TB_HEIGHT = (params['height']*1) + 40;
ajaxContentW = TB_WIDTH - 30;
ajaxContentH = TB_HEIGHT - 45;
jQuery("#TB_window").append("<div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>关闭</a></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
jQuery("#TB_closeWindowButton").click(TB_remove);
jQuery("#TB_ajaxContent").load(url, function(){
TB_position();
jQuery("#TB_load").remove();
jQuery("#TB_window").slideDown("normal");
});
}

} catch(e) {
alert( e );
}
}

注意这段代码的UrlType变量,你的这个程序就是根据这个来判断的,如果你是图片类型(png/jpg/jpeg/gif)的话就是第一个类型,如果你是htm/html则是第二个。还有这个的加载是通过ajax来完成的
ajax的加载通过Chrome或者是Firebug很空易就看出来了
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,