Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Fixed element messing everything up when you zoom on a mobile device
Old 06-19-2012, 03:04 PM Fixed element messing everything up when you zoom on a mobile device
Experienced Talker

Posts: 41
Trades: 0
Alright, so I'm implementing a “fixed floating menu” that you can see here http://jqueryfordesigners.com/fixed-floating-elements/

Here's the page sheffieldfurniture.com/furniture/bedroom.html

It works great on desktop and looks great on mobile devices (IOS, Android) ...as long as you don't zoom in on the page. When you zoom on a mobile device the fixed element begins covering the other page content, as it should since it's fixed to a certain place on the viewport.

Is there a way to keep users from zooming? Any ideas? Thanks!


See below for screen shots.

Initial view is fine


Zoom in and things get ugly
jpf566 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-19-2012, 04:21 PM Re: Fixed element messing everything up when you zoom on a mobile device
Skilled Talker

Posts: 90
Name: Lisa Forgan
Location: Colorado
Trades: 0
I'm not a big fan of preventing zoom but sometimes you just need to because of the circumstances. So...
If I'm correct, on some Androids you can't prevent the zoom. But in general this will work on most phone (but not all):

Use this meta tag and place it within your head tag section:
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />
<meta name="viewport" content="width=device-width" />
Puddlemut is offline
Reply With Quote
View Public Profile
 
Old 06-19-2012, 04:44 PM Re: Fixed element messing everything up when you zoom on a mobile device
Experienced Talker

Posts: 41
Trades: 0
Ok cool, Thanks! Yeah I was able to control scaling with this
Code:
<meta name = "viewport" content = "initial-scale = .25, minimum-scale = .25, maximum-scale= .25, width = device-width">
but now now that I look at it, it's really tiny and annoying not being able to scale.


My second idea was to use this meta tag to restrict scaling to a certain extent and then make the background of the menu div white so it then becomes a sort of fixed menu overlay. (See screenshot below) Does anyone have a better idea? Also, when I tested this on IOS devices the menu was floated toward the center/middle of the screen and was much more awkward and distracting. Any ideas/advice would be much appreciated! Thanks


jpf566 is offline
Reply With Quote
View Public Profile
 
Old 06-26-2012, 05:30 PM Re: Fixed element messing everything up when you zoom on a mobile device
Skilled Talker

Posts: 90
Name: Lisa Forgan
Location: Colorado
Trades: 0
This is a very good article that explains the scaling issue. When the initial scale is reduced to .25, 1280 pixels are displayed. Just something to think about:
http://johnkpaul.tumblr.com/post/186...-with-pictures
Puddlemut is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Fixed element messing everything up when you zoom on a mobile device
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14615 seconds with 11 queries