Advertisement
Guest User

Untitled

a guest
Jul 18th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.17 KB | None | 0 0
  1.  
  2. <!-- ***** Ten fragment kodu dodajesz po tagu <body> *****-->
  3. <div id="fb-root"></div>
  4. <script>(function(d, s, id) {
  5.   var js, fjs = d.getElementsByTagName(s)[0];
  6.   if (d.getElementById(id)) return;
  7.   js = d.createElement(s); js.id = id;
  8.   js.src = "//connect.facebook.net/pl_PL/sdk.js#xfbml=1&version=v2.7";
  9.   fjs.parentNode.insertBefore(js, fjs);
  10. }(document, "script", "facebook-jssdk"));</script>
  11.  
  12. <div id="backFB" style="display: none; width: 100%; height: 100%; background: RGBA(6, 4, 4, 0.80); position: fixed; top: 0px; left: 0px;"></div>
  13. <div id="fbbox" style="display:none; position: fixed; top: 25%; left: 30%">
  14.  
  15. <!--
  16. W data-href wpisujesz url fanpage (https://www.facebook.com/nazwa_fanpage/) np. https://www.facebook.com/facebook/
  17. -->
  18. <div class="fb-page" data-href="https://www.facebook.com/facebook/" data-width="500" data-height="250" data-small-header="true" data-adapt-container-width="false" data-hide-cover="false" data-show-facepile="true">
  19. <!-- W cite wpisujesz url fanpage-->
  20.     <blockquote cite="https://www.facebook.com/facebook/" class="fb-xfbml-parse-ignore"><!-- W href również wpisujesz url fanpage--><a href="https://www.facebook.com/facebook/"><!--Usuń komentarz i wpisz sobię nazwę swojej strony np. strona.pl, cokolwiek :)--></a></blockquote>
  21. </div>
  22. <div id="closeBtn" style=" cursor: pointer;top: -11px; left: 480px; width: 35px; height: 35px; background-color: rgb(74, 72, 72); color: white; text-align: center; position: absolute; font-size: 25px;">&#10006;</div>
  23. </div>
  24.  
  25.  
  26. <!--***************************************************************** -->
  27.  
  28.  
  29. <!-- ***** Ten kod wklejasz tuż NAD tagiem </body>  -->
  30. <!-- Jeżeli masz już na stronie wtyczke jQuery to usuń pierwszy <script> -->
  31.  
  32.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  33.     <script src="fbscript.js"></script>
  34. <!--***************************************************************** -->
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. <!--*****************************************************************
  42.     Utwórz plik o nazwie fbscript.js i wklej poniższy kod. Plik umieść w głównym katalogu strony.
  43.  
  44. ******************************************************************************************* -->
  45.  
  46. $(document).ready(function(){
  47.     if(getCookie("fbbox") != 1){
  48.         $("#backFB").show();
  49.         $("#fbbox").show();
  50.         setCookie("fbbox", 1, 365);
  51.     }
  52.  
  53.  
  54. });
  55.  
  56. $(function(){
  57.         $("#backFB").click(function(){
  58.             $("#backFB").hide();
  59.             $("#fbbox").hide();
  60.         });
  61. });
  62. $(function(){
  63.         $("#closeBtn").click(function(){
  64.             $("#backFB").hide();
  65.             $("#fbbox").hide();
  66.         });
  67. });
  68.  
  69. function setCookie(cname, cvalue, exdays) {
  70.     var d = new Date();
  71.     d.setTime(d.getTime() + (exdays*24*60*60*1000));
  72.     var expires = "expires="+d.toUTCString();
  73.     document.cookie = cname + "=" + cvalue + "; " + expires;
  74. }
  75.  
  76. function getCookie(cname) {
  77.     var name = cname + "=";
  78.     var ca = document.cookie.split(';');
  79.     for(var i = 0; i < ca.length; i++) {
  80.        var c = ca[i];
  81.        while (c.charAt(0) == ' ') {
  82.            c = c.substring(1);
  83.        }
  84.        if (c.indexOf(name) == 0) {
  85.            return c.substring(name.length, c.length);
  86.        }
  87.    }
  88.    return "";
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement