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 04-29-2008, 01:29 PM   PM User | #1
DanDanAUS
New to the CF scene

 
Join Date: Apr 2008
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
DanDanAUS is an unknown quantity at this point
Java Script and controlling aplet to load images dynamicly

Dear all

I have an applet in my web page that is something like this:

<applet archive="myapplet.zip" id="myapplet" code="myapplet.class" width="252" height="147" codebase="mybase">
<param name="rooms.length" value="3">
<param name="startroom" value="0">
<param name="actions.length" value="3">

<param name="rooms[0]" value="CylinderRoom">
<param name="rooms[0].hotspotFG" value="black">
<param name="rooms[0].hotspotBG" value="yellow">
<param name="rooms[0].initPos.yaw" value="200">
<param name="rooms[0].image" value="imageRoom1.jpg">

This is pretty much one of those panoramic viewers that i bought of the shelf a while ago.

The room is the actual panoramic that i would like to view in the applet.

But i have close to 500 of those images. IT would be a bit nonsense to create 500 of those room parameters.

I know the image name of the image i would like to load. Is it possible to do a bit of trickery to that with some javascript?

Pretty much all i would like to do is have the dynamic loading of images.All the other parameters can be same.

Any advice would be apreciated...


Cheers
DAn
DanDanAUS is offline   Reply With Quote
Old 04-29-2008, 02:09 PM   PM User | #2
BarrMan
Senior Coder

 
BarrMan's Avatar
 
Join Date: Feb 2005
Location: Israel.
Posts: 1,644
Thanks: 69
Thanked 83 Times in 82 Posts
BarrMan is on a distinguished road
You can do that with Javascript.
you can have a loop that creates those param tags and inserts the information like this:
Code:
for i=0;i<500;i++)
{
param = document.createElement("PARAM");
param.value = "paramValue";
param.name = rooms[0];
document.getElementsByTagName("BODY")[0].appendChild(param);
}
This would create one param tag and would insert it to the body tag. If you want more tags you can repeat these lines.
BarrMan 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 06:54 PM.


Advertisement
Log in to turn off these ads.