Advertisement
Guest User

Untitled

a guest
Jan 4th, 2021
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <style>
  2. .fixed_video{
  3. position: fixed;
  4. z-index: 99;
  5. right: 30px;
  6. top: 30px;
  7. height: 190px !important;
  8. width: 300px !important;
  9. border-radius: 4px;
  10. background: #000;
  11. box-shadow: 0 5px 30px rgba(0,0,0,0.2);
  12. }
  13.  
  14. .fixed_video iframe{
  15. width: 100% !important;
  16. height: 100% !important;
  17. }
  18. </style>
  19.  
  20. <input type="hidden" class="style_holder" name="style_holder" value="">
  21.  
  22. <script>
  23. $( document ).ready(function() {
  24. var distance_top = $(".scroll_fixed_video").offset().top;
  25. var video_height = $(".scroll_fixed_video").outerHeight();
  26. var trigger_height = distance_top + video_height;
  27.  
  28. setTimeout(function(){
  29. var style = $('.scroll_video_holder .columnData').attr('style');
  30. $('.style_holder').val(style);
  31. }, 2000);
  32.  
  33. $(window).scroll(function(event) {
  34. if ($(window).scrollTop() > trigger_height) {
  35. $('.scroll_fixed_video').addClass('fixed_video');
  36. $('.scroll_video_holder .columnData').attr('style', $('.style_holder').val());
  37. } else {
  38. $('.scroll_fixed_video').removeClass('fixed_video');
  39. $('.scroll_video_holder .columnData').attr('style', $('.style_holder').val());
  40. }
  41. });
  42. });
  43. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement