![]() |
|
|
|||||||
![]() |
HTML - Hey Nigel dude could it get any simpler? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Searching for one thing, I came across this little script found at
javascript.internet.com. The sample they showed used tables. A row of 4 thumbs, the big picture, then another row of thumbs. Easily converts over to my project. Your basic image swap but just a tad tidier I think. browserName = navigator.appName; browserVer = parseInt(navigator.appVersion); ns3up = (browserName == "Netscape" && browserVer >= 3); ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4); function swap(imgName) { if (ns3up || ie4up) { imgOn = ("" + imgName); document.thumbs.src = imgOn; } } Richard |
|
|
|
|
#2 |
|
Posts: n/a
|
While sitting in a puddle Richard scribbled in the mud:
> Searching for one thing, I came across this little script found at > javascript.internet.com. The big question. Why javascript? -- D? |
|
|
|
#3 |
|
Posts: n/a
|
"Duende" <> wrote
> While sitting in a puddle Richard scribbled in the mud: > > > Searching for one thing, I came across this little script found at > > javascript.internet.com. > > The big question. Why javascript? Because that way it can be ensured to only work in two browsers. |
|
|
|
#4 |
|
Posts: n/a
|
Richard wrote:
> Hey Nigel dude could it get any simpler? Much simpler... function swap(x) { document.images["thumbs"].src = x; } -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact |
|
|
|
#5 |
|
Posts: n/a
|
Richard wrote:
> Searching for one thing, I came across this little script found at > javascript.internet.com. Don't use "The JavaScript Source". What you posted proves that it contains some of the worst code in existence. > browserName = navigator.appName; > browserVer = parseInt(navigator.appVersion); > > ns3up = (browserName == "Netscape" && browserVer >= 3); > ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4); Dear &deity;! Browser sniffing for a bloody image swap? Give me a break! > function swap(imgName) { > if (ns3up || ie4up) { > imgOn = ("" + imgName); > document.thumbs.src = imgOn; > } > } If you're going to test for support (which really is unnecessary), test for the images collection: var swap = document.images ? function(url) {document.images['thumbs'].src = url;} : function() {}; swap('example.jpeg'); Mike -- Michael Winter Replace ".invalid" with ".uk" to reply by e-mail. |
|
|
|
#6 |
|
Posts: n/a
|
While the city slept, Richard (Anonymous@127.001) feverishly typed...
[javascript image swap] > Easily converts over to my project. > Your basic image swap but just a tad tidier I think. Yet it still won't work without javascript. Mine does. To be honest, it's a rather convoluted way of doing a basic image swap anyway. You already have the code to do your image swap with js. Now insert the PHP so it works without js and you'll be there. Cheers, Nige -- Nigel Moss http://www.nigenet.org.uk Mail address not valid. , take the DOG. out! In the land of the blind, the one-eyed man is very, very busy! |
|
|
|
#7 |
|
Posts: n/a
|
On Mon, 7 Feb 2005 13:22:35 -0000 nice.guy.nige wrote:
> While the city slept, Richard (Anonymous@127.001) feverishly typed... > [javascript image swap] >> Easily converts over to my project. >> Your basic image swap but just a tad tidier I think. > Yet it still won't work without javascript. Mine does. To be honest, > it's a > rather convoluted way of doing a basic image swap anyway. > You already have the code to do your image swap with js. Now insert the > PHP > so it works without js and you'll be there. > Cheers, Would you post your batcave site again then? |
|
|
|
#8 |
|
Posts: n/a
|
While the city slept, Richard (Anonymous@127.001) feverishly typed...
> Would you post your batcave site again then? http://nigenet.batcave.net/thumbtastic/ or on my "proper" site at http://www.nigenet.org.uk/stuff/thumbtastic/ Cheers, Nige -- Nigel Moss http://www.nigenet.org.uk Mail address not valid. , take the DOG. out! In the land of the blind, the one-eyed man is very, very busy! |
|
|
|
#9 |
|
Posts: n/a
|
On Mon, 7 Feb 2005 16:05:40 -0000 nice.guy.nige wrote:
> While the city slept, Richard (Anonymous@127.001) feverishly typed... >> Would you post your batcave site again then? > http://nigenet.batcave.net/thumbtastic/ > or on my "proper" site at http://www.nigenet.org.uk/stuff/thumbtastic/ > Cheers, > Nige Thanks. Silly me. Forgot I had already saved it once. |
|