tags:

views:

124

answers:

3

I want to create a POP up box on a site i am working on, i like the pop up box facebook and linked in have, how do i create it? is there a code or something?

Can anyone help me?

A: 

I would go for JQuery + a dialog plugin.

Here is one example

You also have the JQuery Dialog implementation

Am
A: 

Check out facebox. It's very easy to use and provides a similar look and feel. It's a jQuery plugin with more information available at the jQuery plugins site if needed.

Brian Hasden
+2  A: 

Facebox - as mentioned above - will allow you to do this.

To expand a little further, pop up dialogs as you described are created using javascript.

The process you're most likely looking for is that you set up a link element, pointing to the content you would like to display in the dialog. Notice the rel="facebox" attribute - this is how we'll know to open this link in a popup.

<a href="remote.html" rel="facebox">text</a>

You then include the javascript plugin (and needed files, like the jQuery library and plugin css files) to provide the popup function. This should be done in the <head> of your page.

<script src="jquery.js" type="text/javascript"></script>
<link href="/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="/facebox/facebox.js" type="text/javascript"></script>

Now you need to set the popup function to be applied to the link - the following should be applied in the <head> section after the above links, or in a separate file. This snippet tells all links with rel="facebox" to open in a popup.

<script type="text/javascript">
$(document).ready(function(){
    jQuery(document).ready(function($) {
        $('a[rel*=facebox]').facebox();
    });                        
});
</script>
Alex Osborn