SoFunction
Updated on 2025-04-14

HTML Component(HTC) small application


////////////////////////////////////////////////////////////////////////////////////////
//Add four mouse events to "behavior"
<PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="glowit()"/>  
<PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="noglow()"/>  
<PUBLIC:ATTACH EVENT="onmousedown" ONEVENT="font2yellow()"/>  
<PUBLIC:ATTACH EVENT="onmouseup" ONEVENT="font2blue()"/>  
//Define two methods for "behavior", note that the value of NAME cannot be added with brackets.
<PUBLIC:METHOD NAME="move_down"/>  
<PUBLIC:METHOD NAME="move_right"/>  
<script language ="JScript">  
//Define a variable that saves the font color
var font_color;  
//Define a method to move text downward
function move_down()  
{  
     += 10;  
}  
//Define the method of moving text to the right
function move_right()  
{  
     += 10;  
}  
//Define the calling function of the mouse onmouseup event
function font2blue() 
{  
    if ( == element)  
    {  
         = "blue";  
    }  
}  
//Define the calling function of the mouse onmousedown event
function font2yellow() 
{  
    if ( == element)  
    {  
         = "yellow";  
    }  
}  
//Define the calling function of the mouse onmouseover event
function glowit()  
{  
    if ( == element)  
    {  
        font_color=;  
         = "white";  
         = "glow(color=red, strength=2)";  
    }  
}  
//Define the calling function of the mouse onmouseout event
function noglow()  
{  
    if ( == element)  
    {  
         = "";  
         = font_color;  
    }  
}  
</script>  
////////////////////////////////////////////////////////////////////////////////////////////////