Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    82
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Display different images for different devices?

    I posted this thread in the CSS forum, because I thought there might be a CSS answer, but maybe the answer is in the php?

    Other thread: http://www.codingforums.com/showthread.php?t=247737

    Here is what I said:

    I've been told by a number of people that I can have a higher and a lower resolution version of an image and do something in the coding that makes one of them load if it's a regular computer and the other one load if it's a mobile device. I have Googled and can't find how to do this.

    My mom is dead-set on using several images on the mobile version of her site, which is making the site too big according to the mobile validator that I ran the site through. I made low-res versions of the images, but don't know how to set the site to load the right one. I know how to *hide* one or the other, but apparently even if the css lists an image as "display:none;" it still loads the image and counts toward the size of the page.

    Very frustrated, please help!

    >^,,^<

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You realize we have a forum dedicated to mobile web development?
    http://codingforums.com/building-mobile-devices/

    PHP isn't really going to help you here because PHP doesn't know anything about who is viewing the client side web page.

    Just a few threads down in the mobile web development forum there is a thread asking this same question and has answers

    Distinguishing between devices for proper website
    http://www.codingforums.com/showthread.php?t=236303
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New Coder
    Join Date
    Aug 2011
    Posts
    82
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks, I'm still learning my way around this place (it's biiiig!) I'll check out that thread.

    The problem is I've had "aha! I finally found the solution!" moments so many times, only to have the solution not work for me... I'm getting discouraged...


  •  

    Posting Permissions

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