Namespace: ads

db.libs.ads

Ads.

Source:

Members

(static) adunits :nodelist

Cached list of all adunits
Type:
nodelist
Source:

(static) fullscreens :array

Cached list of all fullscreen adunits
Type:
array
Source:

(static) scaleable :array

Cached list of all scaleable adunits
Type:
array
Source:

(static) stickies :array

Cached list of all sticky adunits
Type:
array
Source:

Methods

(static) init()

Initialize the component

Source:

(private, static) scale()

Scale all adunits to fit within given frame.

Source:

(static) setSize(message)

Sets size for adunit.

Parameters:
Name Type Description
message object
Properties
Name Type Description
frame string Name of the frame posting the message
size string Classname refering to the desired size
Source:
Example:
window.parent.postMessage({ callback: 'db.libs.ads.size', size: 'large-980x300', frame: window.name }, 'http://dagbadet.no');

(static) setWallpaper(message) → {element}

Set wallpaper. This function can be given as a callback to postMessage from within an iframe to allow ads to set the a wallpaper ad.

Parameters:
Name Type Description
message object
Properties
Name Type Description
frame string Name of the frame posting the message
src string Url to image to be used as wallpaper
url string Url to trigger when clicked
Source:
Returns:
Type
element

Example:

Example using as a callback and postMessage

window.parent.postMessage({ callback: 'db.libs.ads.setWallpaper', src: 'http://…', url: 'http://…', frame: window.name }, 'http://dagbadet.no');

(private, static) updateFullscreen()

Updates visibility of fullscreen ads. This function is bound to window scroll event and throttled.

Source:

(private, static) updateSticky()

Updates poisition and state of sticky adunits. This function is bound to window scroll event and throttled.

Source: