PDA

View Full Version : Create an IF statement ?? Help



maxvee8
Feb 29th, 2008, 12:47 AM
ok i have a check box that if it is checked needs to change the image of something how would i do it look at the code.

i dont know how to structure it correctly ...




if{
document.getElementById("hotspotCheckbox").checked = true;

var iconBlue = new GIcon();
iconBlue.image = 'http://maxstanworth.com/googletestmap/images/red_circle_trans.png';
iconBlue.iconSize = new GSize(12, 20);
iconBlue.shadowSize = new GSize(22, 20);
iconBlue.iconAnchor = new GPoint(6, 20);
iconBlue.infoWindowAnchor = new GPoint(5, 1);

}else{

var iconBlue = new GIcon();
iconBlue.image = 'http://maxstanworth.com/googletestmap/images/red_circle_trans.png';
iconBlue.iconSize = new GSize(12, 20);
iconBlue.shadowSize = new GSize(22, 20);
iconBlue.iconAnchor = new GPoint(6, 20);
iconBlue.infoWindowAnchor = new GPoint(5, 1);
}



HELLPPP AHHH confused!

CSSjunkie
Feb 29th, 2008, 01:03 AM
Try this:


if(document.getElementById("hotspotCheckbox").checked == true)
{
var iconBlue = new GIcon();
iconBlue.image = 'http://maxstanworth.com/googletestmap/images/red_circle_trans.png';
iconBlue.iconSize = new GSize(12, 20);
iconBlue.shadowSize = new GSize(22, 20);
iconBlue.iconAnchor = new GPoint(6, 20);
iconBlue.infoWindowAnchor = new GPoint(5, 1);

}else{

var iconBlue = new GIcon();
iconBlue.image = 'http://maxstanworth.com/googletestmap/images/red_circle_trans.png';
iconBlue.iconSize = new GSize(12, 20);
iconBlue.shadowSize = new GSize(22, 20);
iconBlue.iconAnchor = new GPoint(6, 20);
iconBlue.infoWindowAnchor = new GPoint(5, 1);
}


If that doesn't work, try changing the 1st line to:

if(
document.getElementById("hotspotCheckbox").checked == "checked")