jqModal 和广告库
这简直让我发疯。我正在尝试 jqModal 与 jquery.ad-gallery 一起工作。这是我到目前为止所拥有的:
<link rel="stylesheet" type="text/css" href="css/jqModal.css">
<link rel="stylesheet" type="text/css" href="css/jquery.ad-gallery.css">
<script type="text/javascript" src="javascript/jquery-1.4.js"></script>
<script type="text/javascript" src="javascript/jquery.ad-gallery.js" ></script>
<script type="text/javascript" src="javascript/jqModal.js" ></script>
<script>
$().ready(function() {
$('#jqmPix').jqm({modal:true});
showPix = function(bhiid,projNum) {
$.ajax({
type: "get",
url: "<cfoutput>#actURL#</cfoutput>",
cache: false,
success: function(result) {
$('#jqmPixTitle').html('Photos for : '+projNum);
$('#jqmPixText').html(result);
$('#jqmPix').jqmShow().css('left',getTopLeftPt('#jqmPix')).css('top',getTop('#jqmPix'));
},
error: function(xmlHttpRequest, status, err) {
confirm('Error!' + err );
}
});
}
getTopLeftPt = function(a){
var leftPt = parseInt($(window).width()/2)-parseInt($(a).width()/2);
//alert(leftPt);
return leftPt;
}
getTop = function(a){
var topPt = parseInt($(window).height()/4-50);
//alert(topPt);
return topPt;
}
});
</script>
<input type="button" name="clicky" id="clicky" value="clicky" onclick="showPix(40852,'RE5540T09608B')"/>
<div id="jqmPix" class="jqmWindow" style="width:690px; display:none;">
<div class="jqmHeader" >
<div id="jqmPixTitle"></div>
<div id="jqmHeaderClose" >
<img src="images/vista-close.gif" class="jqmClose" alt="close" />
</div>
<div style="clear:both;"></div>
</div>
<div class="jqmBody">
<div id="jqmPixText" align="center">
</div>
<div style="clear:both;"></div>
</div>
<div class="jqmFooter jqmFooterButtons" id="jqmFooterText">
</div>
我看到模式窗口、图像容器下方的导航,但主图像丢失。 IT 只是不显示。
有趣的是,如果我直接访问 ajax url,一切都工作得很好。一个技巧是,当我直接点击 ajax url 时,我必须传递一个 url 变量并检查它是否存在。如果存在,那么我将包括 .否则,firebug 会在调用页面上的 jqmShow() 上抛出错误。
有人可以帮助我吗?
提前致谢。
This is just driving me nuts. I am trying jqModal work with jquery.ad-gallery. This is what I have so far:
<link rel="stylesheet" type="text/css" href="css/jqModal.css">
<link rel="stylesheet" type="text/css" href="css/jquery.ad-gallery.css">
<script type="text/javascript" src="javascript/jquery-1.4.js"></script>
<script type="text/javascript" src="javascript/jquery.ad-gallery.js" ></script>
<script type="text/javascript" src="javascript/jqModal.js" ></script>
<script>
$().ready(function() {
$('#jqmPix').jqm({modal:true});
showPix = function(bhiid,projNum) {
$.ajax({
type: "get",
url: "<cfoutput>#actURL#</cfoutput>",
cache: false,
success: function(result) {
$('#jqmPixTitle').html('Photos for : '+projNum);
$('#jqmPixText').html(result);
$('#jqmPix').jqmShow().css('left',getTopLeftPt('#jqmPix')).css('top',getTop('#jqmPix'));
},
error: function(xmlHttpRequest, status, err) {
confirm('Error!' + err );
}
});
}
getTopLeftPt = function(a){
var leftPt = parseInt($(window).width()/2)-parseInt($(a).width()/2);
//alert(leftPt);
return leftPt;
}
getTop = function(a){
var topPt = parseInt($(window).height()/4-50);
//alert(topPt);
return topPt;
}
});
</script>
<input type="button" name="clicky" id="clicky" value="clicky" onclick="showPix(40852,'RE5540T09608B')"/>
<div id="jqmPix" class="jqmWindow" style="width:690px; display:none;">
<div class="jqmHeader" >
<div id="jqmPixTitle"></div>
<div id="jqmHeaderClose" >
<img src="images/vista-close.gif" class="jqmClose" alt="close" />
</div>
<div style="clear:both;"></div>
</div>
<div class="jqmBody">
<div id="jqmPixText" align="center">
</div>
<div style="clear:both;"></div>
</div>
<div class="jqmFooter jqmFooterButtons" id="jqmFooterText">
</div>
I see the modal window, the navigation underneath the image container but the main image is missing. IT just doesn't display.
The funny thing is if I go to the ajax url directly, everything works perfectly fine. One trick is that i have to pass a url variable and check for its existence when i hit the ajax url directly. If it exists, then i include . Otherwise, firebug throws an error on jqmShow() on the calling page.
can anybody help me?
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它与 jquery.ad-gallery.css 中的 .ad-image 定义和/或 jquery.ad-gallery.css 中的 _showWhenLoaded 函数有关。我发现了另一个名为 Galleria 的插件。我遇到一个问题,我必须使用以下命令刷新主页:parent.location.reload(1);
否则,当您重新打开 jqmodal 窗口时,它会进入无限循环。无论如何,希望这对其他人有帮助。
It has something to do with .ad-image definition in jquery.ad-gallery.css and/or _showWhenLoaded function in jquery.ad-gallery.css. I found another plug-in called galleria. I had one problem where I have to refresh the main page with : parent.location.reload(1);
Otherwise, it goes into an endless loop when you reopen the jqmodal window. Anyway, hope this helps to someone else.