Jquery Fancybox行为异常?
我在我的网站上使用fancybox,效果很好。我实际上是在打开一个fancybox,当它打开时,我有一个链接来打开第二个fancybox。当我点击这个链接时,它会打开第二个fancybox,这很好 第二个fancybox的问题是,当我最小化web浏览器并尝试滚动到窗口以查看fancybox的最后一行时。现在fancybox自动跳转到中心的痛苦来了,滚动窗口没有任何好处 如果我最小化第一个fancybox的web浏览器,那么就不会有这样的问题,但是第二个fancybox就有这样的问题。为何会出现这个问题 这是我的密码:Jquery Fancybox行为异常?,jquery,fancybox,Jquery,Fancybox,我在我的网站上使用fancybox,效果很好。我实际上是在打开一个fancybox,当它打开时,我有一个链接来打开第二个fancybox。当我点击这个链接时,它会打开第二个fancybox,这很好 第二个fancybox的问题是,当我最小化web浏览器并尝试滚动到窗口以查看fancybox的最后一行时。现在fancybox自动跳转到中心的痛苦来了,滚动窗口没有任何好处 如果我最小化第一个fancybox的web浏览器,那么就不会有这样的问题,但是第二个fancybox就有这样的问题。为何会出现这
<head>
<style>
</style>
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script> -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<link rel="stylesheet" href="css/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.fancybox.pack.js?v=2.1.5"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".fancybox").fancybox({
loop : false,
maWidth : 500,
maxHeight : 500,
minWidth : 500,
minHeight : 500,
autoPlay :false,
fitToView : true,
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'none',
nextEffect : 'none',
afterLoad: function() {
this.title += '<div style="background-color:;width:100%;float:left;"><div style="background-color:;width:40%;float:left;>fdfdg</div><div style="background-color:;width:40%;float:left; onclick="secondfb();"><button>link to another fancybox</button></div></div>';
this.title +='</br>';
},
helpers : {
title: {
type: 'inside'
},
}
});
});
function secondfb()
{
$("#vik").fancybox({
loop : false,
maWidth : 500,
maxHeight : 500,
minWidth : 500,
minHeight : 500,
autoPlay :false,
fitToView : true,
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'none',
nextEffect : 'none',
afterLoad: function() {
this.inner.prepend( '<div id="emaildiv"><form id="emailform" method="POST" onsubmit="checkemailform(this);return false;"><div><img src="/images/RentCan.png" height="92px" width="160px" alt="bccondos.net" border="0" style="max-width: 160px;height: auto;"/></br></div><fieldset style=""><div style="width:30%;min-height:100px;float:left;"> First Name <input type="text"name="fname" id="fname" readonly value=""style="width:250px;"></input></span> Last Name <input type="text" name="lname" id="lname" readonly value="" style="width:250px;"></input> Email <input type="text" style="width:250px;"id="email" readonly value="" name="email"></input>Phone Number<span style="color:red;">*</span><input type="text" style="width:250px;"id="phoneno" name="phoneno"></input></div><div style="width:40%;min-height:100px;float:right;margin-right:5%; ">Comment<textarea style="min-height:150px;width:250px;" id="rentcanformfeedback" name="rentcanformfeedback"></textarea></div></fieldset><div style="width:100%;float:left;;"><fieldset><span class="fl_n"><center><img id="captcha" src="/securimage/securimage/securimage_show.php" alt="CAPTCHA Image" /></center><hr>Enter the code above here:<input type="text" name="captcha_code" id="captcha_code" size="10" maxlength="6" /><span id="captchamsg" style="display:none;color:red;">Above Code not matched Please Try Again!</span> Cannot read the image click <a href="#" onclick="captcha_changeimg()"><b> HERE </b></a>to refresh</span> </fieldset><fieldset><input type="checkbox" name="choices" id="ii" value="ii" >I am interested in this listing and other similar listings<span style="color:red;">*</span><br><p style="margin-left:20px;">Please describe yourself (Choose one)<span style="color:red;">*</span></p><input type="radio" name="choices" id="hmfr" value="hmfr">Help me find a rental.<br><input type="radio" name="choices" id="iwai" value="iwai">I want additional information.<br><input type="radio" name="choices" id="ijc" value="ijc" >I am just curious.<br><input type="radio" name="choices" id="iwpr" value="iwpr">I want to post a rental.<br><br><input type="checkbox" name="cbox12" value="confirmation" id="cbox12"> I confirm that the information I have provided is true and correct and acknowledge that management will suspend my account if my information is found to be false. Click here for our <a href="/Privacy_Policy_Rentcan.html" target="_blank">Privacy Policy</a>. <span style="color:red;">*</span></fieldset></br><input type="submit" value="Send" ></input><br><br></div></form></div>');
this.title +='</br>';
},
helpers : {
title: {
type: 'inside'
},
}
}).trigger('click');
}
</script>
</head>
<html>
<a rel="group" class="fancybox" caption="This is 1st caption" href="images/img1.jpg" ><img src="images/img1_thumb.jpg" alt="image1"/></a>
<a rel="group" caption="This is 1st caption2"class="fancybox" href="images/img2.jpg"><img src="images/img2_thumb.jpg" alt="image2"/></a>
<div id="vik"></div>
</html>
$(文档).ready(函数(){
$(“.fancybox”).fancybox({
循环:false,
最大宽度:500,
最大高度:500,
最小宽度:500,
身高:500,
自动播放:错误,
菲托维:没错,
自动调整大小:false,
closeClick:false,
openEffect:'无',
closeEffect:'无',
效果:“无”,
下一个效果:“无”,
后加载:函数(){
this.title+=“链接到另一个fancybox”;
this.title+='';
},
助手:{
标题:{
类型:“内部”
},
}
});
});
函数secondfb()
{
美元(“#vik”)。fancybox({
循环:false,
最大宽度:500,
最大高度:500,
最小宽度:500,
身高:500,
自动播放:错误,
菲托维:没错,
自动调整大小:false,
closeClick:false,
openEffect:'无',
closeEffect:'无',
效果:“无”,
下一个效果:“无”,
后加载:函数(){
this.internal.prepend(“名字姓氏电子邮件电话号码*注释
在此处输入上面的代码:上面的代码不匹配请重试!无法读取图像单击刷新我对此列表和其他类似列表感兴趣*
请描述自己(选择一个)*帮我找到租车信息。
我需要更多信息。
我只是好奇。
我想发布租车信息。
我确认我提供的信息真实无误,并确认如果发现我的信息不实,管理层将暂停我的帐户。单击此处查看我们的信息。*
;
this.title+='';
},
助手:{
标题:{
类型:“内部”
},
}
}).trigger('click');
}
向我们展示一些基本代码,以便我们能帮助您。请看下面我的代码。看起来里面有很多不必要的代码。阅读本文的任何人只看到与问题相关的代码都是有益的。