Download
User Rating: 0/5 ( 0 votes)
FBModal is a jQuery plugin that is the first Facebook replica modal dialog.
BROWSER COMPATIBILITY
FBModal has been tested in the following browsers
-
Firefox Version 2-26
-
Opera Version 9-18
-
Safari Version 3-7
-
Chrome Version 1-31
Source: rrpowered.com
1. INCLUDE JS AND CSS FILES
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.fbmodel.js"></script>
<link rel="stylesheet" type="text/css" href="fbmodal.css" />
2. HTML
<a href="javascript:void()" id="open">Modal 1</a>
<div class="test">
FBModal the first FaceBook replica dialog<br/>
<a href="javascript: vaoid()" id="close">Close this dialog</a>
</div>
3. JAVASCRIPT
$("#open").click( function(){
$(".test").fbmodal({
title: "FaceBook Modal Demo",
cancel: "Cancel",
okay: "Okay",
okaybutton: true,
cancelbutton: true,
buttons: true,
opacity: 0.0,
fadeout: true,
overlayclose: true,
modaltop: "30%",
modalwidth: "400"
});
});
4. OPTIONS
-
title [Text]: Dialog title text
-
cancel [Text]: Cancel button text
-
okay [Text]: Okay button text
-
okaybutton [Boolean:true]: Show the ok button
-
cancelbutton [Boolean:true]: Show the cancel button
-
buttons [Boolean:true]: Show the buttons
-
opacity [Number]: The opacity value for the overlay div, from 0.0 – 100.0
-
fadeout [Boolean:true]: When dialog is closed fade out
-
overlayclose [Boolean:true]: Allow click on overlay to close the dialog?
-
modeltop [Number:null]: Position from top of page 0% – 100% or 0px – 99999px
-
modelwidth [Number:null]: The width for the dialog container
5. CLOSING THE DIALOG
Now to close the dialog. Set your element id. Your element id is the id of the content inside of the dialog. Next set the
option close to true.
$("#your-element-id").fbmodal({close:true});