25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

47 satır
1.7 KiB

  1. /*!
  2. * zIndex plugin from jQuery UI Core - v1.10.4
  3. * http://jqueryui.com
  4. *
  5. * Copyright 2014 jQuery Foundation and other contributors
  6. * Released under the MIT license.
  7. * http://jquery.org/license
  8. *
  9. * http://api.jqueryui.com/category/ui-core/
  10. */
  11. define([
  12. 'jquery'
  13. ], function ($, undefined) {
  14. // plugins
  15. $.fn.extend({
  16. zIndex: function (zIndex) {
  17. if (zIndex !== undefined) {
  18. return this.css("zIndex", zIndex);
  19. }
  20. if (this.length) {
  21. var elem = $(this[0]), position, value;
  22. while (elem.length && elem[0] !== document) {
  23. // Ignore z-index if position is set to a value where z-index is ignored by the browser
  24. // This makes behavior of this function consistent across browsers
  25. // WebKit always returns auto if the element is positioned
  26. position = elem.css("position");
  27. if (position === "absolute" || position === "relative" || position === "fixed") {
  28. // IE returns 0 when zIndex is not specified
  29. // other browsers return a string
  30. // we ignore the case of nested elements with an explicit value of 0
  31. // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
  32. value = parseInt(elem.css("zIndex"), 10);
  33. if (!isNaN(value) && value !== 0) {
  34. return value;
  35. }
  36. }
  37. elem = elem.parent();
  38. }
  39. }
  40. return 0;
  41. }
  42. });
  43. });