Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Roll-Overs & Image Pre-Loaders
Old 10-29-2006, 09:51 PM Roll-Overs & Image Pre-Loaders
wfcamb's Avatar
Experienced Talker

Posts: 33
Location: Louisiana, USA
Trades: 0
OK.. First off, here's the site I'm trying to make work: http://wolvesforchrist.com/wfcdesigns_html/wfcd4/ Next thing, I'm trying to get the roll-overs to work on the top main menu, but they aren't doing as FrontPage shows it's supposed to be doing.. Does anyone here know of a good roll-over script I can use that doesn't involve CSS or PHP? I'm not familiar with that sort of coding unfortunately and would like it in a familiar coding for later editing. That way, I kinda' understand what I'm doing.. Right now, the bottom menu roll-overs work fine, but I can't seem to find what's wrong with the top menu (the bottom does not have the pre-loader yet).

The other thing I would like to know, is if there is anyone here that knows a good, simple image pre-loader script or HTML code? Again, no CSS or PHP due to my lack of knowlege. I don't know whether or not it is a HTML thing or a JAVASCRIPT thing. I just know I've seen it before and want it badly! lol..

Now, to answer the question/concern that most people keep bringing up, yes, I know it takes a little while to load the site. On a normal site, I would cut down the graphics by a large amount, however, the way I see it, if you are coming to a graphics website, you will probably expect, well, graphics. That means you are probably going to be expecting the site to load a little slower than a normal website. I have thought it over carefully and have decided to take that risk of the page loading time.


Thanks in advance for any help given!
__________________
~wfcamb~
wfcamb is offline
Reply With Quote
View Public Profile Visit wfcamb's homepage!
 
 
Register now for full access!
Old 11-01-2006, 12:34 PM Re: Roll-Overs & Image Pre-Loaders
Novice Talker

Posts: 7
Trades: 0
This is JavaScript, but fairly easy to add.

Step 1:
Add this within the <head> </head>

Code:
 <script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
Step 2: Add this in the <body> tag

Example:
Code:
<body onload="MM_preloadImages('images/yourimage2.gif','images/yoursecondimage2.gif'">
Important Note: For second images, typically the rollover effect image, add it to the body tag above. Use the above example as a guide. All second images need to be included in the onload.


Step 3: Add this to each image link in the body of your doc. Edit link and image names. Also the width and height.

Code:
<a href="yourlink.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Your Link','','images/image2.gif',1)"><img src="images/image1.gif" alt="Your Link" name="Your Link" width="130" height="20" border="0" id="Your Link" /></a>
Any questions, post back
__________________
Sports Discussion -
Please login or register to view this content. Registration is FREE

Last edited by Dizmatic; 11-01-2006 at 12:38 PM..
Dizmatic is offline
Reply With Quote
View Public Profile Visit Dizmatic's homepage!
 
Old 11-06-2006, 09:48 AM Re: Roll-Overs & Image Pre-Loaders
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
can't this be done with CSS, and with a lot less coding?
__________________
Firefox
rediscover the web

Please login or register to view this content. Registration is FREE
Down with internet explorer!
Silent77 is offline
Reply With Quote
View Public Profile Visit Silent77's homepage!
 
Old 11-07-2006, 08:23 AM Re: Roll-Overs & Image Pre-Loaders
Experienced Talker

Posts: 37
Trades: 0
Quote:
Originally Posted by Silent77 View Post
can't this be done with CSS, and with a lot less coding?
indeed it can be, you can also do it with a single image, so you don't get that pause where there is no image.
gaz545 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Roll-Overs & Image Pre-Loaders
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20747 seconds with 12 queries