Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


vbscript mouseover, how?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,185
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> vbscript mouseover, how?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 vbscript mouseover, how? - 6/18/2001 7:19:16 AM   
  ekiko

 

Posts: 14
Score: 0
Joined: 5/23/2001
From: New Zealand
Status: offline
I am trying to do a vbscript mouseover so that i can change an img
src file to another img src file in html...how would i do this?
 
 
Post #: 1
 
 Re: vbscript mouseover, how? - 6/18/2001 7:23:51 AM   
  subnation

 

Posts: 20
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
I not an experience programmer, but as I have surfed the web for
tips and tricks I have found a few sites the do mouseover in
Javascript (www.inforhiway.com/javascript/index.htm,
www.wsabstract.com, and
hotwired.lycos.com/webmonkey/index.html). You can use these
scripts within vbscripts and they should work.

(in reply to ekiko)
 
 
Post #: 2
 
 RE: Re: vbscript mouseover, how? - 3/12/2008 9:16:36 AM   
  TNO


Posts: 1240
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Sorry for the necro bump of times past, but I was browsing the active topics list and saw a couple people on this.

There are a variety of methods for mouseover effects in html/hta pages. perhaps the BEST way to do it is using CSS vice vbscript:

Lets say I'm using a div tag as such:

<div id="myPicture"></div>

In my css at the top of the page (between <head> and </head>) I would have this:

<style type="text/css">

#myPicture{
background:url(mypic.jpg);
}
#myPicture:hover{
background:url(anotherPic.jpg);
}

</style>

So a sample page would look like this:


      

Note: I assume you have at least IE7 installed for this and have a valid doctype at the top of your page. If you do not, you have to use an <a> tag for this effect since instead of <div> IE6 is buggy in this regard.

For those who would prefer a vbscript solution, it would work as such:

<img src="foo.jpg" onmouseover="this.src='bar.jpg'" onmouseout="this.src='foo.jpg'" />

One of the numerous reasons I don't suggest this method (beside aesthetics) is the possibility of memory leaks occurring.

Edit: Bug fix, and added a working sample

< Message edited by TNO -- 3/12/2008 9:32:24 AM >


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to subnation)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> vbscript mouseover, how? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts