[][src]Function div::init_ex_with_element

pub fn init_ex_with_element(
    root: Element,
    pos: (u32, u32),
    size: Option<(u32, u32)>
) -> Result<(), DivError>

Extended initialization function. Mounts a global div as a child of the element provided. The specified dimensions restrict the area in which divs are visible.

Example

let width = 1280;
let height = 720;
let root = web_sys::window().unwrap().document().unwrap().get_element_by_id("my-root-id").unwrap();
div::init_ex_with_element(root, (0, 0), Some((width, height)));