Advertisement
Guest User

first try with you

a guest
Nov 18th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | None | 0 0
  1. <script>
  2. //<![CDATA[
  3. function myFunction() {
  4.  
  5. document.getElementById("video").innerHTML = "<div id='player'></div>";
  6.  
  7. // 2. This code loads the IFrame Player API code asynchronously.
  8. var tag = document.createElement('script');
  9.  
  10. tag.src = "https://www.youtube.com/iframe_api";
  11. var firstScriptTag = document.getElementsByTagName('script')[0];
  12. firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  13. }
  14. // 3. This function creates an <iframe> (and YouTube player)
  15. // after the API code downloads.
  16. var player;
  17. function onYouTubeIframeAPIReady() {
  18. player = new YT.Player('player', {
  19. height: '390',
  20. width: '640',
  21. videoId: 'M7lc1UVf-VE',
  22. events: {
  23. 'onReady': onPlayerReady,
  24. 'onStateChange': onPlayerStateChange
  25. }
  26. });
  27. }
  28.  
  29. // 4. The API will call this function when the video player is ready.
  30. function onPlayerReady(event) {
  31. event.target.playVideo();
  32. }
  33.  
  34. // 5. The API calls this function when the player's state changes.
  35. // The function indicates that when playing a video (state=1),
  36. // the player should play for six seconds and then stop.
  37. var done = false;
  38. function onPlayerStateChange(event) {
  39. if (event.data == YT.PlayerState.PLAYING && !done) {
  40. //setTimeout(stopVideo, 6000);
  41. done = true;
  42. }
  43. }
  44. function stopVideo() {
  45. player.stopVideo();
  46. }
  47.  
  48. function onPlayerReady(event) {
  49. event.target.setVolume(0);
  50. event.target.playVideo();
  51. }
  52.  
  53. var done = false;
  54. function onPlayerStateChange(event) {
  55. if (event.data == YT.PlayerState.PLAYING && !done) {
  56. // setTimeout(stopVideo, 6000);
  57. done = true;
  58. }
  59. event.target.setVolume(0);
  60. }
  61. //]]>
  62. </script>
  63.  
  64. <script src='https://rawgit.com/ha07za/how-arabic/master/howarabicpopup.js' type='text/javascript'/>
  65. <script type='text/javascript'>
  66. $(&#39;#popup-box&#39;).howarabicpopup({
  67. &#39;autoOpen&#39;: true
  68. });
  69.  
  70. </script>
  71.  
  72.  
  73. /*=============== CSS Popup Like box by howarabi.blogspot.com/ ======================*/
  74. .howarabicpopup{position:fixed;top:0;left:0;right:0;bottom:0;z-index:90000;background:rgba(0,0,0,.6);overflow-x:hidden;overflow-y:auto;display:none}
  75. .howarabicpopup-container{background:#fff url(http://i.imgur.com/2twQjiN.gif) no-repeat 50% 50%;padding:0;font-size:14px;height:236px;position:fixed;top:50%;left:50%;z-index:90001;-webkit-box-shadow:0 0 15px 0 rgba(50,50,50,0.8);transform:translateY(-50%) translateX(-50%)}
  76. .howarabicpopup .howarabicpopup-close{position:absolute;top:9px;right:20px;font-weight:700;font-family:Verdana;font-size:18px;cursor:pointer;color:#fff}
  77. .howarabicpopup .howarabicpopup-close:hover{color:#535353}
  78. .howarabicpopup .howarabicpopup-header{font-size:20px;padding:10px;text-align:center;color:#fff;font-family:Open Sans;background-color:#d14233;text-shadow:1px 2px 4px #838383}
  79. .howarabicpopup .howarabicpopup-header p{font-size:10px;padding:0;margin:0;font-weight:400;text-transform:initial}
  80. .howarabicpopup .howarabicpopup-content{padding:10px 20px}
  81.  
  82.  
  83. <div id="popup-box" class="howarabicpopup">
  84. <div class="howarabicpopup-container">
  85. <div class="howarabicpopup-header">
  86. <div class="howarabicpopup-close" data-dismiss="howarabicpopup"> <button onclick="myFunction();return false;">إغلاق النافذة</button> </div>
  87. <div id="video"></div>
  88. مرحبا بك على موقع اَمني
  89. <p> نتمنى أن تنظم إلى عائلتنا على الفيس بوك بالضغط على زر الإعجاب و كذا تكون أقرب إلينا
  90. </p>
  91.  
  92.  
  93. </div>
  94. <div class="howarabicpopup-content">
  95. <div class="fb-page" data-href="https://www.facebook.com/amnitech8" data-width="400" data-height="300" data-small-header="true" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="true" data-show-posts="false"><div class="fb-xfbml-parse-ignore"></div></div>
  96. </div>
  97. </div>
  98. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement