473,326 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

converting JS image swap to php

Considering the elemtary image swap routine in javascript:

document.name.src="filename.gif"

How would this be translated into PHP?
So that if a visitor has js turned off, clicking on a thumbnail would show
the larger image.
Jul 17 '05 #1
9 1839
*** Richard escribió/wrote (Fri, 21 Jan 2005 12:21:18 -0600):
document.name.src="filename.gif"

How would this be translated into PHP?
So that if a visitor has js turned off, clicking on a thumbnail would show
the larger image.


Do you mean this?

<a href="foo.gif"><img src="foo_t.gif"></a>

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #2
On Fri, 21 Jan 2005 20:56:04 +0100 Alvaro G. Vicario wrote:
*** Richard escribió/wrote (Fri, 21 Jan 2005 12:21:18 -0600):
document.name.src="filename.gif" How would this be translated into PHP?
So that if a visitor has js turned off, clicking on a thumbnail would
show
the larger image.
Do you mean this? <a href="foo.gif"><img src="foo_t.gif"></a>


No I do not. What I need to do is to put the larger image into a specific
division on the same page. NO NEW WINDOWS!
As in the manner brucie did the butterflies.
But the method must also conform to the script I'm using.

www.somestuff.batcave.net/menu1.html

Jul 17 '05 #3
*** Richard escribió/wrote (Fri, 21 Jan 2005 14:42:53 -0600):
No I do not. What I need to do is to put the larger image into a specific
division on the same page. NO NEW WINDOWS!
What makes you think my code will open a new window?

If you mean you don't want to load a new document... Since PHP is
server-side, if you want to use it to change the contents of current page
you must reload the page. Or part of it (iframes and the like).
As in the manner brucie did the butterflies.
But the method must also conform to the script I'm using.

www.somestuff.batcave.net/menu1.html


Definitively you must use frames o iframes. In any case, nothing to do with
PHP.
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #4
I noticed that Message-ID: <6c****************************@40tude.net>
from Alvaro G. Vicario contained the following:

Definitively you must use frames o iframes. In any case, nothing to do with
PHP.


What about CSS?

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #5
I noticed that Message-ID: <q3********************************@4ax.com>
from Geoff Berrow contained the following:
Definitively you must use frames o iframes. In any case, nothing to do with
PHP.


What about CSS?


Ignore me, I'm not awake yet...
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #6
In article <cs********@news1.newsguy.com>,
"Richard" <An*******@127.001> wrote:
On Fri, 21 Jan 2005 20:56:04 +0100 Alvaro G. Vicario wrote:
*** Richard escribió/wrote (Fri, 21 Jan 2005 12:21:18 -0600):
document.name.src="filename.gif" How would this be translated into PHP?
So that if a visitor has js turned off, clicking on a thumbnail would
show
the larger image.

Do you mean this?

<a href="foo.gif"><img src="foo_t.gif"></a>


No I do not. What I need to do is to put the larger image into a specific
division on the same page. NO NEW WINDOWS!
As in the manner brucie did the butterflies.
But the method must also conform to the script I'm using.

www.somestuff.batcave.net/menu1.html


Well, it ain't gonna be in php. php runs on the server and provides
output for pages. That output can be HTML or Javascript or whatever.

I think you're describing a Javascript that does image rollovers, right?
That's not php's job. php just outputs the javascript for the browser
to run.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #7
Geoff Berrow <bl@ckdog.co.uk> wrote:
I noticed that Message-ID: <6c****************************@40tude.net>
from Alvaro G. Vicario contained the following:

Definitively you must use frames o iframes. In any case, nothing to do with
PHP.


What about CSS?


Not without Javascript. You're asking for action when the user clicks
something. Someone has to handle that click. To be done on the client
side, you have to use some kind of scripting (either Javascript, or
(shudder) VBScript).

If you cannot assume client-side scripting, then you must make a round-trip
back to the server to generate a new page.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 17 '05 #8
I noticed that Message-ID: <3e********************************@4ax.com>
from Tim Roberts contained the following:
What about CSS?


Not without Javascript. You're asking for action when the user clicks
something. Someone has to handle that click.


You missed my later post. I realised later that CSS would only respond
to rollover events.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #9
While the city slept, Richard (An*******@127.001) feverishly typed...
Considering the elemtary image swap routine in javascript:

document.name.src="filename.gif"

How would this be translated into PHP?
So that if a visitor has js turned off, clicking on a thumbnail would
show the larger image.


In exactly the same way as I posted to your question on news:alt.html ...

http://www.nigenet.org.uk/stuff/thumbtastic/

This uses javascript to swap the image and change the alt text if javascript
is available. If not, some PHP code reloads the page with the selected image
(and alt text).

Cheers,
Nige

--
Nigel Moss
http://www.nigenet.org.uk
Mail address not valid. ni***@DOG.nigenet.org.uk, take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Randell D. | last post by:
Folks, I'm still learning javascript - I've invested in a couple of books and reading online as much as possible. I'm pretty sure what I am suggesting is possible though I'm trying to weigh up...
1
by: John | last post by:
I am rotating images of different dimensions. My problem is that when a new image is displayed in a new position which had an image of a different dimension, the old image is first stretched to the...
2
by: Frank Bishop | last post by:
I have been trying to do image swaps and my second image does not show up, it just goes to a blank image on the mouseover. I have Windows XP SP2 and it prompts me to allow blocked content when the...
2
by: Matthew | last post by:
Hi all I'm looking for a solution that can be used in a calendar/gig guide scenario where each day is represented by a dot image. Now this dot must do the following 1. When the mouse goes...
2
by: broms10 | last post by:
I need help. I have a little button that says "next" below a big image, let´s call it "image1", when I press the button I want to swap the big image to "image2". And then if I press it again I...
12
by: Charlie King | last post by:
As I understand it, the use of FIR* to replace heading tags with images in visually enabled CSS browsers is now frowned upon on the basis that some screen readers will *nor* read back text that is...
3
by: seamlyne | last post by:
The first method I ever used for multiple state buttons was to create a graphic for each button for each state: AboutUs_on, AbooutUs_over, AboutUs_out, etc. That works great when there are just a...
2
by: Laurent Navarro | last post by:
Hello, I am using a library which returns a byte containing RAW data, ie all pixels' color values coded in a byte array without header. I would like to save those data into a JPEG file so I...
7
by: ma740988 | last post by:
Consider the equation (flight dynamics stuff): Yaw (Degrees) = Azimuth Angle(Radians) * 180 (Degrees) / 3.1415926535897932384626433832795 (Radians) There's a valid reason to use single...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.