Background Color Changed

[Total: 0    Average: 0/5]

This example shows how to change the background of any component you have.

Head Code:

<script src="http://www.js-examples.com/bin/div_construct.js"></script>
<script>
var _msg='SAMPLE TEXT<BR><a href="javascript:colorIt1()">Change background color to gold</a>';
//function NewDiv(window, id, body, left, top, width, height, zIndex, absolute) {
var _d = new NewDiv(window,"d0",_msg,0,0,300,300,1,"RELATIVE");
</script>

Body Code:

<script>
_d.output();
_d.setBgColor("red");
function colorIt1() {
  var _msg1='SAMPLE TEXT<BR><a href="javascript:colorIt2()">Change background color to red</a>';
  _d.setBody(_msg1);
  _d.setBgColor("gold");
}
function colorIt2() {
  var _msg1='SAMPLE TEXT<BR><a href="javascript:colorIt1()">Change background color to gold</a>';
  _d.setBody(_msg1);
  _d.setBgColor("red");
}
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *