Results 1 to 3 of 3
  1. #1

    Change CSS for Certain Devices with Javascript

    Hi,
    On my website I use CSS Fixed Positioning, but unfortunately on many mobile devices in particular this doesn't work I'd like to be able to turn these into static (e.g. Go to bottom of page) on some devices, but I'm a bit stuck (The Div btw is called apDiv2

    So far I've got

    Code:
    if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod' || navigator.platform == 'BlackBerry')
    {
         $("#apDiv2").css("position", "static");
    };
    but no dice. Does anybody know what I'm doing wrong? The full css file is at http://atomicbuilds.com/general.css

    Thanks, Ed

    P.S. Eventually I'd also like to change the actual positioning so -142px goes to 0px, so if anybody knows that that'd be great, but I'm more worried about this first
    My Site is Silicox Valley Technology
    Follow me on Twitter, @person287

  2. #2
    Join Date
    Dec 2010
    Location
    USA
    Posts
    54
    You have to do some coding for browser detection and do seperate CSS for each devices . That is the best solution for this. We use the same technique for depending on the client's requirements

  3. #3
    How do I do this exactly? From code browsing I've seen something to do with lt but that usually is for Internet Explorer?
    My Site is Silicox Valley Technology
    Follow me on Twitter, @person287

Similar Threads

  1. help me to change javascript, rating system
    By mantonn in forum Programming Discussion
    Replies: 8
    Last Post: 04-29-2009, 05:34 AM
  2. SSH: Size of connection (from mobile devices) & UK deals on devices?
    By alex-davies in forum Hosting Security and Technology
    Replies: 5
    Last Post: 01-31-2005, 12:52 PM
  3. JavaScript - change value of textbox via radiobox
    By bridgey in forum Programming Discussion
    Replies: 3
    Last Post: 12-27-2004, 10:15 AM
  4. Javascript change ad
    By 65pbiz in forum Programming Discussion
    Replies: 2
    Last Post: 08-01-2004, 08:03 PM

Posting Permissions

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