Results 1 to 3 of 3
-
10-17-2011, 04:26 PM #1WHT Addict
- Join Date
- Mar 2011
- Posts
- 138
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"); };
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
-
10-18-2011, 12:53 AM #2Junior Guru Wannabe
- 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
-
10-18-2011, 04:31 AM #3WHT Addict
- Join Date
- Mar 2011
- Posts
- 138
How do I do this exactly? From code browsing I've seen something to do with lt but that usually is for Internet Explorer?
Similar Threads
-
help me to change javascript, rating system
By mantonn in forum Programming DiscussionReplies: 8Last Post: 04-29-2009, 05:34 AM -
SSH: Size of connection (from mobile devices) & UK deals on devices?
By alex-davies in forum Hosting Security and TechnologyReplies: 5Last Post: 01-31-2005, 12:52 PM -
JavaScript - change value of textbox via radiobox
By bridgey in forum Programming DiscussionReplies: 3Last Post: 12-27-2004, 10:15 AM -
Javascript change ad
By 65pbiz in forum Programming DiscussionReplies: 2Last Post: 08-01-2004, 08:03 PM