onmouseover images

onmouseover images

Post by Jake Morat » Fri, 11 Oct 2002 13:59:43


I have a number of imagebuttons on my asp.net page that change their image
when a mouse passes over them.  The images are changed using the following
code:

With ImageButton2.Attributes
                .Add("onmouseover", "src='loans2.gif'")
                .Add("onmouseout", "src='loans.gif'")
End With

This works fine although the onmouseover image has to be downloaded the
first time the user moves their mouse over a button and this can take a
couple of seconds.

Is there any way that these onmouseover images can be forced to download
when the page is initially downloaded?

TIA

Jake Morath

 
 
 

onmouseover images

Post by Vidar Petursso » Fri, 11 Oct 2002 18:43:21


Hi

You have to preload the images on the client

Basic example:

iPreload("image1.gif","image2.gif");

function iPreload(){
if( !document.images ) return;
var imageArr = new Array();
for(i = 0;i < iPreload.arguments.length;i++ )
   {
   imageArr[i] = new Image();
   imageArr[i].src = ( "IMAGEPATH/" + iPreload.arguments[i] );
   }
 }

P.S Use microsoft.public.scripting.jscript for client side issues

--
Best Regards
  Vidar Petursson
 ==============================
Microsoft Internet Client & Controls MVP
 ==============================

Quote:> I have a number of imagebuttons on my asp.net page that change their image
> when a mouse passes over them.  The images are changed using the following
> code:

> With ImageButton2.Attributes
>                 .Add("onmouseover", "src='loans2.gif'")
>                 .Add("onmouseout", "src='loans.gif'")
> End With

> This works fine although the onmouseover image has to be downloaded the
> first time the user moves their mouse over a button and this can take a
> couple of seconds.

> Is there any way that these onmouseover images can be forced to download
> when the page is initially downloaded?

> TIA

> Jake Morath


 
 
 

onmouseover images

Post by Jake » Fri, 11 Oct 2002 18:56:13


Thanks Vidar


> Hi

> You have to preload the images on the client

> Basic example:

> iPreload("image1.gif","image2.gif");

> function iPreload(){
> if( !document.images ) return;
> var imageArr = new Array();
> for(i = 0;i < iPreload.arguments.length;i++ )
>    {
>    imageArr[i] = new Image();
>    imageArr[i].src = ( "IMAGEPATH/" + iPreload.arguments[i] );
>    }
>  }

> P.S Use microsoft.public.scripting.jscript for client side issues

> --
> Best Regards
>   Vidar Petursson
>  ==============================
> Microsoft Internet Client & Controls MVP
>  ==============================


> > I have a number of imagebuttons on my asp.net page that change their
image
> > when a mouse passes over them.  The images are changed using the
following
> > code:

> > With ImageButton2.Attributes
> >                 .Add("onmouseover", "src='loans2.gif'")
> >                 .Add("onmouseout", "src='loans.gif'")
> > End With

> > This works fine although the onmouseover image has to be downloaded the
> > first time the user moves their mouse over a button and this can take a
> > couple of seconds.

> > Is there any way that these onmouseover images can be forced to download
> > when the page is initially downloaded?

> > TIA

> > Jake Morath

 
 
 

1. Is this image onmouseover effect posible ???

Hi

Im not sure on how to explain what i want but ill try and hope you
understand..

What i want is when the mouse is over a picture the picture size is
changed(it gets bigger) but the text most not move(maybe load it into a
layer or something witch is placed right on top of the small picture). And
of course it gets small/disapear again on the onmouseout.
Is this posible in asp.net ?, if not what about javascript.

Any source code either in asp.net(im using VB code) or in javascript and i
would appreciate it.

Martin

2. Filtering results in Crystal Reports

3. onmouseover

4. Linksys router trouble

5. How do we use ONMOUSEOVER with WAV files

6. lorado Jumbo 250 + OS/2 ---> Will it work?

7. How we tie to events with on onmouseover event?

8. MAC ON IBM

9. onmouseover problem

10. Render custom control with onmouseover event...

11. Newbie Howto: Create onMouseOver/onMouseOut and redirects using ImageButton

12. ToolTip/OnMouseOver property for DropList boxes

13. OnMouseOver effect