- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI though I didnt have any problem, till I tested my page on Internet Explorer :P I made a simple page with web gallery. Since I have to work with a single html document, the only way was with JavaScript.
The idea is to one picture un underneath her two links: previous and next. The pictures are sorted from 1 to 100 (like 1.jpg, 2.jpg, ... 55.jpg, 56.jpg ... and so on). So at start the the picture 1.jpg (with active link on it to see the full size after click) and underneath there are two links: previous = 100.jpg and next = 2.jpg. When I click on next, the 2.jpg picture loads and now previous = 1.jpg and next = 3.jpg. The code looks like this:
--------------------------
--------------------------
<html>
<head>
<title>Picture Galery</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
function showpic(number) {
// Change active picture
output = 'http://my.site.com/pic/' + number + '.jpg';
document['change_pic'].src
document.links['change_lin
// Change next pics link
number_next = number + 1;
if (number_next == 101) { number_next = 1; }
output = 'JavaScript:showpic(' + number_next + ')';
document.links['change_nex
// Chenge previous pic link
number_previous = number - 1;
if (number_previous == 0) { number_previous = 100; }
output = 'JavaScript:showmon(' + number_previous + ')';
document.links['change_pre
}
</SCRIPT>
<form name="gallery" id="gallery">
<table width="200" cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td colspan="2" align="center">
<b>Picture Gallery</b>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<a href="http://my.site.com/p
<img name="change_pic" src="http://my.site.com/pi
</a>
</td>
</tr>
<tr>
<td align="left">
<a name="change_previous" href="JavaScript:showmon(1
</td>
<td align="right">
<a name="change_next" href="JavaScript:showmon(2
</td>
</tr>
</table>
</form>
</body>
</html>
--------------------------
--------------------------
Now this works perfect with Firework, but doesn't work on Internet Explorer. On IE, when I press Next or Previous it changes only the picture, but doesn't change the link. As far as I understood IE cant determine wich link to change with document.links['xx'].href option.
i was looking all over the Internet for a solution, but couldn't find a working one. All I found was document.links[0].href, where 0 is the number of the link on page. Now this works ok, if I know exactly what number has my link, i want to change, but since the rest around the page (execpt the gallery) is an active page, it's impossible to do that.
Anyone has a working solution how i can change the link.href to my wish on IE or all-browser-friendly ?
This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership