C and Cpp
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsDesktop ProgrammingC and Cpp

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old June 20th, 2004, 09:41 AM
Chippo Chippo is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Stockport, UK
Posts: 462 Chippo New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 23 h 28 m 4 sec
Reputation Power: 0
Send a message via MSN to Chippo
Image preloader not working in IE

Yo ppl
well heres what I'm usin for my image rollovers which preloads them aswell (surposedly)
Code:
<script type="text/javascript">
<!--
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
/**************************************************  **
*	        DOM Image rollover:
*		by Chris Poole
*		http://chrispoole.com
*               Script featured on http://www.dynamicdrive.com
*		Keep this notice intact to use it :-)
**************************************************  **/

function init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = newImage(imgarr[i].getAttribute('hsrc'));
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))  
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}
// -->
</script>

This works perfectly in Mozilla but not in MSIE can anybody help me with this Im not very good at Javascript.
btw to use the image rollovers you simply put an image in your page and add an extra tag 'hsrc' containing the mouseover image. eg.

[img]images/btn_tutorials.gif[/img]

Reply With Quote
Reply

Viewing: Tutorialized ForumsDesktop ProgrammingC and Cpp > Image preloader not working in IE


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT