Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ae.lightBox = function($) {
- $('.views-field-field-record-time-link a').on('click', function(e) {
- e.preventDefault();
- var $img = $(this).parent().parent().siblings('.views-field-field-record-time-image');
- if ($img.hasClass('open')) {
- $img.removeClass('open');
- } else {
- $img.addClass('open');
- }
- });
- $('.views-field-field-record-time-image').each(function(index) {
- var topMargin = -$(this).find('img').attr('height') / 2;
- $(this).css('margin-top', topMargin);
- $(this).append('<div class="close-button">x</div>');
- $(this).find('.close-button').on('click', function(e) {
- $(this).parent().removeClass('open');
- });
- });
- $('.views-field-field-zdjecie-glowne-link a').on('click', function(e) {
- e.preventDefault();
- var $yt = $(this).parent().parent().siblings('.views-field-field-yt-video');
- if ($yt.hasClass('open')) {
- $yt.removeClass('open');
- } else {
- $yt.addClass('open');
- }
- });
- $('.views-field-field-yt-video').each(function(index) {
- var topMargin = -$(this).find('div').attr('height') / 2;
- $(this).css('margin-top', topMargin);
- $(this).append('<div class="close-button-YT">x</div>');
- $(this).find('.close-button-YT').on('click', function(e) {
- $(this).parent().removeClass('open');
- $('.html5-video-player').removeClass('.playing-mode');
- $('.html5-video-player').addClass('.paused-mode');
- });
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement