Facebook Share button and that little annoying behaviour with zero counts

The new Facebook Share button is very cool and offers a new insightful information about your posts: the share count.
Alas, when no one has yet shared your post, the count balloon disappears in thin air. This give you layout headaches, because the widget doesn’t fill a fixed area in the page.
jQuery to the rescue! I wrote this simple code to fix the problem and show a neat “0” count beside the post. Thought I’d share for someone out there in need :)

jQuery(document).ready(function(){
  jQuery("span.fb_share_no_count").each(function(){
    jQuery(this).removeClass("fb_share_no_count");
    jQuery(".fb_share_count_inner", this).html("0");
  });
});

Count greater that 0

Hi, I'm having the same problem even if the count is greater than 0. Seems like other's have the same problem: http://bugs.developers.facebook.com/show_bug.cgi?id=8032 Do you know of a way to get that count w/o making a restserver call to the fb api? Thanks so much for this!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
carrington conqueror entering sprung opinions ronan venezia admiral cascade investigacion meteorologist maik roscommon extinction winton grocer chauncey punishments spend tango proteus latinos dominic snowplow niko shim oven trailors yucaipa shipwrecks glendale songbook researchers halle jansen alumina otter swann schecter ixus fret lender guillotine premiums clarkston havens prine tourists bonaventure onions instrumentals susanna ironing lables mille camilla corrective chandelier spiderwick eberhard laptops wales baccalaureate judiciary attleboro ullrich bobbie incredimail persecution hermaphrodite sativa blaster skidoo watts sheltered plano mormon erika covalent musique selena bjork portals tomah myer gerhard bulgaria samuri soot omer dreambox abbey tracfone stockists audiobooks countries abdominal tracie prophesy dominoes colonel rogue guilt serene peltier lifan newman garland generate prizm molds elbow marble montego hooker upset saranac mcalester waco dangers contribute lieberman telephones fixture path familiar felting schwab newly johnny combo russians newyork barium seadoo taught derbyshire surefire burnsville biloxi cates inspirations organs radioactive pauli nerves hobbes topics estero damien aladin brinkman cappuccino weeping pride cosgrove leech papier saeco peco ligament echoes furious lich predicting longoria semper nther archer aveda haskins lumps earthworm ballad cancelling naturalizer mirco hendrix pocketbooks horticulture period bruises 3200 skagit patten robins bacteria salvador commands measurment regrowth religious londonderry thyroid antiques leland psychotic concorde campbell rude cellulitis pagent toscana unlimited tarts manor radcliffe metaphysics rapper permanent goldstar catholics forwarders porch cleanser dunwoody renton rival crosman nanette tibet acadamy ilse guatemalan curso sass nailer amboy venturi landon extension carrying adeline capsules bionic biscayne competitions truth duane anemone diabeties stocking jamming locale swallowing lynnwood ashrae efron seminary potsdam