Welcome to WebmasterWorld Guest from 54.145.44.134

Forum Moderators: open

Message Too Old, No Replies

Java Script question

Why are my mouseovers so slow?

     

Dino_M

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.

txbakers

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.

Dino_M

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)
Image4.src="http://www.villa.mysitespace.com/morepics2.jpeg"
Image5=new Image(133,31)
Image5.src="http://www.villa.mysitespace.com/moraira3.jpeg"
Image6=new Image(133,31)
Image6.src="http://www.villa.mysitespace.com/moraira2.jpeg"
Image7=new Image (133,31)
Image7.src="http://www.villa.mysitespace.com/more.jpeg"
Image8=new Image(133,31)
Image8.src="http://www.villa.mysitespace.com/info2.jpeg"
-->
</SCRIPT>
<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");
}
}

// -->

</SCRIPT>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month