Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. ae.lightBox = function($) {
  2. $('.views-field-field-record-time-link a').on('click', function(e) {
  3. e.preventDefault();
  4. var $img = $(this).parent().parent().siblings('.views-field-field-record-time-image');
  5. if ($img.hasClass('open')) {
  6. $img.removeClass('open');
  7. } else {
  8. $img.addClass('open');
  9. }
  10. });
  11.  
  12. $('.views-field-field-record-time-image').each(function(index) {
  13. var topMargin = -$(this).find('img').attr('height') / 2;
  14. $(this).css('margin-top', topMargin);
  15.  
  16. $(this).append('<div class="close-button">x</div>');
  17. $(this).find('.close-button').on('click', function(e) {
  18. $(this).parent().removeClass('open');
  19. });
  20. });
  21.  
  22. $('.views-field-field-zdjecie-glowne-link a').on('click', function(e) {
  23. e.preventDefault();
  24. var $yt = $(this).parent().parent().siblings('.views-field-field-yt-video');
  25. if ($yt.hasClass('open')) {
  26. $yt.removeClass('open');
  27. } else {
  28. $yt.addClass('open');
  29. }
  30. });
  31.  
  32. $('.views-field-field-yt-video').each(function(index) {
  33. var topMargin = -$(this).find('div').attr('height') / 2;
  34. $(this).css('margin-top', topMargin);
  35.  
  36. $(this).append('<div class="close-button-YT">x</div>');
  37. $(this).find('.close-button-YT').on('click', function(e) {
  38. $(this).parent().removeClass('open');
  39. $('.html5-video-player').removeClass('.playing-mode');
  40. $('.html5-video-player').addClass('.paused-mode');
  41. });
  42. });
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement