Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I load an external page in a jQuery overlay popup?

I'm trying to make a jQuery overlay load an external page.

I think I'm having two versions of jquery conflicting with each other, as I'm using this for a drag and drop and it works fine:

src="js/jquery-1.3.2.min.js

js/jquery-ui-1.7.2.custom.min.js 

Now when I add this:

http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js

for the overlay it doesn't seem to work. Does anyone have a simple overlay with external page?

like image 831
avorhom Avatar asked Feb 10 '10 17:02

avorhom


2 Answers

But why you are not using Fancybox or more better colorbox here is the link

http://colorpowered.com/colorbox/

Colorbox is light have cool effect just give it a try, and you can theme it as it is css-based.

Thanks

like image 105
Shakeeb Ahmed Avatar answered Sep 22 '22 12:09

Shakeeb Ahmed


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>

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;
 }

JS

$("a#selector").live("click", function(){
    $(".overlayInner").load("externalPage.html",
       // the following is the callback   
      function(){$(".overlayOuter").fadeIn(300); })
});
like image 32
adardesign Avatar answered Sep 23 '22 12:09

adardesign