Class TIFrameRotator
The TIFrameRotator object is used to rotate several URLs in an IFRAME based on their priority.
Defined in: <class.iframerotator.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
TIFrameRotator(width, height)
Construct a new TIFrameRotator object.
|
| Field Attributes | Field Name and Description |
|---|---|
|
Properties used when creating new IFRAME object via #Create.
|
| Method Attributes | Method Name and Description |
|---|---|
|
AddURL(url, priority)
Adds another URL for rotation within the IFRAME
|
|
|
Attach(idIframe)
Attach already existing IFRAME DOM object to this class.
|
|
|
Create(owner, idName)
Create new IFRAME DOM object under specified "owner".
|
|
|
DOM object of IFRAME
|
|
|
Rotate()
Show next URL within IFRAME (Based on weighted priority specified with #AddURL).
|
Field Detail
{array}
properties
Properties used when creating new IFRAME object via #Create.
Possible properties to set:
Possible properties to set:
- width
- height
- frameBorder
- marginWidth
- marginHeight
- scrolling
- allowTransparency
var iframe = TIFrameRotator(); iframe.properties["width"] = 300; iframe.properties["height"] = 250; iframe.properties["scrolling"] = "no"; iframe.Create(document.body, "idAd300x250");
Method Detail
AddURL(url, priority)
Adds another URL for rotation within the IFRAME
- Parameters:
- {string} url
- URL to content to display within IFRAME.
- {int} priority
- The weighted priority of the content which must be a value > 0.
An URL with a priority of 80 will display twice as much as an URL with a priority of 40, and 4 times as much as an URL with a priority of 20. The priority can thus be very useful - for example in displaying higher paying advertisement code more often.
Attach(idIframe)
Attach already existing IFRAME DOM object to this class. (See #Create for dynamically creating IFRAME objects)
- Parameters:
- {string/object} idIframe
- DOM object or DOM object ID of IFRAME to attach.
Create(owner, idName)
Create new IFRAME DOM object under specified "owner". (See #Attach for attaching existing IFRAME objects)
Note that IFRAME properties are assigned from #properties. You must change the properties BEFORE calling Create for them to apply. Changing them after Create will have no effect. (You can still change the properties directly on the DOM object retrieved via #getIframe).
Note that IFRAME properties are assigned from #properties. You must change the properties BEFORE calling Create for them to apply. Changing them after Create will have no effect. (You can still change the properties directly on the DOM object retrieved via #getIframe).
- Parameters:
- {string/object} owner
- DOM object or DOM object ID under which to create IFRAME DOM object as child.
- {string} idName
- The IFRAME's DOM ID.
{DOM_Object}
getIframe()
DOM object of IFRAME
- Returns:
- {DOM_Object} Returns DOM object of created/attached IFRAME.
Rotate()
Show next URL within IFRAME (Based on weighted priority specified with #AddURL).