No! Ha! This must be getting close though, right?
http://www.suresure.co.uk/Temp/BM3.html
I now have this:
Uncaught TypeError: Cannot call method 'replace' of undefined (repeated 2 times)
underneath this:
this.class = this.class.replace(/\senlarged/,"");
Thanks for sticking with this...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title></title>
<style type="text/css">
img:hover{
cursor: pointer;
}
</style>
<script type="text/javascript">
function toggle() {
if (this.class !== undefined && this.class.match(/enlarged/) === null) {
this.class += " enlarged";
this.width = this.width * 2;
this.height = this.height * 2;
} else {
this.class = this.class.replace(/\senlarged/,"");
this.width = this.width / 2;
this.height = this.height / 2;
}
return true;
}
</script>
</head>
<body>
<img src="biscuitman.svg" onclick="toggle(this)"/>
<img src="biscuitman.svg" onclick="toggle()"/>
</body>
</html>