geebee08
07-25-2008, 01:20 AM
hi, i have some code i'm trying to adapt from using an image to using text. right now i have a "box" image that has mouseover, select and deselect functions. i'd like to use text instead. is this possible with this piece of code? here's what i'm using, any thoughts appreciate.
function boxMouseOver (num) {
document.images['box' + num].src = 'images/box_on.gif';
}
function boxSelect (num) {
if ( boxSelected )
document.images['box' + boxSelected].src = 'images/box_off.gif';
boxMouseOver (num);
boxSelected = num;
makeInActive('info');
}
function boxDeSelect () {
if ( boxSelected )
document.images['box' + boxSelected].src = 'images/box_off.gif';
boxSelected = 0;
}
function boxMouseOut (num) {
if ( boxSelected != num )
document.images['box' + num].src = 'images/box_off.gif';
}
function makeActive (targetId)
{
if (document.getElementById)
{
target = document.getElementById( targetId );
if (target)
target.className = "active";
}
}
function makeInActive (targetId)
{
if (document.getElementById)
{
target = document.getElementById( targetId );
if (target)
target.className = "inactive";
}
}
here's the line
<a href="javascript://" onClick="boxSelect(1); onMouseOver="boxMouseOver (1)" onMouseOut="boxMouseOut(1)"><IMG SRC="images/box_on.gif" WIDTH="13" HEIGHT="18" name="box1" border=0></a>
function boxMouseOver (num) {
document.images['box' + num].src = 'images/box_on.gif';
}
function boxSelect (num) {
if ( boxSelected )
document.images['box' + boxSelected].src = 'images/box_off.gif';
boxMouseOver (num);
boxSelected = num;
makeInActive('info');
}
function boxDeSelect () {
if ( boxSelected )
document.images['box' + boxSelected].src = 'images/box_off.gif';
boxSelected = 0;
}
function boxMouseOut (num) {
if ( boxSelected != num )
document.images['box' + num].src = 'images/box_off.gif';
}
function makeActive (targetId)
{
if (document.getElementById)
{
target = document.getElementById( targetId );
if (target)
target.className = "active";
}
}
function makeInActive (targetId)
{
if (document.getElementById)
{
target = document.getElementById( targetId );
if (target)
target.className = "inactive";
}
}
here's the line
<a href="javascript://" onClick="boxSelect(1); onMouseOver="boxMouseOver (1)" onMouseOut="boxMouseOut(1)"><IMG SRC="images/box_on.gif" WIDTH="13" HEIGHT="18" name="box1" border=0></a>