コード例 #1
0
ファイル: dom_templates.php プロジェクト: vladisslav2011/nb
$div = new dom_div();
$div->name = '1';
$div->css_style['background-color'] = 'red';
$div->css_style['width'] = '15em';
$div->css_style['height'] = 'auto';
$div->css_style['position'] = 'absolute';
$div->css_style['left'] = '50';
$div->css_style['top'] = '50';
$text = new dom_statichtml();
$text->text = "<u>krossafcheg </u>\n<br>";
$test->append_child($div);
$div_id = $div->id;
$div = new dom_div();
$div->name = '2';
$div->css_style = 'background-color:green;width:15em;height:40px;position:absolute;left:50;top:150;';
$div->css_toarray();
$tbl = array_to_table_div($div->css_style);
//$tbl=array_to_table($div->css_style);
$test->append_child($div);
$olddiv = $test->byid($div_id);
for ($k = 1; $k <= 5; $k++) {
    $olddiv->append_child($text);
}
$olddiv->css_style['left'] = 250;
$div->css_tostring();
$olddiv->attributes['onmousedown'] = 'this.innerHTML += "fakamaka! <br>";';
$olddiv->attributes['onmouseup'] = 'this.innerHTML += "muthafaka! <br>";';
$text = new dom_complex_test();
$text->value = 'krossafcheg';
$text->css_style['color'] = 'gray';
$text->css_style['height'] = 'auto';