31 | | $('<div class="fx-shadow-color fx-shadow-layer-1"></div>').css({ position: 'absolute', opacity: options.opacity-0.05, left: 5+options.offset, top: 5+options.offset, width: baseWidth+1, height: baseHeight+1 }).appendTo(shadow); |
32 | | $('<div class="fx-shadow-color fx-shadow-layer-2"></div>').css({ position: 'absolute', opacity: options.opacity-0.1, left: 7+options.offset, top: 7+options.offset, width: baseWidth, height: baseHeight-3 }).appendTo(shadow); |
33 | | $('<div class="fx-shadow-color fx-shadow-layer-3"></div>').css({ position: 'absolute', opacity: options.opacity-0.1, left: 7+options.offset, top: 7+options.offset, width: baseWidth-3, height: baseHeight }).appendTo(shadow); |
34 | | $('<div class="fx-shadow-color fx-shadow-layer-4"></div>').css({ position: 'absolute', opacity: options.opacity, left: 6+options.offset, top: 6+options.offset, width: baseWidth-1, height: baseHeight-1 }).appendTo(shadow); |
| 39 | $('<div class="fx-shadow-color fx-shadow-layer-1"></div>').css({ position: 'absolute', opacity: options.opacity - 0.05, left: options.offset, top: options.offset, width: baseWidth + 1, height: baseHeight + 1 }).appendTo($shadow); |
| 40 | $('<div class="fx-shadow-color fx-shadow-layer-2"></div>').css({ position: 'absolute', opacity: options.opacity - 0.10, left: options.offset + 2, top: options.offset + 2, width: baseWidth, height: baseHeight - 3 }).appendTo($shadow); |
| 41 | $('<div class="fx-shadow-color fx-shadow-layer-3"></div>').css({ position: 'absolute', opacity: options.opacity - 0.10, left: options.offset + 2, top: options.offset + 2, width: baseWidth - 3, height: baseHeight }).appendTo($shadow); |
| 42 | $('<div class="fx-shadow-color fx-shadow-layer-4"></div>').css({ position: 'absolute', opacity: options.opacity, left: options.offset + 1, top: options.offset + 1, width: baseWidth - 1, height: baseHeight - 1 }).appendTo($shadow); |
39 | | //Determine the stack order (attention: the zIndex will get one higher!) |
40 | | if(!cur.css("zIndex") || cur.css("zIndex") == "auto") { |
41 | | var stack = 0; |
42 | | cur.css("position", (cur.css("position") == "static" ? "relative" : cur.css("position"))).css("z-index", "1"); |
43 | | } else { |
44 | | var stack = parseInt(cur.css("zIndex")); |
45 | | cur.css("zIndex", stack+1); |
46 | | } |
| 47 | //Set zIndex +1 and make sure position is at least relative |
| 48 | //Attention: the zIndex will get one higher! |
| 49 | $element |
| 50 | .css({ |
| 51 | zIndex: zIndex + 1, |
| 52 | position: ($element.css("position") == "static" ? "relative" : "") |
| 53 | }); |
50 | | shadow.css({ |
51 | | position: "absolute", |
52 | | zIndex: stack, |
53 | | left: position.left, |
54 | | top: position.top, |
55 | | width: baseWidth, |
56 | | height: baseHeight, |
57 | | marginLeft: cur.css("marginLeft"), |
58 | | marginRight: cur.css("marginRight"), |
59 | | marginBottom: cur.css("marginBottom"), |
60 | | marginTop: cur.css("marginTop") |
| 57 | $shadow.css({ |
| 58 | position: "absolute", |
| 59 | zIndex: zIndex, |
| 60 | left: position.left+"px", |
| 61 | top: position.top+"px", |
| 62 | width: baseWidth, |
| 63 | height: baseHeight, |
| 64 | marginLeft: $element.css("marginLeft"), |
| 65 | marginRight: $element.css("marginRight"), |
| 66 | marginBottom: $element.css("marginBottom"), |
| 67 | marginTop: $element.css("marginTop") |
64 | | function rearrangeShadow(el,sh) { |
65 | | var $el = $(el); |
66 | | $(sh).css($el.position()); |
67 | | $(sh).children().css({ height: $el.outerHeight()+"px", width: $el.outerWidth()+"px" }); |
68 | | } |
| 71 | if ( options.monitor ) { |
| 72 | function rearrangeShadow() { |
| 73 | var $element = $(this), $shadow = $element.next(); |
| 74 | // $shadow.css( $element.position() ); |
| 75 | $shadow.css({ |
| 76 | top: parseInt($element.css("top")) +"px", |
| 77 | left: parseInt($element.css("left")) +"px" |
| 78 | }) |
| 79 | $(">*", $shadow).css({ height: this.offsetHeight+"px", width: this.offsetWidth+"px" }); |
| 80 | } |
70 | | if($.browser.msie) { |
71 | | //Add dynamic css expressions |
72 | | shadow[0].style.setExpression("left","parseInt(jQuery(this.previousSibling).css('left'))+'px' || jQuery(this.previousSibling).position().left"); |
73 | | shadow[0].style.setExpression("top","parseInt(jQuery(this.previousSibling).css('top'))+'px' || jQuery(this.previousSibling).position().top"); |
74 | | } else { |
75 | | //Bind events for good browsers |
76 | | this.addEventListener("DOMAttrModified",function() { rearrangeShadow(this,shadow); },false); |
| 82 | //Attempt to use DOMAttrModified event |
| 83 | $element.bind("DOMAttrModified", rearrangeShadow); |
| 84 | |
| 85 | // Use expressions if they exist (IE) |
| 86 | if( $shadow[0].style.setExpression ) { |
| 87 | $shadow[0].style.setExpression("left", "parseInt(jQuery(this.previousSibling).css('left')) + 'px'"); |
| 88 | $shadow[0].style.setExpression("top" , "parseInt(jQuery(this.previousSibling).css('top') ) + 'px'"); |
| 89 | } |