Hi,
I am trying to have a menu item (which is an HTML img) to
change as a mouse moves over it. So, my code looks
something like this:
<a
onmouseover="ActivateImage('MyImage');"
onmouseout="InactivateImage('MyImage');"
href="javascript:void(FollowLink('MyImage'));">
<IMG height="22" src="Image1.gif" name="MyImage">
</a>
<script>
function ActivateImage(ImageName)
{
document.images(ImageName).src = "Image2.gif"
}
function InactivateImage(ImageName)
{
document.images(ImageName).src = "Image1.gif"
}
</script>
I have about 20 images setup in the similar way on my
page.
The problem is that when the page is loading, it seems
that only the images that are specified in my HTML are
loaded. The other images start loading as I move mouse
over original images. So, since it takes a whlie for those
alternate images to load, the very first time I move mouse
over an image and then quickly move it away the switch
doesn't happen.
Is there any way to make sure that my alternate images get
loaded with my page right away? Or should I use a
different approach all together?
Thanks a lot for any help.
VR 4 1607
You need to use javascript for this, I personally use Macromedia Dreamweaver
to set this kind of thing up
Try a search on google for "preloading images"
"VR" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl... Hi,
I am trying to have a menu item (which is an HTML img) to change as a mouse moves over it. So, my code looks something like this:
<a onmouseover="ActivateImage('MyImage');" onmouseout="InactivateImage('MyImage');" href="javascript:void(FollowLink('MyImage'));"> <IMG height="22" src="Image1.gif" name="MyImage"> </a>
<script> function ActivateImage(ImageName) { document.images(ImageName).src = "Image2.gif" }
function InactivateImage(ImageName) { document.images(ImageName).src = "Image1.gif" } </script>
I have about 20 images setup in the similar way on my page.
The problem is that when the page is loading, it seems that only the images that are specified in my HTML are loaded. The other images start loading as I move mouse over original images. So, since it takes a whlie for those alternate images to load, the very first time I move mouse over an image and then quickly move it away the switch doesn't happen.
Is there any way to make sure that my alternate images get loaded with my page right away? Or should I use a different approach all together?
Thanks a lot for any help.
VR
You need to use JavaScript to preload the images. However, preloading
images is sometimes ignored if a user has changed their browser's settings.
The safest way to do this, is to load all the images into two or more
layers, and then show/hide the layers accordingly.
Mun
"VR" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl... Hi,
I am trying to have a menu item (which is an HTML img) to change as a mouse moves over it. So, my code looks something like this:
<a onmouseover="ActivateImage('MyImage');" onmouseout="InactivateImage('MyImage');" href="javascript:void(FollowLink('MyImage'));"> <IMG height="22" src="Image1.gif" name="MyImage"> </a>
<script> function ActivateImage(ImageName) { document.images(ImageName).src = "Image2.gif" }
function InactivateImage(ImageName) { document.images(ImageName).src = "Image1.gif" } </script>
I have about 20 images setup in the similar way on my page.
The problem is that when the page is loading, it seems that only the images that are specified in my HTML are loaded. The other images start loading as I move mouse over original images. So, since it takes a whlie for those alternate images to load, the very first time I move mouse over an image and then quickly move it away the switch doesn't happen.
Is there any way to make sure that my alternate images get loaded with my page right away? Or should I use a different approach all together?
Thanks a lot for any help.
VR
Do you have by any chance any links/samples of using layers?
Thanks for your help.
VR
"Munsifali Rashid" <mun@**RemoveToReply**vefuk.com> wrote in message
news:Oc**************@TK2MSFTNGP09.phx.gbl... You need to use JavaScript to preload the images. However, preloading images is sometimes ignored if a user has changed their browser's
settings. The safest way to do this, is to load all the images into two or more layers, and then show/hide the layers accordingly.
Mun
"VR" <an*******@discussions.microsoft.com> wrote in message news:04****************************@phx.gbl... Hi,
I am trying to have a menu item (which is an HTML img) to change as a mouse moves over it. So, my code looks something like this:
<a onmouseover="ActivateImage('MyImage');" onmouseout="InactivateImage('MyImage');" href="javascript:void(FollowLink('MyImage'));"> <IMG height="22" src="Image1.gif" name="MyImage"> </a>
<script> function ActivateImage(ImageName) { document.images(ImageName).src = "Image2.gif" }
function InactivateImage(ImageName) { document.images(ImageName).src = "Image1.gif" } </script>
I have about 20 images setup in the similar way on my page.
The problem is that when the page is loading, it seems that only the images that are specified in my HTML are loaded. The other images start loading as I move mouse over original images. So, since it takes a whlie for those alternate images to load, the very first time I move mouse over an image and then quickly move it away the switch doesn't happen.
Is there any way to make sure that my alternate images get loaded with my page right away? Or should I use a different approach all together?
Thanks a lot for any help.
VR
Thanks.
VR
"Joe Gass" <jo*@dontspamme.com> wrote in message
news:OW*************@TK2MSFTNGP10.phx.gbl... You need to use javascript for this, I personally use Macromedia
Dreamweaver to set this kind of thing up Try a search on google for "preloading images"
"VR" <an*******@discussions.microsoft.com> wrote in message news:04****************************@phx.gbl... Hi,
I am trying to have a menu item (which is an HTML img) to change as a mouse moves over it. So, my code looks something like this:
<a onmouseover="ActivateImage('MyImage');" onmouseout="InactivateImage('MyImage');" href="javascript:void(FollowLink('MyImage'));"> <IMG height="22" src="Image1.gif" name="MyImage"> </a>
<script> function ActivateImage(ImageName) { document.images(ImageName).src = "Image2.gif" }
function InactivateImage(ImageName) { document.images(ImageName).src = "Image1.gif" } </script>
I have about 20 images setup in the similar way on my page.
The problem is that when the page is loading, it seems that only the images that are specified in my HTML are loaded. The other images start loading as I move mouse over original images. So, since it takes a whlie for those alternate images to load, the very first time I move mouse over an image and then quickly move it away the switch doesn't happen.
Is there any way to make sure that my alternate images get loaded with my page right away? Or should I use a different approach all together?
Thanks a lot for any help.
VR
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Geoff Cox |
last post by:
Hello
I have following type of code in the header
function pre_load_pics()
{
if (document.images)
{
var image1 = new Image(400,265);
image1.scr = "pic1.jpg";
|
by: vanisathish |
last post by:
Hi
I have an application, which has to change to different images based on
some conditions. I am trying to call a javascript function(this
function changes the images on the front end) from the...
|
by: JimO |
last post by:
If the paths to images are hard-coded into an a global array, does that mean
that they are pre-loaded? If not, what is the algorithm to do so?
Thanks,
Jim
|
by: Jim |
last post by:
I know this is a little off-topic for C#, but I'm writing
my user controls with C#, and the other more HTML-related
groups looked like there hasn't been activity in days for
some reason......
|
by: mlikesit |
last post by:
I am trying to get the following code to pre-load some images before re-dirrecting the user. The problem is that the onError event gets called for all of the images immediately. I've tripple...
|
by: SaraLeePerson |
last post by:
Dear group,
I am seeking a easy to maintain and more importantly *working* way to
pre-fetch images, so the pages I develop load smoothly without seeing
the images kick in flicker as they usually...
|
by: dE|_ |
last post by:
Guys,
I resorted to wysiwyg software to write a fancy JS nav bar and I've hidden
an equivalent static HTML set underneath it for disabled browsers.
My problem is; I cant get the appearance of...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |