SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: OnMouseOver

Hybrid View

  1. #1
    SitePoint Zealot Harvy's Avatar
    Join Date
    Feb 2002
    Location
    Aberdeen, Scotland
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OnMouseOver

    Ok i cant seem to figure this out i have a mouseover working which changes a image but i would also like it to change the status bar with mouseover can anyone help.

    Here is the relative code.
    Code:
    <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
    	<!-- Hide script from old browsers
    
    	if (document.images) {
    		menusep = new Image
    		menusep2 = new Image
    
    		menusep.src = "images/menusep.gif"
    		menusep2.src = "images/menusep2.gif"
    	}
    	else {
    		menusep = ""
    		menusep2 = ""
    		document.arrow = ""
    		document.arrow1 = ""
    		document.arrow2 = ""
    		document.arrow3 = ""
    		document.arrow4 = ""
    		document.arrow5 = ""
    		document.arrow6 = ""
    		document.arrow7 = ""
    		document.arrow8 = ""
    
    	}
    
    	// End hiding script from old browsers -->
    </SCRIPT>
    
    <A target=main onMouseOver="document.arrow.src=menusep2.src" onMouseOut="document.arrow.src=menusep.src" id="menucontent" HREF="http://www.tomowebsite.com/fc3/main.php">Home</A><BR>
    <IMG SRC="images/menusep.gif" WIDTH="120" HEIGHT="4" BORDER=0 ALT="" name="arrow"><BR>

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The javascript to change the status bar is:

    window.status='text here'

    You can seperate commands in an onMouseOver="" bit with semicolons. Hence the following code should work:
    Code:
    <a target="main"
    onMouseOver="document.arrow.src=menusep2.src;window.status='some text';"
    onMouseOut="document.arrow.src=menusep.src;window.status='';"
    id="menucontent"
    href="http://www.tomowebsite.com/fc3/main.php">Home</a>
    I split the code on to seperate lines for readability - it should still be valid HTML but you can get rid of the newlines if you like.

  3. #3
    SitePoint Zealot Harvy's Avatar
    Join Date
    Feb 2002
    Location
    Aberdeen, Scotland
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats Great thanks alot.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •