Sunday, 2 August 2015

How To Use Chrome’s Mobile Emulator To Get Your Site Mobile Friendly [VIDEO]

Chrome Developer Tools Mobile Emulation
Google is obviously taking mobile more seriously. With plans to turn up the dial on mobile as a ranking signal, site owners are scrambling to prepare for the update.
The purpose of this post is to demonstrate, in simple terms, how marketers and developers can use the Mobile Emulation Tool in Chrome Developer Tools to preview their site on any mobile device. (I really try to avoid geek speak as much as possible in these demos.)

A Few Highlights

Provides Impressive Selection of Devices

You can see from the screenshot below (which still isn’t exhaustive) just how many mobile devices, tablets, and notebooks you have to choose from.
mobile devices in Chrome Mobile Emulator tool

User Agent Updates with Device

As you can see in the screenshot below, the user agent actually updates to match the device you’ve selected.
mobile user agent in Chrome Mobile Emulation tools - Chrome Developer Tools
I demonstrate in the video how you can confirm this using Google Analytics’ Real Time reports.

Hover Events Replaced with Touch Events

When you turn on the Mobile Emulator Tool, Chrome emulates touch events. So instead of a cursor that turns into the iconic hand to indicate a hover event, your cursor is a dot that you can click and drag to replicate touch-and-drag motions on a mobile device.
mouse emulator in Chrome Developer Tools
And if you hold down the Shift key it will turn into a four-headed arrow and will replicate zoom events (via pinch motions) as you click and drag.
zoom emulation in Chrome Developer Tools Mobile Emulator

Enables Interaction with Media Queries

Media queries (set in a site’s CSS) determine how your adjusts to different viewports (total geek speak for the viewable area of a device)  — provided, of course, your site is responsive and actually updates to different viewports.
You can easily view how your site is programmed to look in different devices.

media query emulator in Crhome
Click for larger image

And if you right-click on any of these colored segments (I explain the difference in the colors in the video), you can view the code in the Sources tab and even update it.

preview media queries in Chrome Developer Tools' Sources tab
Click for larger image


Pro Tip: 
Any time you see the curly brackets below a CSS or JavaScript file you’re previewing in the Sources tab, you should click on it. It will make minified CSS and JavaScript much easier to read, as you can see in the image below.

beautify CSS and JavaScript in Chrome Developer Tools
Click for larger image (animated)

Full Chrome Developer Tools Editing Ability

Just as with Chrome Developer Tools for desktop, you can modify anything on the page and view the changes in real time (e.g., CSS, JavaScript, HTML, etc).

modify CSS using Mobile Emulator in Chrome Developer Tools
Click for larger image (animated)

Video

Check out these features and more in the video below.

To view the original article Click Here

No comments:

Post a Comment