UI. IframeShim

Handles IE6 bug when <select> elements overlap other elements with higher z-index

Example

// creates iframe and positions it under "contextMenu" element
this.iefix = new UI.IframeShim().positionUnder('contextMenu');
...
document.observe('click', function(e) {
  if (e.isLeftClick()) {
    this.contextMenu.hide();

    // hides iframe when left click is fired on a document
    this.iefix.hide();
  }
}.bind(this))
...
Summary
Handles IE6 bug when <select> elements overlap other elements with higher z-index
Constructor
Hides iframe shim leaving its position and dimensions intact
Show iframe shim leaving its position and dimensions intact
Positions iframe shim under the specified element Sets proper dimensions, offset, zIndex and shows it Note that the element should have explicitly specified zIndex
Sets element’s width, height, top and left css properties using ‘px’ as units
Completely removes the iframe shim from the document

Functions

initialize

initialize: function()

Constructor

Creates iframe shim and appends it to the body.  Note that this method does not perform proper positioning and resizing of an iframe.  To do that use positionUnder method

Returns

this

hide

hide: function()

Hides iframe shim leaving its position and dimensions intact

Returns

this

show

show: function()

Show iframe shim leaving its position and dimensions intact

Returns

this

positionUnder

positionUnder: function(element)

Positions iframe shim under the specified element Sets proper dimensions, offset, zIndex and shows it Note that the element should have explicitly specified zIndex

Returns

this

setBounds

setBounds: function(bounds)

Sets element’s width, height, top and left css properties using ‘px’ as units

Returns

this

destroy

destroy: function()

Completely removes the iframe shim from the document

Returns

this

initialize: function()
Constructor
hide: function()
Hides iframe shim leaving its position and dimensions intact
show: function()
Show iframe shim leaving its position and dimensions intact
positionUnder: function(element)
Positions iframe shim under the specified element Sets proper dimensions, offset, zIndex and shows it Note that the element should have explicitly specified zIndex
setBounds: function(bounds)
Sets element’s width, height, top and left css properties using ‘px’ as units
destroy: function()
Completely removes the iframe shim from the document