Dear visitor, welcome to KDE-Forum.org.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
Konqueror does not undestand this simple html. Why?
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
|
<html><head></head>
<body>
<p align=center><img src="1.jpg" name="main_img" height="480"></p>
<table>
<tr>
<td><img src="1.jpg" name=img0 width="48" onClick=document.images["main_img"].src="1.jpg"></td>
t;
<td><img src="2.jpg" name=img1 width="48" onClick=document.images["main_img"].src="2.jpg"></td>
</tr>
</table>
</body></html>
|
Save the code as index.html, place two jpg files (1.jpg and 2.jpg) in the same directory, open html-file with IE/Mozilla/Firefox and click on the small images at bottom. The upper image will be replaced with the clicked image. Now, try it with Konqueror
Is the code wrong? How should i impove it?
it's possibly the javascript. I haven't tried it, but this should be more cross-browser:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
|
<html><head></head>
<body>
<p style="text-align:center"><img src="1.jpg" id="main_img" height="480" /></p>
<table>
<tr>
<td><img src="1.jpg" name="img0" width="48" onclick="document.getElementById('main_img').src='1.jpg';" /></td>
<td><img src="2.jpg" name="img1" width="48" onclick="document.getElementById('main_img').src='2.jpg';" /></td>
</tr>
</table>
</body></html>
|
note that I've used DOM scripting instead of the older arrays-based coding. also, all parameters are quoted (required by recent HTML specs).
kae verens
php ajax programmer
http://verens.com/, http://webworks.ie/