Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resizing images onClick 1

Status
Not open for further replies.

Inch

Technical User
May 29, 2002
1
GB
On my page, I have a series of thumbnails which, when clicked, change the source of a large central image. The images which are shown in the center are all of different sizes, yet in Opera, when the corresponding thumbnail is clicked, all large images displayed kin the center are stretched or shrunk so that they are the same size as the original (first) image which they replace.
Any one have any ideas how I can get round this? In Netscape, I used layers, but Opera doesn't support this, does it?

My source is:
op = document.getElementById("bigcirc");
op.src = aryBC[intIndex];
(where bigcirc is the image id and aryBC is a javascript array to change the image source...)

Also, I have another <div> next to the large image which changes onClcik to show a description of the image. In IE I have used the innerHTML property (unsupported in Opera) and in Netscape I have used document.[layer_id].document.write() to write the description. Does any know what the equivalent is in Opera.

I have tried:
desc=document.getElementById(&quot;descriptions&quot;);
desc.document.write('Hello');
(where descriptions is a <div> id...)

but this does not seem to work.

Help very gratefully received ;)

Inch
 
If you get an answer to this please forward it to me also at jroberts@docucorp.com. I'm having the same exact problem and haven't been able to find an answer
 
You can do it using simple good old image rollover script!
Without any innerHTML or getElementById. Keep things simple.
 
GetElementById works fine in Opera. I am not sure exactly what your problem is, or how to fix it, but there are a couple of things that could be the problem. The main one is that with Opera's current rendering engine you are not able to change the document contents once it is rendered. Another is that although Opera is highly standards compliant in HTML and CSS areas, it doesn't yet support a lot of w3c DOM. Both of these things should change with Opera 7 which is still in development.

Mike Fosters has some excellent examples of cross browser DHTML
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top