DFrame: setContentBgColor

Set the color for the page inserted in the DFrame

Example

In a page inserted in a DFrame:

function onLoadDFrame() {

if (dFrame.getEditMode()) thisDFrame.setBackgroundColor('yellow')

else thisDFrame. setBackgroundColor('red')

}

Demo

file: onLoadDframe.html

Run the example
See the source code

Syntax

DFrame.setContentBgColor(color)

Parameters

color

§         the color, in browser compatible format (hexa RGB or color code)

§         '' (empty string) or false: No color is set to the content document.

§         null: The color of the content document is set to transparent. To be used if there is a contentBgImage

Return value

No return value

Usage

This method allows to set or modify the color of the DFrame's content.

The setContentBgColor is a method of DFrameStyle and, as all methods of Styles apply to the corresponding objects, also a method of DFrame. The normal way of those methods is to store properties of Styles and retrieve them to the object when creation occurs. This one is special as it has also dynamic effects: The background color is set even if the DFrame is already created.