Frames and Images

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

    Frames and Images

    I have a page which has two frames ('content' on left and 'main' on right).
    In the 'content' frame are various links which I wish to use to change the
    image in the 'main' frame but leave the rest of the frame details intact.
    I have named the image as 'mainimage' with the following -

    <p align="center"> <img border="1" src="imagedir/picture1.jpg"
    name="mainimage " width="390" height="293"></p>

    I am trying to right a piece of script which will change the image when user
    click on the various links. I would have thought that the following would
    have worked but all it seems to do is right the image name in the main
    frame.

    href="javascrip t:parent.main.d ocument.images['mainimage'].src =
    'imagedir/picture2.jpg'"

    Any suggestions as to where I am going wrong would be appreciated.

    Thanks
    Peter


  • Joseph Ellis

    #2
    Re: Frames and Images

    On Tue, 23 Sep 2003 19:02:29 +0000 (UTC), "pete" <pete.me@this.c om>
    wrote:
    [color=blue]
    >I have a page which has two frames ('content' on left and 'main' on right).
    >In the 'content' frame are various links which I wish to use to change the
    >image in the 'main' frame but leave the rest of the frame details intact.
    >I have named the image as 'mainimage' with the following -
    >
    ><p align="center"> <img border="1" src="imagedir/picture1.jpg"
    >name="mainimag e" width="390" height="293"></p>
    >[/color]

    Try changing name="mainimage " to id="mainimage" , or just use them both
    (name and id).
    [color=blue]
    >I am trying to right a piece of script which will change the image when user
    >click on the various links. I would have thought that the following would
    >have worked but all it seems to do is right the image name in the main
    >frame.[/color]

    It sounds like you are trying to display an image that the script
    can't find. Be sure the path and spelling is correct, as well as the
    capitalization. I've been frustrated in situations like this many
    times in the past, only to discover that I had type the image's name
    incorrectly. Remember that myimage.jpg and MyImage.JPG are not the
    same file as far as your script is concerned.
    [color=blue]
    >
    >href="javascri pt:parent.main. document.images['mainimage'].src =
    >'imagedir/picture2.jpg'"
    >
    >Any suggestions as to where I am going wrong would be appreciated.
    >
    >Thanks
    >Peter
    >[/color]


    Comment

    • aundrenash

      #3
      How do I...?

      Hello,
      I'm a beginning graphic/web designer. I created a website with a background
      graphic that is 800x640 pixels. The problem is on my screen it fits like it
      should (no scrolling necessary etc.) but on monitors with lower (different
      resolutions) it's way too large. What script can I use to make sure the
      background image is the same or similar size (fits within the browser window
      without need for scrollling) on all or the majority of monitors? I'm sure
      this is really simple javascript 101 but I'd appreciate the time and help.

      designgal


      Comment

      • pete

        #4
        Re: Frames and Images

        Not a lot of success.
        I have tried using id=... and name=... but I get the same result. The main
        frame blanks out and just displays the text "imagedir/picture2.jpg".

        Anyone got any other ideas?

        Thanks
        Peter


        "Joseph Ellis" <jandellis@hotm ail.com> wrote in message
        news:4271nvoqfv jvk0fg42j26lf85 m8ar7cs6k@4ax.c om...[color=blue]
        > On Tue, 23 Sep 2003 19:02:29 +0000 (UTC), "pete" <pete.me@this.c om>
        > wrote:
        >[color=green]
        > >I have a page which has two frames ('content' on left and 'main' on[/color][/color]
        right).[color=blue][color=green]
        > >In the 'content' frame are various links which I wish to use to change[/color][/color]
        the[color=blue][color=green]
        > >image in the 'main' frame but leave the rest of the frame details intact.
        > >I have named the image as 'mainimage' with the following -
        > >
        > ><p align="center"> <img border="1" src="imagedir/picture1.jpg"
        > >name="mainimag e" width="390" height="293"></p>
        > >[/color]
        >
        > Try changing name="mainimage " to id="mainimage" , or just use them both
        > (name and id).
        >[color=green]
        > >I am trying to right a piece of script which will change the image when[/color][/color]
        user[color=blue][color=green]
        > >click on the various links. I would have thought that the following would
        > >have worked but all it seems to do is right the image name in the main
        > >frame.[/color]
        >
        > It sounds like you are trying to display an image that the script
        > can't find. Be sure the path and spelling is correct, as well as the
        > capitalization. I've been frustrated in situations like this many
        > times in the past, only to discover that I had type the image's name
        > incorrectly. Remember that myimage.jpg and MyImage.JPG are not the
        > same file as far as your script is concerned.
        >[color=green]
        > >
        > >href="javascri pt:parent.main. document.images['mainimage'].src =
        > >'imagedir/picture2.jpg'"
        > >
        > >Any suggestions as to where I am going wrong would be appreciated.
        > >
        > >Thanks
        > >Peter
        > >[/color]
        >
        >[/color]


        Comment

        • Lasse Reichstein Nielsen

          #5
          Re: How do I...?

          "aundrenash " <aundrenash@cox .net> writes:
          [color=blue]
          > I created a website with a background graphic that is 800x640
          > pixels. The problem is on my screen it fits like it should (no
          > scrolling necessary etc.) but on monitors with lower (different
          > resolutions) it's way too large.[/color]

          And so is it on browsers that don't take up the entire screen (like
          mine, on a 1600x1200 desktop).
          [color=blue]
          > What script can I use to make sure the background image is the same
          > or similar size (fits within the browser window without need for
          > scrollling) on all or the majority of monitors?[/color]

          That is actually not possible. There is no way to scale a background
          image in CSS, which is what would be needed. Even if you can find the
          size of the browser (don't look at the size of the screen, it doesn't
          matter one bite), you can't scale the background to fit. You will have
          to have several different backgrounds available, and switch to the one
          that has the correct size.

          /L
          --
          Lasse Reichstein Nielsen - lrn@hotpop.com
          Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
          'Faith without judgement merely degrades the spirit divine.'

          Comment

          Working...