我正在尝试使jQuery叠加加载外部页面.
我想我有两个版本的jquery相互冲突,因为我用它来拖放它并且它工作正常:
src="js/jquery-1.3.2.min.js
js/jquery-ui-1.7.2.custom.min.js
Run Code Online (Sandbox Code Playgroud)
现在当我添加这个:
http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js
Run Code Online (Sandbox Code Playgroud)
对于叠加它似乎不起作用.有没有人与外部页面有简单的叠加?
但是为什么你没有在这里使用Fancybox或更好的彩盒是链接
http://colorpowered.com/colorbox/
Colorbox很轻,有很酷的效果,试试吧,你可以将它作为主题,因为它是基于CSS的.
谢谢
HTML
<a id="selector" href="#">My event trigger</a>
<!-- put the the overlay below before closing </body> the end of the page -->
<div class="overlayOuter">
<div class="overlayInner">
<!-- external content to be loaded here -->
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.overlayOuter{
background:#000;
opacity:0.7;
display:none;
height:100%;
left:0;
position:absolute;
top:0;
width:100%;
z-index:100001;
}
.overlayInner{
position:absolute;
top:40%;/*or whatever*/
left:40% /*or whatever*/
width:500px;
z-index:100001;
}
Run Code Online (Sandbox Code Playgroud)
JS
$("a#selector").live("click", function(){
$(".overlayInner").load("externalPage.html",
// the following is the callback
function(){$(".overlayOuter").fadeIn(300); })
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
47281 次 |
| 最近记录: |