Thread: VBhelp

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    3
    Rep Power
    0
    I'm new to VBscript but I know the basics of it...

    but I have a problem...I'm trying to creat a rollover image without much succes...so if you got a sullotion to my problem, please post a reply

    Cheers!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2001
    Location
    UK
    Posts
    527
    Rep Power
    14
    If you use javascript it will work with netscape as well:


    <a href="somewhere.html"
    onMouseOver="document.images[imageno].src='mybutton1.gif';"
    onMouseOut="document.images[imageno].src='mybutton.gif';" >
    <IMG src="mybutton.gif">
    </a>

    use the mouseover of an <a> tag. If you don't want a link change the href to:

    href=javascript:void()

    this will give you a link that does nothing.

    The image number is the number of the image in the document. Your first image is 0. You could give them ids instead if you want.

    John
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    3
    Rep Power
    0
    ok

    thanks!

    I'm starting out with VB script cause it so darn easier than javascript...I will move on to javascript when I feel confident enough..

    Thanks for the code john!
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2001
    Location
    UK
    Posts
    527
    Rep Power
    14
    Ok try this

    <SCRIPT LANGUAGE="VBScript">
    sub image1_onMouseOver
    image1.src="mybutton1.gif"
    end sub
    sub image1_onMouseOut
    image1.src="mybutton.gif"
    end sub
    </script>

    <IMG id='image1' src="mybutton.gif">


    John

    VBScript looks easier if you're used to VBasic but actually the basics are similar. I think this method of trapping mouse events is really "neat".

    [Edited by JohnB on 03-11-2001 at 09:49 AM]

IMN logo majestic logo threadwatch logo seochat tools logo