converting JS image swap to php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard

    converting JS image swap to php

    Considering the elemtary image swap routine in javascript:

    document.name.s rc="filename.gi f"

    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.


  • Alvaro G. Vicario

    #2
    Re: converting JS image swap to php

    *** Richard escribió/wrote (Fri, 21 Jan 2005 12:21:18 -0600):[color=blue]
    > document.name.s rc="filename.gi f"
    >
    > 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.[/color]

    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
    --

    Comment

    • Richard

      #3
      Re: converting JS image swap to php

      On Fri, 21 Jan 2005 20:56:04 +0100 Alvaro G. Vicario wrote:
      [color=blue]
      > *** Richard escribió/wrote (Fri, 21 Jan 2005 12:21:18 -0600):[color=green]
      >> document.name.s rc="filename.gi f"[/color][/color]
      [color=blue][color=green]
      >> 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.[/color][/color]
      [color=blue]
      > Do you mean this?[/color]
      [color=blue]
      > <a href="foo.gif"> <img src="foo_t.gif" ></a>[/color]

      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.





      Comment

      • Alvaro G. Vicario

        #4
        Re: converting JS image swap to php

        *** Richard escribió/wrote (Fri, 21 Jan 2005 14:42:53 -0600):[color=blue]
        > 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![/color]

        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).
        [color=blue]
        > 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[/color]

        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
        --

        Comment

        • Geoff Berrow

          #5
          Re: converting JS image swap to php

          I noticed that Message-ID: <6c5sxusrda6h.p n2rjfel98du$.dl g@40tude.net>
          from Alvaro G. Vicario contained the following:
          [color=blue]
          >
          >Definitively you must use frames o iframes. In any case, nothing to do with
          >PHP.[/color]

          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/

          Comment

          • Geoff Berrow

            #6
            Re: converting JS image swap to php

            I noticed that Message-ID: <q3b4v0d7tjmd9r s9g1jsp2rl5igkk eu1il@4ax.com>
            from Geoff Berrow contained the following:
            [color=blue][color=green]
            >>Definitivel y you must use frames o iframes. In any case, nothing to do with
            >>PHP.[/color]
            >
            >What about CSS?[/color]

            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/

            Comment

            • Michael Vilain

              #7
              Re: converting JS image swap to php

              In article <csrpgj0sfp@new s1.newsguy.com> ,
              "Richard" <Anonymous@127. 001> wrote:
              [color=blue]
              > On Fri, 21 Jan 2005 20:56:04 +0100 Alvaro G. Vicario wrote:
              >[color=green]
              > > *** Richard escribió/wrote (Fri, 21 Jan 2005 12:21:18 -0600):[color=darkred]
              > >> document.name.s rc="filename.gi f"[/color][/color]
              >[color=green][color=darkred]
              > >> 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.[/color][/color]
              >[color=green]
              > > Do you mean this?[/color]
              >[color=green]
              > > <a href="foo.gif"> <img src="foo_t.gif" ></a>[/color]
              >
              > 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[/color]

              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...



              Comment

              • Tim Roberts

                #8
                Re: converting JS image swap to php

                Geoff Berrow <bl@ckdog.co.uk > wrote:
                [color=blue]
                >I noticed that Message-ID: <6c5sxusrda6h.p n2rjfel98du$.dl g@40tude.net>
                >from Alvaro G. Vicario contained the following:
                >[color=green]
                >>
                >>Definitivel y you must use frames o iframes. In any case, nothing to do with
                >>PHP.[/color]
                >
                >What about CSS?[/color]

                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, timr@probo.com
                Providenza & Boekelheide, Inc.

                Comment

                • Geoff Berrow

                  #9
                  Re: converting JS image swap to php

                  I noticed that Message-ID: <3ec6v0hmv61hhm r4itlvbkrg9ad9o e6eqr@4ax.com>
                  from Tim Roberts contained the following:
                  [color=blue][color=green]
                  >>What about CSS?[/color]
                  >
                  >Not without Javascript. You're asking for action when the user clicks
                  >something. Someone has to handle that click.[/color]

                  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/

                  Comment

                  • nice.guy.nige

                    #10
                    Re: converting JS image swap to php

                    While the city slept, Richard (Anonymous@127. 001) feverishly typed...
                    [color=blue]
                    > Considering the elemtary image swap routine in javascript:
                    >
                    > document.name.s rc="filename.gi f"
                    >
                    > 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.[/color]

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



                    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
                    This is the personal website of Nigel Moss - Web and software developer, musician, photographer. It is home to my CV, portfolio, general info and more.

                    Mail address not valid. nigel@DOG.nigen et.org.uk, take the DOG. out!
                    In the land of the blind, the one-eyed man is very, very busy!


                    Comment

                    Working...