Нема описа

effect-blind.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*!
  2. * jQuery UI Effects Blind 1.12.1
  3. * http://jqueryui.com
  4. *
  5. * Copyright jQuery Foundation and other contributors
  6. * Released under the MIT license.
  7. * http://jquery.org/license
  8. */
  9. //>>label: Blind Effect
  10. //>>group: Effects
  11. //>>description: Blinds the element.
  12. //>>docs: http://api.jqueryui.com/blind-effect/
  13. //>>demos: http://jqueryui.com/effect/
  14. ( function( factory ) {
  15. if ( typeof define === "function" && define.amd ) {
  16. // AMD. Register as an anonymous module.
  17. define( [
  18. "jquery",
  19. "./effect"
  20. ], factory );
  21. } else {
  22. // Browser globals
  23. factory( jQuery );
  24. }
  25. }( function( $ ) {
  26. return $.effects.define( "blind", "hide", function( options, done ) {
  27. var map = {
  28. up: [ "bottom", "top" ],
  29. vertical: [ "bottom", "top" ],
  30. down: [ "top", "bottom" ],
  31. left: [ "right", "left" ],
  32. horizontal: [ "right", "left" ],
  33. right: [ "left", "right" ]
  34. },
  35. element = $( this ),
  36. direction = options.direction || "up",
  37. start = element.cssClip(),
  38. animate = { clip: $.extend( {}, start ) },
  39. placeholder = $.effects.createPlaceholder( element );
  40. animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ];
  41. if ( options.mode === "show" ) {
  42. element.cssClip( animate.clip );
  43. if ( placeholder ) {
  44. placeholder.css( $.effects.clipToBox( animate ) );
  45. }
  46. animate.clip = start;
  47. }
  48. if ( placeholder ) {
  49. placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing );
  50. }
  51. element.animate( animate, {
  52. queue: false,
  53. duration: options.duration,
  54. easing: options.easing,
  55. complete: done
  56. } );
  57. } );
  58. } ) );