Jump to content

website "pop ups"


Recommended Posts

Does anyone know how websites achieve the "pop ups" where the content appears in the middle above everything, and the rest of the website is dimmed? It seems to be an implementation of CSS or Javascript (aka AJAX), but I can't figure out what they do...

 

For example, http://www.newgrounds.com/ uses this when you try to view a video - http://www.newgrounds.com/portal/view/402467. Click on "Watch this Video," and you'll see that the new video pops up.

 

Anyone know how to do this?

Link to comment
Share on other sites

  • 1 month later...

Get Google Toolbar It Helps Alot With PopUp's Or Go With Firefox It Contains A Google Toolbar :)

Link to comment
Share on other sites

  • 3 weeks later...
He isn't interested in blocking them but making them!

If anyone knows or finds out please post it here because I also am interested in how they do this!

I guess it's a JavaScript in an external file ( <script src="url">), then a div is created (AppendNode), the new div gets a high z-index so it's at top of the page.

How they blend the rest of the page I still have to find out.

Link to comment
Share on other sites

  • 2 weeks later...

CSS used to hide everything, second one is for FireFox and Mac, first for all others

#overlayblackout {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 90;
    background-color: #000;
    filter:alpha(opacity=70);
    -moz-opacity: 0.7;
    opacity: 0.7; }

#overlayblackout_ffmac {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 90; }

 

JS used to add div tag

// Set up our background and append it to the body.
ourbody = document.getElementsByTagName("body").item(0);
pbackground = document.createElement("div");

if(!(IsFirefoxMac()))
{
    pbackground.setAttribute("id", movie_viewer.BACKGROUND_DIV);
}
else
{
    // Mac Firefox can't handle opacity stuff, so let's do a workaround.
    movie_viewer.BACKGROUND_DIV = "overlayblackout_ffmac";
    pbackground.setAttribute("id", movie_viewer.BACKGROUND_DIV);
    pbackground.style.backgroundImage = "url(http://img.ngfiles.com/blackbox.png)";
    pbackground.style.backgroundRepeat = "repeat";
}
pbackground.style.display = 'none';
ourbody.appendChild(pbackground);

 

I hope this helps.

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...