How do i force desktop view on mobile devices with Bootstrap?
I have tried fixing the viewport
width to 1024, but still it doesn't work me.
Any Advices?
Search for “desktop”, for “Global setting to request desktop site on Android“, select Enabled and restart the browser. Tap on menu , select Settings > Site Settings > Desktop Site> enable toggle to “Request the desktop view of sites“.
Launch the Google Chrome browser and go to the site you want to view. Hit F12 on your keyboard to access DevTools. When the mode is turned on, click the “Toggle Device Emulation” icon. You can choose from a list of iOS and Android devices to emulate them.
Enabling Desktop BrowsingOpen the Chrome app and tap the three dots in the top-right corner. When you do this, a menu will pop up. Here, you will see the button "Desktop site" — tap on this to turn on desktop browsing.
Mobile devices Generally speaking, Bootstrap supports the latest versions of each major platform's default browsers. Note that proxy browsers (such as Opera Mini, Opera Mobile's Turbo mode, UC Browser Mini, Amazon Silk) are not supported.
You just need to set the Viewport
<meta name="viewport" content="width=1024">
Instead of this (Responsive version)
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Look at here. Should solve your issue.
SO - bootstrap-3-desktop-view-on-a-mobile-device
SO - how-to-show-desktop-version-on-mobile-screens-in-bootstrap-3
Thanks All,
This code works for me:
var viewMode = getCookie("view-mode");
if(viewMode == "desktop"){
viewport.setAttribute('content', 'width=1024');
}else if (viewMode == "mobile"){
viewport.setAttribute('content', 'width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no');
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With