Lines Matching refs:element

28 Element.collectTextNodes = function(element) {
29 return $A($(element).childNodes).collect( function(node) {
35 Element.collectTextNodesIgnoreClass = function(element, className) {
36 return $A($(element).childNodes).collect( function(node) {
43 Element.setContentZoom = function(element, percent) {
44 element = $(element);
45 element.setStyle({fontSize: (percent/100) + 'em'});
47 return element;
50 Element.getInlineOpacity = function(element){
51 return $(element).style.opacity || '';
54 Element.forceRerendering = function(element) {
56 element = $(element);
58 element.appendChild(n);
59 element.removeChild(n);
68 message: 'The specified DOM element does not exist, but is required for this effect to operate'
107 tagifyText: function(element) {
111 element = $(element);
112 $A(element.childNodes).each( function(child) {
115 element.insertBefore(
124 multiple: function(element, effect) {
126 if (((typeof element == 'object') ||
127 Object.isFunction(element)) &&
128 (element.length))
129 elements = element;
131 elements = $(element).childNodes;
139 $A(elements).each( function(element, index) {
140 new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
148 toggle: function(element, effect) {
149 element = $(element);
152 queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
154 Effect[element.visible() ?
155 Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
355 initialize: function(element) {
356 this.element = $(element);
357 if (!this.element) throw(Effect._elementDoesNotExistError);
359 if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
360 this.element.setStyle({zoom: 1});
362 from: this.element.getOpacity() || 0.0,
368 this.element.setOpacity(position);
373 initialize: function(element) {
374 this.element = $(element);
375 if (!this.element) throw(Effect._elementDoesNotExistError);
384 this.element.makePositioned();
385 this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
386 this.originalTop = parseFloat(this.element.getStyle('top') || '0');
393 this.element.setStyle({
401 Effect.MoveBy = function(element, toTop, toLeft) {
402 return new Effect.Move(element,
407 initialize: function(element, percent) {
408 this.element = $(element);
409 if (!this.element) throw(Effect._elementDoesNotExistError);
423 this.elementPositioning = this.element.getStyle('position');
427 this.originalStyle[k] = this.element.style[k];
430 this.originalTop = this.element.offsetTop;
431 this.originalLeft = this.element.offsetLeft;
433 var fontSize = this.element.getStyle('font-size') || '100%';
445 this.dims = [this.element.offsetHeight, this.element.offsetWidth];
447 this.dims = [this.element.scrollHeight, this.element.scrollWidth];
455 this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
459 if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
476 this.element.setStyle(d);
481 initialize: function(element) {
482 this.element = $(element);
483 if (!this.element) throw(Effect._elementDoesNotExistError);
489 if (this.element.getStyle('display')=='none') { this.cancel(); return; }
493 this.oldStyle.backgroundImage = this.element.getStyle('background-image');
494 this.element.setStyle({backgroundImage: 'none'});
497 this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
499 this.options.restorecolor = this.element.getStyle('background-color');
505 this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
509 this.element.setStyle(Object.extend(this.oldStyle, {
515 Effect.ScrollTo = function(element) {
518 elementOffsets = $(element).cumulativeOffset();
532 Effect.Fade = function(element) {
533 element = $(element);
534 var oldOpacity = element.getInlineOpacity();
536 from: element.getOpacity() || 1.0,
540 effect.element.hide().setStyle({opacity: oldOpacity});
543 return new Effect.Opacity(element,options);
546 Effect.Appear = function(element) {
547 element = $(element);
549 from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
553 effect.element.forceRerendering();
556 effect.element.setOpacity(effect.options.from).show();
558 return new Effect.Opacity(element,options);
561 Effect.Puff = function(element) {
562 element = $(element);
564 opacity: element.getInlineOpacity(),
565 position: element.getStyle('position'),
566 top: element.style.top,
567 left: element.style.left,
568 width: element.style.width,
569 height: element.style.height
572 [ new Effect.Scale(element, 200,
574 new Effect.Opacity(element, { sync: true, to: 0.0 } ) ],
577 Position.absolutize(effect.effects[0].element);
580 effect.effects[0].element.hide().setStyle(oldStyle); }
585 Effect.BlindUp = function(element) {
586 element = $(element);
587 element.makeClipping();
588 return new Effect.Scale(element, 0,
593 effect.element.hide().undoClipping();
599 Effect.BlindDown = function(element) {
600 element = $(element);
601 var elementDimensions = element.getDimensions();
602 return new Effect.Scale(element, 100, Object.extend({
609 effect.element.makeClipping().setStyle({height: '0px'}).show();
612 effect.element.undoClipping();
617 Effect.SwitchOff = function(element) {
618 element = $(element);
619 var oldOpacity = element.getInlineOpacity();
620 return new Effect.Appear(element, Object.extend({
625 new Effect.Scale(effect.element, 1, {
629 effect.element.makePositioned().makeClipping();
632 effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
639 Effect.DropOut = function(element) {
640 element = $(element);
642 top: element.getStyle('top'),
643 left: element.getStyle('left'),
644 opacity: element.getInlineOpacity() };
646 [ new Effect.Move(element, {x: 0, y: 100, sync: true }),
647 new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
651 effect.effects[0].element.makePositioned();
654 effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
659 Effect.Shake = function(element) {
660 element = $(element);
668 top: element.getStyle('top'),
669 left: element.getStyle('left') };
670 return new Effect.Move(element,
672 new Effect.Move(effect.element,
674 new Effect.Move(effect.element,
676 new Effect.Move(effect.element,
678 new Effect.Move(effect.element,
680 new Effect.Move(effect.element,
682 effect.element.undoPositioned().setStyle(oldStyle);
686 Effect.SlideDown = function(element) {
687 element = $(element).cleanWhitespace();
688 // SlideDown need to have the content of the element wrapped in a container element with fixed height!
689 var oldInnerBottom = element.down().getStyle('bottom');
690 var elementDimensions = element.getDimensions();
691 return new Effect.Scale(element, 100, Object.extend({
698 effect.element.makePositioned();
699 effect.element.down().makePositioned();
700 if (window.opera) effect.element.setStyle({top: ''});
701 effect.element.makeClipping().setStyle({height: '0px'}).show();
704 effect.element.down().setStyle({bottom:
705 (effect.dims[0] - effect.element.clientHeight) + 'px' });
708 effect.element.undoClipping().undoPositioned();
709 effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
714 Effect.SlideUp = function(element) {
715 element = $(element).cleanWhitespace();
716 var oldInnerBottom = element.down().getStyle('bottom');
717 var elementDimensions = element.getDimensions();
718 return new Effect.Scale(element, window.opera ? 0 : 1,
726 effect.element.makePositioned();
727 effect.element.down().makePositioned();
728 if (window.opera) effect.element.setStyle({top: ''});
729 effect.element.makeClipping().show();
732 effect.element.down().setStyle({bottom:
733 (effect.dims[0] - effect.element.clientHeight) + 'px' });
736 effect.element.hide().undoClipping().undoPositioned();
737 effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom});
743 // Bug in opera makes the TD containing this element expand for a instance after finish
744 Effect.Squish = function(element) {
745 return new Effect.Scale(element, window.opera ? 1 : 0, {
748 effect.element.makeClipping();
751 effect.element.hide().undoClipping();
756 Effect.Grow = function(element) {
757 element = $(element);
765 top: element.style.top,
766 left: element.style.left,
767 height: element.style.height,
768 width: element.style.width,
769 opacity: element.getInlineOpacity() };
771 var dims = element.getDimensions();
803 return new Effect.Move(element, {
808 effect.element.hide().makeClipping().makePositioned();
812 [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
813 new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
814 new Effect.Scale(effect.element, 100, {
819 effect.effects[0].element.setStyle({height: '0px'}).show();
822 effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);
830 Effect.Shrink = function(element) {
831 element = $(element);
839 top: element.style.top,
840 left: element.style.left,
841 height: element.style.height,
842 width: element.style.width,
843 opacity: element.getInlineOpacity() };
845 var dims = element.getDimensions();
871 [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
872 new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
873 new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
876 effect.effects[0].element.makePositioned().makeClipping();
879 effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
884 Effect.Pulsate = function(element) {
885 element = $(element);
887 oldOpacity = element.getInlineOpacity(),
893 return new Effect.Opacity(element,
895 afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
899 Effect.Fold = function(element) {
900 element = $(element);
902 top: element.style.top,
903 left: element.style.left,
904 width: element.style.width,
905 height: element.style.height };
906 element.makeClipping();
907 return new Effect.Scale(element, 5, Object.extend({
911 new Effect.Scale(element, 1, {
915 effect.element.hide().undoClipping().setStyle(oldStyle);
921 initialize: function(element) {
922 this.element = $(element);
923 if (!this.element) throw(Effect._elementDoesNotExistError);
933 this.element.addClassName(options.style);
934 this.style = $H(this.element.getStyles());
935 this.element.removeClassName(options.style);
936 var css = this.element.getStyles();
941 effect.element.addClassName(effect.options.style);
943 effect.element.style[transform.style] = '';
967 if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
968 this.element.setStyle({zoom: 1});
975 var originalValue = this.element.getStyle(property);
1006 this.element.setStyle(style, true);
1074 Element.getStyles = function(element) {
1075 var css = document.defaultView.getComputedStyle($(element), null);
1082 Element.getStyles = function(element) {
1083 element = $(element);
1084 var css = element.currentStyle, styles;
1089 if (!styles.opacity) styles.opacity = element.getOpacity();
1095 morph: function(element, style) {
1096 element = $(element);
1097 new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { }));
1098 return element;
1100 visualEffect: function(element, effect, options) {
1101 element = $(element);
1103 new Effect[klass](element, options);
1104 return element;
1106 highlight: function(element, options) {
1107 element = $(element);
1108 new Effect.Highlight(element, options);
1109 return element;
1116 Effect.Methods[effect] = function(element, options){
1117 element = $(element);
1118 Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options);
1119 return element;