Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 44

Thread: max-width property and PHP

  1. #21
    Join Date
    Mar 2011
    Posts
    2,145
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    One more try -


    PHP Code:
    $ImageDisplay "<img src='$FileLocation' alt='' style='width:expression( document.body.clientWidth > 239 ? "240px" : "auto" );max-width:240px;height: expression( this.scrollHeight > 319 ? "320px" : "auto" );max-height:320px;' border='0' align='middle'>"
    (there was a small error in the code I posted above)
    Works for me in IE9.

  2. The Following User Says Thank You to keyboard For This Useful Post:

    KennyP (08-13-2012)

  3. #22
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Fr further reading to do with theis, try Here
    Last edited by bernie1227; 08-13-2012 at 07:52 AM.
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  4. The Following User Says Thank You to bernie1227 For This Useful Post:

    KennyP (08-13-2012)

  5. #23
    Join Date
    Dec 2009
    Location
    NY NY USA
    Posts
    230
    Thanks
    158
    Thanked 1 Time in 1 Post

    Default

    Thanks, but not working in either browser. But if it's working for you I'll try again.

    By the way, if it's important, I've been adusting the code to be consistent with the page coding...

    Code:
    $ImageDisplay = "<img src='$FileLocation' alt='' style='width:expression( document.body.clientWidth > 239 ? '240px' : 'auto' );max-width:240px;height: expression( this.scrollHeight > 319 ? '320px' : 'auto' );max-height:320px;' border='0' align='middle'>";

  6. #24
    Join Date
    Mar 2011
    Posts
    2,145
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Yes, it is important.
    Try using this exact code -

    PHP Code:
    $ImageDisplay "<img src='$FileLocation' alt='' style='width:expression( document.body.clientWidth > 239 ? "240px" : "auto" );max-width:240px;height: expression( this.scrollHeight > 319 ? "320px" : "auto" );max-height:320px;' border='0' align='middle'>"
    And if that doesn't work, try this -

    PHP Code:
    $ImageDisplay "<img src='$FileLocation' alt='' style='width:expression( document.body.clientWidth > 239 ? 240px : auto );max-width:240px;height: expression( this.scrollHeight > 319 ? 320px : auto );max-height:320px;' border='0' align='middle'>"

  7. #25
    Join Date
    Dec 2009
    Location
    NY NY USA
    Posts
    230
    Thanks
    158
    Thanked 1 Time in 1 Post

    Default

    I'm getting the full size 640X960 image with
    Code:
    319 ? '320px' : 'auto' );max-height:320px;' border='0' align='middle'>
    displaying beneath it, as shown in the image.


    EDIT: Still getting the full image in IE with the second code as well, but it is working in FF. Is it still working for you in IE?

    Thanks... I'm very grateful for your kindness to find a solution.
    Last edited by KennyP; 08-13-2012 at 07:34 AM.

  8. #26
    Join Date
    Mar 2011
    Posts
    2,145
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    What do I have to do on your website to duplicate that picture? (Also, is it on that link that you gave me before?)

    When I follow the instructions, it works fine? Where is that image in the attachment you posted? I can't find it...

    Attachment 4586
    Last edited by keyboard; 08-13-2012 at 07:50 AM.

  9. The Following User Says Thank You to keyboard For This Useful Post:

    KennyP (08-13-2012)

  10. #27
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Did you try using the javascript I posted?
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  11. #28
    Join Date
    Dec 2009
    Location
    NY NY USA
    Posts
    230
    Thanks
    158
    Thanked 1 Time in 1 Post

    Default

    Bernie: Yes thanks, I did try the java script. It had no effect.

    Keyboard: This is the main link to that section

    The soft works as follows:

    - Choose one of the four available images by clicking on it.

    - On the next page, write whatever you like for test purposes as name etc.

    - Then click on Generate Screensaver

  12. #29
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Did you change the id's in the script appropriately?
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  13. #30
    Join Date
    Dec 2009
    Location
    NY NY USA
    Posts
    230
    Thanks
    158
    Thanked 1 Time in 1 Post

    Default

    I changed only the double quotation marks to single.

    If it helps, attached is the entire include where you code is included.
    Last edited by KennyP; 08-13-2012 at 08:10 AM.

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
  •