Build Online Store! | Penguin Panda Series - New! | 4 Rules To Make Money | SEO Settings | Facebook Popup 1, 2, 3 | Mashable 1 , 2


Wednesday, January 4, 2012

jQuery Popup For Facebook LikeBox


Pin It
Update: Version 2 has been released. Please find it here: Facebook Likebox popup V2

jquery popup facebook likeboxThis widget pops up a jQuery window containing Facebook likebox as soon as a new visitor arrives. This plugin can be added to both Blogger Blogs and Wordpress. I am using here the same jQuery effect introduced by sidhart in JQuery Popup Just Like Aweber Subscription Form. Lightbox effects like this one can be widely seen on many blogs now. It will help you increase your Facebook Fans greatly and our previous version will surely increase the number of your RSS subscribers. In my next tutorials I will make sure to make it more interactive with social media links and a complete version with everything you may need.

I will not be providing a DEMO for this because you can try it live in our HTML Editor to see how it works.

Tip: Copy the code given in step#4 and paste it inside this editor.


Try it now!

How it works?

This popup appears only once to every new visitor. The ip address of the visitor is stored in browser cookie and as the page loads again the widget wont be called again for the same visitor thus eliminating the chances of bugging regular readers. Because of course it will look weird if the popup appears again and again on every pageview. It will appear both on homepage and sub pages depending which page the visitor is accessing. I have set the cookie refresh time to 30 days, which means that this lightbox will appear again for the same visitor after 30 days. We can easily set the number of days to prompt the visitors about your Facebook Fan page. Lets get straight to the one step installation process.

Add Facebook LikeBox inside Jquery Popup in Blogger

I am discussing here steps for blogger but if you know how to deal simple HTML code then you can easily add it to your wordpress blog too.

  1. Go To Blogger > Design
  2. Click choose a gadget
  3. Select HTML/javascript widget
  4. Paste the following code inside it

<style>

/*
   ColorBox Core Style:
   The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
/*


   User Style:
   Change the following styles to modify the appearance of ColorBox.  They are
   ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay{background:#000;opacity:0.5 !important;}
#colorbox{
        box-shadow:0 0 15px rgba(0,0,0,0.4);
       -moz-box-shadow:0 0 15px rgba(0,0,0,0.4);
        -webkit-box-shadow:0 0 15px rgba(0,0,0,0.4);
       }
  

#cboxTopLeft{width:14px; height:14px; background:url(http://4.bp.blogspot.com/-_VSGGUcsUPE/TwNIXL6W2qI/AAAAAAAAFwQ/5KR8F-N3Mqk/s1600/controls.png) no-repeat 0 0;}
#cboxTopCenter{height:14px; background:url(http://3.bp.blogspot.com/-dJQm3QEd5Iw/TxohpCter-I/AAAAAAAAF0Q/GRny7olLbv8/s400/border.png) repeat-x top left;}
     #cboxTopRight{width:14px; height:14px; background:url(http://4.bp.blogspot.com/-_VSGGUcsUPE/TwNIXL6W2qI/AAAAAAAAFwQ/5KR8F-N3Mqk/s1600/controls.png) no-repeat -36px 0;}
     #cboxBottomLeft{width:14px; height:43px; background:url(http://4.bp.blogspot.com/-_VSGGUcsUPE/TwNIXL6W2qI/AAAAAAAAFwQ/5KR8F-N3Mqk/s1600/controls.png) no-repeat 0 -32px;}
     #cboxBottomCenter{height:43px; background:url(http://3.bp.blogspot.com/-dJQm3QEd5Iw/TxohpCter-I/AAAAAAAAF0Q/GRny7olLbv8/s400/border.png) repeat-x bottom left;}
     #cboxBottomRight{width:14px; height:43px; background:url(http://4.bp.blogspot.com/-_VSGGUcsUPE/TwNIXL6W2qI/AAAAAAAAFwQ/5KR8F-N3Mqk/s1600/controls.png) no-repeat -36px -32px;}
     #cboxMiddleLeft{width:14px; background:url(http://4.bp.blogspot.com/-_VSGGUcsUPE/TwNIXL6W2qI/AAAAAAAAFwQ/5KR8F-N3Mqk/s1600/controls.png) repeat-y -175px 0;}
     #cboxMiddleRight{width:14px; background:url(http://4.bp.blogspot.com/-_VSGGUcsUPE/TwNIXL6W2qI/AAAAAAAAFwQ/5KR8F-N3Mqk/s1600/controls.png) repeat-y -211px 0;}
     #cboxContent{background:#fff; overflow:visible;}
         #cboxLoadedContent{margin-bottom:5px;}
         #cboxLoadingOverlay{background:url(http://2.bp.blogspot.com/-bMneOFi_UDo/Txohpge3Z9I/AAAAAAAAF0s/AbVgxX9pXtQ/s400/loadingbackground.png) no-repeat center center;}
         #cboxLoadingGraphic{http://3.bp.blogspot.com/-SKktU1-SCCw/TxohpRB19LI/AAAAAAAAF0Y/iwIo3LnjoE0/s400/loading.gif) no-repeat center center;}
         #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
         #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
         #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(http://4.bp.blogspot.com/-_VSGGUcsUPE/TwNIXL6W2qI/AAAAAAAAFwQ/5KR8F-N3Mqk/s1600/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
         #cboxPrevious{left:0px; background-position: -51px -25px;}
         #cboxPrevious.hover{background-position:-51px 0px;}
         #cboxNext{left:27px; background-position:-75px -25px;}
         #cboxNext.hover{background-position:-75px 0px;}
         #cboxClose{right:0; background-position:-100px -25px;}
         #cboxClose.hover{background-position:-100px 0px;}
         .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;}
         .cboxSlideshow_on #cboxSlideshow.hover{background-position:-150px 0px;}
         .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
         .cboxSlideshow_off #cboxSlideshow.hover{background-position:-125px 0px;}


/*-----------------------------------------------------------------------------------*/
/*   Facebook Likebox popup For Blogger
/*-----------------------------------------------------------------------------------*/
#subscribe {
    font: 12px/1.2 Arial,Helvetica,san-serif; color:#666;
}
#subscribe a,
#subscribe a:hover,
#subscribe a:visited {
    text-decoration:none;
}
.box-title {
   color: #F66303;
   font-size: 20px !important;
   font-weight: bold;
   margin: 10px 0;
border:1px solid #ddd;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
box-shadow: 5px 5px 5px #CCCCCC;
padding:10px;
line-height:25px; font-family:arial !important;
}
.box-tagline {
   color: #999;
   margin: 0;
   text-align: center;
}
#subs-container {
    padding: 35px 0 30px 0;
    position: relative;
}
a:link, a:visited {
border:none;
}
.demo {
display:none;
}
</style>


<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script>

<script src="http://mybloggertricks.googlecode.com/files/jquery.colorbox-min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
   if (document.cookie.indexOf('visited=true') == -1) {
       var fifteenDays = 1000*60*60*24*30;
       var expires = new Date((new Date()).valueOf() + fifteenDays);
       document.cookie = "visited=true;expires=" + expires.toUTCString();
   $.colorbox({width:"400px", inline:true, href:"#subscribe"});
       }
});
</script>
    <!-- This contains the hidden content for inline calls -->
 
        <div style='display:none'>
   <div id='subscribe' style='padding:10px; background:#fff;'>
        <h3 class="box-title">Receive all updates via Facebook. Just Click the Like Button Below<center><p style="line-height:3px;" >▼</p></center></h3> 
      <center>

<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fbloggertricks&amp;width=300&amp;colorscheme=light&amp;show_faces=true&amp;border_color=%23ffffff&amp;stream=false&amp;header=false&amp;height=258" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:258px;" allowtransparency="true"></iframe>

</center>
<p style=" float:right;  margin-right:35px;  font-size:9px;" >Powered By <a style=" font-size:9px; color:#3B78CD; text-decoration:none;" href="http://www.mybloggertricks.com">Blogger Widgets</a></p>
</div>
</div>

 

Make this simple change:

  • Replace bloggertricks with your facebook username.

Update: If your Facebook URL is too long and contains numbers then you may first create a branded Facebook username in seconds at Facebook.com/username

   5.   Hit the save button. Drag the widget to anywhere on your right sidebar.

     6. Click the orange save button towards top right.

done! Visit your blogs to see it poping up just beautifully. To review the widget just delete your browser cookies and refresh the page to see it appearing again.

Want the widget to appear Repeatedly

If you want to prompt the likebox every time the visitor enters your blog then simply delete this *30 from the code above.

Do let me know if you needed more help. Peace and blessings pals! :)


If you enjoyed this post and wish to be informed whenever a new post is published, then make sure you Subscribe to our regular Email Updates!

If you don't want to get yourself into Serious Technical Trouble while editing your Blog Template then just sit back and relax and let us do the Job for you at a fairly reasonable cost. Submit your order details by Clicking Here »


Thanks for making this possible! Kindly Bookmark and Share it.
Technorati Digg This Stumble Facebook Twitter

56 comments:

Comment Page :
ahmed safwan on 12:07 AM, January 04, 2012 said... #

you are always great man you are always great

thanks mohammed

Oluwajoba on 12:11 AM, January 04, 2012 said... #

wow! i love this!

ahmed safwan on 12:14 AM, January 04, 2012 said... #

why dont you redirect all your templates links and test lab to subdomain to your blog
as zailab.blogspot.com to zailab.mybloggertricks.com this will increase your alexa rank

i would like also to know the pack that you bought from hostgrator name and if i will buy i will buy under your affilate link

Faiz Muhammad Khan on 1:10 AM, January 04, 2012 said... #

again found some thing great!

English Songz on 1:29 AM, January 04, 2012 said... #

Hey Mohd.Dude Whenever i embed this popup thing in my blog, my featured and popular section tabs opend can you tell me the reason why its happend like this ?

English Songz on 1:30 AM, January 04, 2012 said... #

and can you please tell me , how to make subdoamin of my englishsongz.com

MUXLIMO on 7:18 AM, January 04, 2012 said... #

This is what im waiting for long time!!
I did all the step, including delete cookies.. BUT.. WHY IT DOESNT WORK ON MY BLOG?? ;_(((((

Mohammad, pls analyze it for me.. why my template make it doesnt work. ;_O i want it badly..

or anyone.. pls try go to my blog here: http://muxlimo.blogspot.com
if it works on You.. pls send CBOX message to me.. pls..thanks.. ;_O

TORO on 7:53 AM, January 04, 2012 said... #

excelent information.

technovary.com on 8:45 AM, January 04, 2012 said... #

great share man!!! will try in my site

MR. DJHOAG on 9:17 AM, January 04, 2012 said... #

I delete * 30 but it appears only one time :(

daven on 10:52 AM, January 04, 2012 said... #

Mine Not Working After Replace The bloggerticks to mine 1 :( please help http://www.tamilanspace.net

M Saad on 12:13 PM, January 04, 2012 said... #

Can you please make a popup containing all social bookmarking. E.g, Facebook, twitter, rss subscribe and etc

Vishu on 2:10 PM, January 04, 2012 said... #

thx u very much dear bro .. its really nice widget five star *****

Sidharth on 2:35 PM, January 04, 2012 said... #

Thanks For The Credit Sir :)

Babbu Singh on 2:53 PM, January 04, 2012 said... #

thx for your all best guidelines .. now i subscribe your page via email .. i also follow u on G+ :).. also i want to give thx dear Sidharth for this unique widget :).. right now i have run 2 blog onestepdownload.blogspot.com & jaycutlerbest.blogspot.com
i need more guidelines in future.. and bast of luck dear Mohammad Mustafa Ahmedzai bro .. thx again u Rock

yAhyA on 3:06 PM, January 04, 2012 said... #

Good One

SHREE MADHAN on 3:16 PM, January 04, 2012 said... #

lokkin great
http://softechnogeek.blogspot.com/

ahmed safwan on 4:12 PM, January 04, 2012 said... #

can you tell me please how to make a subscribtion as mashable so that the subscriber choose the topic that he want to follow

i will explain more

when you see the subscribtion box you see check boxes you choose the topic that you want can i make this in blogger

Unknown on 5:25 PM, January 04, 2012 said... #

@daven
u r Widget working Fine I visited U r website Working Great ?

@ MUXLIMO on 7:18 AM, January 04, 2012 said... # 7
Buddy It Is not working for me At Beginning Problems You Might have

1)If your Website contain Any redirection Script then This Is not going to Work Like i Had Adfoc.us Redirection ..just look at u r scripts ?
2)Replace bloggertricks to u r Facebook Page Id if it is wrong then it might not work [look carefully at u r id my Id Contains number Also :)]

@mohd Simply i had not any Word to Describe u r Work i am Speech-Less Bro Forgive Me :)
Just visit My Website
http://goo.gl/FEa86

kostantinos on 5:59 PM, January 04, 2012 said... #

Can i make the widget to show again repeatidly only at those who didn't click like?

MUXLIMO on 6:06 AM, January 05, 2012 said... #

@Unknown
Ah,.. thank you very much for replying me, Umknown Bro.. I replaced the ID to mine and all i can remember, i never put any redirect javascript to my template.. i dont know how to make it work.. ;(

btw, thanks again for the suggestion, Bro.. God Bless You :)

Muhammad Allam on 9:33 AM, January 05, 2012 said... #

Its Really Nice Widget
Thanks Bro.
MAKE DOLLARS ONLINE

Jafar Dhada on 11:30 AM, January 05, 2012 said... #

Hey Mohd,
Not working for me.

Ayush Agrawal on 2:33 PM, January 05, 2012 said... #

Can i remove your link?

ndark on 5:52 PM, January 05, 2012 said... #

not working for me i have installed it already
COOL HACKING TRICKS

kilaruteja on 10:58 PM, January 05, 2012 said... #

check my blog it's not working properly
give me any suggestion for modifying

http://jntuk.strikingsoon.com

borneoxmeo on 1:32 PM, January 06, 2012 said... #

Hi there..

Awesome widget! Nice job, well done you did a great job mate. This widget will make our blogger hosted blog look more pro and modern i guess. ;) My blog Camcorder buying guide Thanks MBT!

Mohammad Mustafa Ahmedzai on 5:48 PM, January 06, 2012 said... #

For those of you, who can't make it work, please make sure that you drag your widget to extreme bottom right sidebar. Place it below all widgets on your right sidebar.
If it still didn't work then please delete this line from the code and save and check again:

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js'></script>

Let me know everybody.

@ahmed

Unfortunately that can't be done because zailab is a separate blogger blog and subdomains are only possible for a blog having the main domain reserved for itself like mbt.
For hosting guidelines please give me some time to write a detailed post on it. I will share coupon codes too that may provide you with free first three months. A lot of readers have asked me on this therefore I needed to first assure you why should you choose hostgator and then I will skip directly on how can you register for free months and enjoy the best discount possible. I will answer all your questions on hosting in my coming posts buddy. :)

For that mashable type subscription you will need special development which is costly. They are putting a lot of bucks in providing such category subscription. Not possible with feedburner or even aweber.

@English songs
My next posts are on web hosting please stay tuned.

@MUXLIMO

My bad that I am reading your comment so late dear. Please apply the method I shared above and let me know else I will personally help you for being a loyal reader. :)


@MR. DJ
Please instead of deleting try putting this *0 in place of *30

@babu singh
Thanks for your kind feedback. You will be treated exceptionally from today onwards for being a loyal reader now. Always welcomed. :>

@sidhart
Most welcomed buddy :>

@M saad
I am working on it buddy, will be served very soon.

@unknown

Thanks buddy for helping others. Really appreciated it :)

@Ayush agarwal
You can change its colour so that it may not display too much but kindly keep it intact as the only favour pal.


@ndark @kilaruteja
Try the method I shared above.


@borneoxmeo
Most welcomed pal :)

Jose Delgado on 9:20 PM, January 06, 2012 said... #

For some reason doesn't work for my page. Which part of my link I need to replace?

http://www.facebook.com/pages/Amardon-War-Field/288829401161546

Thanks for this great products

Edel | R.U.M Magazine on 4:24 AM, January 07, 2012 said... #

@JoseDelgado hey man I had the same problem and it took like 3 hours to figure it out lol, but you jus have to replace "BLOGGERTRICKS" with--> "pages/Amardon-War-Field/288829401161546" i hope you can make it work, and Mohammad your blog is amazing!!!

DewaTV on 7:46 PM, January 07, 2012 said... #

OMG.. i'm looking for this tutorial at a long time.. i'm so happy.. thanks MBT for this awesome tutorial.. Best regards: Mr.DewaTV

Mohammad Mustafa Ahmedzai on 12:36 AM, January 08, 2012 said... #

Update

I have updated the point on Facebook Username URL. please find it above step#5

You will have to create Facebook usernames and this is important for your future use too else you can get the Facebook Liklebox code from this page

You will like Version 2 a lot!

MUXLIMO on 1:26 AM, January 08, 2012 said... #

@Mohammad Mustafa Ahmedzai
Thanks for this reply, Brother.. its OK i know u're so busy there.. btw, it stil doesnt work, Bro.. (*sad) might be caused by my transparent image for my template background??

BlogKing on 3:07 PM, January 11, 2012 said... #

amazing man you r superb man visit my blog http://mithilaworld.blogspot.com/

Funtastikos on 10:41 PM, January 17, 2012 said... #

Hi! i have a problem with this! I have Nivo's slider and when i add this script, then slider stops and is not loading the images.... I asked in Nivo's forums and they told me:
"The reason is probably related to that code that you're trying to add containing an older version of jQuery.
Try adding it in and let us know - we can then better diagnose the issue.
-- Michael"

Can you help me maybe? :)

Nem0 on 9:36 PM, January 20, 2012 said... #

Please Re-Upload Images ... ImgBoot.com Shows Error.. All Images Are Deleted :(

Edel | R.U.M Magazine on 9:43 PM, January 20, 2012 said... #

Yes i have the same problem reupload the imags pleasee!!!

Suprim Shrestha on 12:23 AM, January 21, 2012 said... #

Please update the post i am also getting the error on image it says go to www.imgboot.com

MAX89X on 4:55 AM, January 21, 2012 said... #

Replace the link with this :)

border: http://i.imgur.com/2rIKc.png

controls: http://i.imgur.com/ydcPr.png

loading: http://i.imgur.com/MtP9b.gif

loading_background: http://i.imgur.com/s7h4D.png

Suprim Shrestha on 5:43 AM, January 21, 2012 said... #

@MAX89X hey i saw your blog and the widget is working fine please can you upload your whole text

thanks

Mohammad Mustafa Ahmedzai on 7:42 AM, January 21, 2012 said... #

Update

Images have been updated and the updated code is highlighted in blue color. You can now use the updated code to make things work just perfectly :)

@Funtastikos

I have replaced the jquery link with the most updated code. It will work now in your case too. :>

MD LinkZ on 4:55 AM, January 28, 2012 said... #

Thanx soo much 4 this!

It's working perfectly on my blog and i switched to version 2 ;D
mediadownlinkz.blogspot.com

will the code still work if i store the images on my own server?

plus I was wondering, is there a way to change code so that it stops appearing to people who have already liked the page?

thanx 4 ur awesome work

Manthan Patel on 8:38 AM, January 29, 2012 said... #

could not retrieve id for the specified page. Please verify correct href was passed in. :(((( y so.?

Κόκκαλο on 4:47 AM, January 31, 2012 said... #

mine is not working too buddy ...why's that ??? :((((
tokammenokokkalo.blogspot.com

abhishek maurya on 4:32 PM, February 03, 2012 said... #

Dude try this to wrap text in the box..

.comment-text {
word-wrap: break-word;
}

pualin on 7:51 PM, February 06, 2012 said... #

I deleted *30, in order pop-up likebox every time I visit my blog, but it doesn't works. Do you know what the problem could be?

KhAnZ on 10:36 PM, February 11, 2012 said... #

MediaFire MKV Movies Small Size High Quality, Hd Prints, Tv Shows

مدونة جوال العرب on 2:42 AM, February 12, 2012 said... #

Thanks Broth very nice job

akid on 11:05 PM, February 22, 2012 said... #

Dude, i think this popup is great. But i think this popup can be much better if you can hide the close button and make the popup auto close after readers click 'LIKE'.. can you make that?

Freshers Jobs India on 10:17 AM, February 23, 2012 said... #

Not working for my blog.
Earlier worked when i had default blogger template.

Please help me.

http://newvacancy.blogspot.in/

Amimul islam rafi on 3:18 PM, February 25, 2012 said... #

very cool tips

The Joker on 6:55 PM, February 28, 2012 said... #

how can i get this to work in wordpress hosted blog ?

Sachinn on 11:57 PM, March 05, 2012 said... #

Hey thanks for the Excellent Code !!!

I have a Query - If I want to restrict the user not to close the popup by cliking out the window. they should close only by CLOSE button in the popup..please guide me what to change ?

Pk-News on 6:50 PM, April 02, 2012 said... #

Its Ok but not work the slider

Irwansyah751 on 8:19 PM, April 28, 2012 said... #

it can not for my blog too when I change the username of my facebook

Admin on 8:02 AM, May 06, 2012 said... #

Is there any thing for my wordpress website Wide Info to pop up like box ?

Confused? Feel free to ask

Your feedback is always appreciated. We will try to reply to your queries as soon as time allows.

Note:
1. To add HTML CODE in comments then please use our HTML Encoder
2. You can always Test the tutorial on our HTML Editor
3. Please do not spam Spam comments will be deleted immediately upon our review.

Regards,
Mohammad

 

Recent Posts

Join Me On Facebook

8600+ Followers

Join The Team!

Licensed Under CC

Recent Comments

Follow Me On Twitter

2601+ Followers

My Blogger Tricks (MBT) © 2012. All Rights Reserved | Contact |