In Cjax, you can control most HTML objects/elements with the $ajax object. You can also control JavaScript Objects and functions of other scrips. Cjax allows not only to control the main properties of an object/element, but it allows you to controll All properies of that element, including but not limited to style, DOM, colors, fonts, shapes, and everything in between.
Property changing in Cjax is very simple, and all changes accumulate. If you apply properties to an element, and apply some more, all will accumulate not overwrite.
Examples
Lets say you have a div with id "my_div" on your HTML page. You want to change the width and height of this div. Here is how you'd do it with Cjax.PHP
<?php
$ajax->my_div = array('width' => 200,'height'=> 100);
?>
To update the style property of an element follow the same logic as before:
PHP
<?php
$ajax->my_div = array(
'style' => array(
'width' => '200px',
'height' => '100px',
'borderStyle' => 'solid',
'borderWidth' => '1px'
)
);
?>
All properies will be applied to the element, you can however overwrite specific properties. If the same property is being use the latest one will stand.
In the example below all properties are taken into account, however the style property width and height will overwrite the previous width and height set.
PHP
<?php
$ajax->my_image = 'http://cjax.sourceforge.net/media/logo.png';
$ajax->my_image = array('width' => 200,'height'=> 100, 'alt' => 'this is a logo');
$ajax->my_image = array(
'style' => array(
'width' => '200px',
'height' => '100px',
'borderStyle' => 'solid',
'borderWidth' => '1px'
)
);
?>