colorbox_style.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. (function ($, Drupal) {
  2. "use strict";
  3. Drupal.behaviors.initColorboxPlainStyle = {
  4. attach: function (context, settings) {
  5. $(context).bind('cbox_complete', function () {
  6. // Make all the controls invisible.
  7. $('#cboxCurrent, #cboxSlideshow, #cboxPrevious, #cboxNext', context).addClass('element-invisible');
  8. // Replace "Close" with "×" and show.
  9. $('#cboxClose', context).html('\u00d7').addClass('cbox-close-plain');
  10. // Hide empty title.
  11. if ($('#cboxTitle:empty', context).length == true) {
  12. $('#cboxTitle', context).hide();
  13. }
  14. $('#cboxLoadedContent', context).bind('mouseover', function () {
  15. $('#cboxClose', context).animate({opacity: 1}, {queue: false, duration: "fast"});
  16. if ($('#cboxTitle:empty', context).length == false) {
  17. $('#cboxTitle', context).slideDown();
  18. }
  19. });
  20. $('#cboxOverlay', context).bind('mouseover', function () {
  21. $('#cboxClose', context).animate({opacity: 0}, {queue: false, duration: "fast"});
  22. if ($('#cboxTitle:empty', context).length == false) {
  23. $('#cboxTitle', context).slideUp();
  24. }
  25. });
  26. });
  27. $(context).bind('cbox_closed', function () {
  28. $('#cboxClose', context).removeClass('cbox-close-plain');
  29. });
  30. }
  31. };
  32. })(jQuery, Drupal);