Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-22-2008, 05:17 PM   PM User | #1
138th st
New to the CF scene

 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
138th st is an unknown quantity at this point
text accordian and load remote images into a div?

Hello,

For a project I am working on I am looking to replicate the text acordian / image gallery such as from the drawing and illustration galleries of http://www.misprintedtype.com/v4/

The accordian part is straight forward. I was looking for some ideas for the loading an image into a acordian content div. There are going to be many many images so I don't want to pre-load them.

I had been using a code but found, even outside of the accordian it would load extremely slowly and sometimes not at all:

<html>
<head>
<script type="text/javascript">
<!--
function getImage(pExistingImageID, pImageURL){
var img = document.createElement('img');
img.onload = function (evt) {
document.getElementById(pExistingImageID).src=this.src;
document.getElementById(pExistingImageID).width=this.width;
document.getElementById(pExistingImageID).height=this.height;
}
img.src = pImageURL;
return false;
}
//-->
</script>
<title>Remote Image 5</title>
</head>

<body>
<p><a href="#" onclick="return getImage('placeHolder','/images/rdivilbiss.jpg');">Get Remote Image</a></p>
<p><img id="placeHolder" border="0" src="/images/placeHolder.jpg"></p>
</body>
</html>
138th st is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:58 PM.


Advertisement
Log in to turn off these ads.