Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It seems as if FaceBook has recently changed some code - whenever I clicked "Like", the contents jumped to the left, thus messing up the UI. No CSS / JS tricks made it work. I went with a more simple solution, using an <strong>iframe</strong>.</p> <p><strong>NOTICE</strong> - Though some devices already support iFrames, not all mobile devices do. iFrames are actually old and not recommended at all, but it did the trick for me.</p> <p>Lets take the default like-generation script from facebook, and generate an iFrame like box;</p> <p><a href="https://developers.facebook.com/docs/reference/plugins/like/" rel="nofollow">Click here to generate like button</a></p> <p>Go for the "Box_Count" style, with a counter on top.</p> <p>When you press "Grab the code", go for the iFrame code. You'll get something similar to this;</p> <pre class="lang-html prettyprint-override"><code>&lt;iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.example.com&amp;amp;send=false&amp;amp;layout=box_count&amp;amp;width=45056&amp;amp;show_faces=false&amp;amp;font&amp;amp;colorscheme=light&amp;amp;action=like&amp;amp;height=90&amp;amp;appId=1234567891011" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:45056px; height:90px;" allowTransparency="true"&gt;&lt;/iframe&gt; </code></pre> <p>Now lets wrap a div around there.</p> <pre class="lang-html prettyprint-override"><code>&lt;div class="like_wrap"&gt; &lt;iframe (...)&gt;&lt;/iframe&gt; &lt;/div&gt; </code></pre> <p>Give it the following CSS:</p> <pre class="lang-css prettyprint-override"><code>.like_wrap { width:55px; height:25px; overflow:hidden; } </code></pre> <p>Now you'll probably see the left top corner of the counter. Now we have to fix the iFrame. Give it a class;</p> <pre class="lang-html prettyprint-override"><code>&lt;iframe class="like_box" (...)&gt; &lt;/iframe&gt; </code></pre> <p>And make it so that it is always english, by adding "&amp;locale=en_US" to the URL. This is to prevent weird layouts in other countries - in Dutch it would be "Vind ik leuk" and in english "Like". I guess everybody, in every language, knows a "Like" so lets stick with that.</p> <p>Now we'll add some more CSS for the like_box;</p> <pre class="lang-css prettyprint-override"><code>.like_box { margin-top:-40px; } </code></pre> <p>So the whole code looks like this (i've removed the app_id as I didn't need it)</p> <p>HTML:</p> <pre class="lang-html prettyprint-override"><code>&lt;div class="like_wrap"&gt; &lt;iframe class="like_box" src="//www.facebook.com/plugins/like.php?href=CURRENT-URL-ENCODED&amp;amp;send=false&amp;amp;layout=box_count&amp;amp;width=45056&amp;amp;show_faces=false&amp;amp;font&amp;amp;colorscheme=light&amp;amp;action=like&amp;amp;height=90&amp;amp;locale=en_US" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:45056px; height:90px;" allowTransparency="true"&gt;&lt;/iframe&gt; &lt;/div&gt; </code></pre> <p>CSS:</p> <pre class="lang-css prettyprint-override"><code>.like_wrap { width:55px; height:25px; overflow:hidden; } .like_box { margin-top:-40px; } </code></pre> <p>And now i have a decent, small, like box, that works fine and doesn't jump around. Let me know how this works out for you and if there are any problems that you are facing.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload