Facebox is really an awesome creation using jQuery. it can be used for many purposes such such as displaying images in a fancy or cool manure . we have covered many Facebook Tips and Tricks.its really an awesome creation.Facebox is a lightweight Facebook-style lightbox which can display images, divs, or entire remote pages (via Ajax) inline on the page and on demand. It uses the compact jQuery library as its engine, unlike Lightbox v2.0, which uses Prototype.
Facebox consists of 2 .js files, 1 .css file and some images that make up its interface (such as round corner images). I have zipped the files together.
Click here to download the files
Download these files and upload to your server or any hosting or google account. After Downloading these files edit Facebox.css as per you blog requirement( If you don’t know how to do it, then ask me!!) and replace image sources of images(i.e. b.png, bl.png, br.png, tl.png and tr.png). Now, replace image sources in Facebox.js (i.e. closelabel.gif and loading.gif).
Are you confused?? If yes then leave a comment, i will explain you how to replace image sources.
Now, follow these steps:
- Go to Layout section and then open Edit html. Click on Download Full Template to take the backup of your current template(don’t miss this, else things may go haywire!!). Now, Check the box to Expand Widget Templates. Insert the following code in the Head Section. I would Suggest you to paste the code just above .
<script src=’‘ type=’text/javascript’/><link href=’‘ media=’screen’ rel=’stylesheet’ type=’text/css’/><script src=’‘ type=’text/javascript’/><script type=’text/javascript’> jQueryundefineddocument).readyundefinedfunctionundefined$) { $undefined’a[rel*=facebox]’).faceboxundefined) })</script><style type=’text/css’>.thickstyle{background: silver;}</style> Change the web address in red, if you have uploaded above files on your server or googlepage and Save the Template.
- Now its the time to explain how and where to use Facebox.
- Display an image using Facebox: If you want to display images using facebox, use the following code:
<p><a href=”http://3.bp.blogspot.com/_nX0wvumD9VU/S81K21P3STI/AAAAAAAAAao/p66UQf6Qhgo/s1600/logo.png” rel=”facebox”> Best 2 know</a></p> Result of the above Code :
Click on the above link for results.
If you are using this scrip in a menu then, remove <p></p>
- FaceBox used to display an inline DIV: This is the most useful code. It can be used to display text notes, announcement, disclaimer, contact form and so on… In this case a link is placed on your blog and when you click on that link, the pop up (like facebook) appears.
<p><a href=”#mydiv” rel=”facebox”>View DIV with id=”mydiv” on the page</a></p><div id=”mydiv” style=”display:none”>This is the contents of a hidden DIV on the blog, with ID=”mydiv” and style set to “display:none” <br /><a href=”http://www.dynamicdrive.com”>Dynamic Drive</a></div> The Result of the above code :
View DIV with id=”mydiv” on the page
Click on the above link and see the result.
- FaceBox used to display an external page, plus apply a CSS class to the container (to further style it): It is like previous one only, but with more styling is added to the pop up.
<style type=”text/css”>.thickstyle{background: silver;}</style>”<p><a href=”http://www.best2know.info/2006/04/contact-us.html” rel=”facebox[.thickstyle]”>View “Contact Us page” fetched via Ajax, further styled with “.thickstyle” CSS class</a></p> The Result for above code :
”
View “Contact Us page” fetched via Ajax, further styled with “.thickstyle” CSS class
Click the above link for result.
If it the pop up does not appear after following these steps.. reload the page twice and check again. Remove <p></p> and check, it should work.
Note: Set href attribute to point to either an image, the ID of a hidden DIV, or a URL to the page on your blog only. Do not point it to any external link. It will not Work, if you do so.
- Display an image using Facebox: If you want to display images using facebox, use the following code:
so did you like it? Any doubts or questions? Leave a comment, i will surely help you…
Z says
dude, it didnt work at the slightest, it just redirected me to a differend page
Ritesh Sanap says
Its because the blogservices.in host is down and the scripts are not loading for that I m sorry , you can get all those scripts and then host it.