colorbox_style.js 1.3 KB

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