![]() |
Slight probs with a javascript
hey people,
I have got a small page that I am showing some pics that I took today, when I was out cycling over the local hills. I have the page working fine, like a back and forward button and the images smaller than they should be so they fit on the screen better than when they were big. this part works fine. but I also want to put the big files on show as well if someone clicks the smaller image. now, there is only one page so I am using javascript to incrememnt a number and change the picture accordingly, this part is fine. but I am trying to get the image and find the same one but in larger size, does this make sense? I have a cycle folder with the html file and the smaller images, and I have another folder (Large) with the larger images. here is the code but the red is the problems: Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
Re: Slight probs with a javascript
Shouldn't "var prefix = "Large/";" be "var prefix = "/Large/";"
Otherwise you aren't referencing another directory at all? |
Re: Slight probs with a javascript
Quote:
say I click the button to get to pic 5 then I want to click the pic and go to the bigger pic, but the same pic. all the pics are named the same (pic1.JPG, pic2.JPG, pic3.JPG, etc) but in different folders at the moment when I click any small pic, it takes me to pic1.JPG instead of, say pic5.JPG. ik |
Re: Slight probs with a javascript
Replace
Code:
document.getElementById("theBigImg").src = theBigPic;Code:
document.getElementById("theImg").src = theBigPic;---------- Post added at 21:05 ---------- Previous post was at 21:04 ---------- and replace the Code:
<a href="Large/blah">Code:
<a href="#"> |
Re: Slight probs with a javascript
Quote:
ik |
Re: Slight probs with a javascript
Quote:
what happens if you do alert(document.getElementById("theImg").width) in that call ? |
Re: Slight probs with a javascript
Quote:
but I want to click that image to get to the bigger pic. ik |
Re: Slight probs with a javascript
Quote:
very odd.. the large image works on mine, but the paging back and forwards doesn't... hmmm ---------- Post added at 22:00 ---------- Previous post was at 21:57 ---------- Have you tried it under IE? - I'm running firefox and get the issues mentioned above, but it works ok under IE |
Re: Slight probs with a javascript
Quote:
Code:
document.getElementById("theImg").src = theBigPic;Code:
document.getElementById("theBigImg").src = theBigPic;EDIT: yip just tried it on IE and it works, but I would like it to work on FF too, as I and many other people use FF EDIT: it now works in FF too, cheers this is the end code to make it all work Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
Re: Slight probs with a javascript
Quote:
|
Re: Slight probs with a javascript
Quote:
ik |
Re: Slight probs with a javascript
Quote:
|
Re: Slight probs with a javascript
After all of that, I don't have enough space on my site for the large pics.
oh well I have changed the code back so that the small pics show, and I have left the original one that worked, on my comp. for anyone interested here are the pics I took today, and got burnt to a crisp. ik EDIT: if anyone likes some of the pics and want a bigger version, just pm me, but I know you wont, hehe |
Re: Slight probs with a javascript
really good pics, ik, that looks like a big climb, I just hope you chose a day when the wind was behind you :)
|
Re: Slight probs with a javascript
Quote:
there are bigger pics if anyone wants! ik |
| All times are GMT. The time now is 16:07. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum