Results 1 to 5 of 5

Thread: HELP! image margins within frames.

  1. #1
    Join Date
    Jun 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HELP! image margins within frames.

    Basically, I'm targeting an image from one frame to another frame but the image automatically has margins... I'm guessing by default with ie browsers.

    From CLICK to TARGET.



    The white area are the margins I want to remove and have the blue box with a black background.

    Thanks in advance for any help!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Please post a link to the page on your site so we can check it out.


    Are you linking directly to an image (image.jpg), or a page holding that image (image.htm, etc)?

    If you're linking directly to an image, all browsers have their own ways of dealing with images. They'll usually scale them to fit the window, maybe, yes, giving a border.

    If you link to a page containig the image, it will solve the problem. Might be a bit more work, though.


    However, if your server has php enabled, here's a quick suggestion...
    This will make any image you want display on a single webpage, saving you lots of time.
    Write your page as it would be normally, being sure to save it as a .php extension.
    Then use an image tag like this:
    PHP Code:
    <img src="<?php echo $_GET['image']; ?>">
    Be sure not to specify height/width if that is changing. Use an alt attribute that applies to all images, like "selected image", or something.
    When linking to that page (for example the link that has the iframe as the target), use this:
    href="page.php?image=pathandnameofdesiredimage"
    for example, page.php?image=something.jpg
    or, even
    page.php?image=images/something.jpg

    That will save you lots of time. You can use the same page in the iframe for each, and just specificy a different image at the end for each of the links to the frame.
    Last edited by djr33; 06-12-2006 at 06:29 AM.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your quick response! It works perfectly with your suggestion.


    Yet another question..


    As you said, I used this code.

    PHP Code:
          <img src="<?php echo $_GET['image']; ?>"></img>

    Is there a way to have an image there by default, so when I "call" (click) on another image from another page, it just replaces it? Thanks man, appreciate it.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'd do it this way... replace your img tag with this:

    PHP Code:
    <?php
    if (!($image=$_GET['image'])) {
    $image "default.jpg";
    }
    ?>
    <img src="<?php echo $image?>"></img>
    I think that will work. I'm not sure what the best way to do an "if not" is... but the exclamation point means not, so... I think if (!(something)) will do for "if not".
    See if that works.
    If it doesn't, I can write a longer one that will.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jun 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks a million, I dont know how I would've figured this out myself. I appreciate your fast and precise help! Thanks again.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •