- Messages
- 5,257
- Reaction score
- 97
- Points
- 48
Helloo,
I'm working on a script ( http://paperhub.x10hosting.com/sigbar ) but I am having trouble with some DHTML. The code so far:
The second bit of js code obviously doesn't work, but it makes it easier to understand what I'm trying to do. How would I make it work?
~Callum
Edit:
The first bit of javascript isn't working either any more :/
~Callum
I'm working on a script ( http://paperhub.x10hosting.com/sigbar ) but I am having trouble with some DHTML. The code so far:
HTML:
<p><a class="colour" id="black" onMouseOver="createcolour('black')" style="font-weight:bold" onclick="bold('black')">Black</a>
<a class="colour" id="red" onMouseOver="createcolour('red')" onclick="bold('red')">Red</a>
<a class="colour" id="orange" onMouseOver="createcolour('orange')" onclick="bold('orange')">Orange</a>
<a class="colour" id="yellow" onMouseOver="createcolour('yellow')" onclick="bold('yellow')">Yellow</a>
<a class="colour" id="green" onMouseOver="createcolour('green')" onclick="bold('green')" weight="bold">Green</a>
<a class="colour" id="blue" onMouseOver="createcolour('blue')" onclick="bold('blue')">Blue</a>
<a class="colour" id="purple" onMouseOver="createcolour('purple')" onclick="bold('purple')">Purple</a></p>
<img src="original/black.jpg" id="previewcolour" alt="" />
Code:
function createcolour(colour){
document.getElementById('previewcolour').src = 'original/'+colour+'.jpg';
document.getElementById('previewstyle').src = 'original/'+colour+'.jpg';
}
function bold(boldcolour){
alert(boldcolour);
document.getElementByClass('colour').font-weight = 'normal';
document.getElementById(boldcolour).font-weight = 'bold';
}
The second bit of js code obviously doesn't work, but it makes it easier to understand what I'm trying to do. How would I make it work?
~Callum
Edit:
The first bit of javascript isn't working either any more :/
~Callum
Last edited: