Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- .fixed_video{
- position: fixed;
- z-index: 99;
- right: 30px;
- top: 30px;
- height: 190px !important;
- width: 300px !important;
- border-radius: 4px;
- background: #000;
- box-shadow: 0 5px 30px rgba(0,0,0,0.2);
- }
- .fixed_video iframe{
- width: 100% !important;
- height: 100% !important;
- }
- </style>
- <input type="hidden" class="style_holder" name="style_holder" value="">
- <script>
- $( document ).ready(function() {
- var distance_top = $(".scroll_fixed_video").offset().top;
- var video_height = $(".scroll_fixed_video").outerHeight();
- var trigger_height = distance_top + video_height;
- setTimeout(function(){
- var style = $('.scroll_video_holder .columnData').attr('style');
- $('.style_holder').val(style);
- }, 2000);
- $(window).scroll(function(event) {
- if ($(window).scrollTop() > trigger_height) {
- $('.scroll_fixed_video').addClass('fixed_video');
- $('.scroll_video_holder .columnData').attr('style', $('.style_holder').val());
- } else {
- $('.scroll_fixed_video').removeClass('fixed_video');
- $('.scroll_video_holder .columnData').attr('style', $('.style_holder').val());
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement