Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Java Script question

Why are my mouseovers so slow?



9:20 pm on Feb 6, 2003 (gmt 0)

10+ Year Member

I have just set up a small site (my first!) and place in four buttons in Java script. These change on mouse over.

The buttons work fine on my computer but since uploading them to the web they are soooo slow. (site is in profile)

Why is this? what determines how fast and smooth things like this and drop down menus are? is Java not the best thing to do this in?

I'm starting my second site and want some very slick menus whats the best way to acheive this.


9:53 pm on Feb 6, 2003 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Hi. First off, JAVA is not JAVASCRIPT. They are two different languages.

The javascript rollovers could be slow on the web for a number of reasons, the most obvious at first glance would be that the "under" images need to be physically downloaded when the user puts their mouse on the "over" image.

You can speed this along by "preloading" the hidden images. There is plenty of code out there to do this. It's just one javascript method.

As for slick navigations systems, there many good DHTML scripts available which can make navigation systems. Keep in mind that after the first time a user sees something slick it's not a novelty anymore. Your first goal should be useability.


11:06 am on Feb 7, 2003 (gmt 0)

10+ Year Member

Have been trying to Preload my images all morning but nt really getting anywhere! My Script is below where am I going wrong?

<SCRIPT language=Javascript>

Image1=new Image(133,31)
Image1.src= "http://www.villa.mysitespace.com/charge3.jpeg"
Image2 =new image(133,31)
Image2.src= "http://www.villa.mysitespace.com/charges2.jpeg"
Image3=new Image(133,31)
Image3.src= "http://www.villa.mysitespace.com/morepics1.jpeg"
Image4=new Image(133,31)
Image5=new Image(133,31)
Image6=new Image(133,31)
Image7=new Image (133,31)
Image8=new Image(133,31)
<SCRIPT language=Javascript>
if (document.images) {
aaon = new Image(); aaon.src = "charges3.jpeg";
aaoff = new Image(); aaoff.src = "charges2.jpeg";
abon = new Image(); abon.src = "morepics1.jpeg";
aboff = new Image(); aboff.src = "morepics2.jpeg";
acon = new Image(); acon.src = "moraira3.jpeg";
acoff = new Image(); acoff.src = "moraira2.jpeg";
adon = new Image(); adon.src = "more.jpeg";
adoff = new Image(); adoff.src = "info2.jpeg";


function imgOn(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "on.src");

function imgOff(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "off.src");

// -->



Featured Threads

Hot Threads This Week

Hot Threads This Month