Home > Articles > Web Development

This chapter is from the book

Working with Components

Everything in your site can be broken down into components. Sometimes these are simply elements. Other times, they are groups of elements. A search input, a navigation menu, and sliders are all examples of elements.

When creating the mobile or smaller versions of your site, you need to take into consideration what should happen to each of these elements.

Navigation

No matter how brilliant your current navigation system is, odds are, you will need to change it to make it fit on smaller devices.

You could always wrap the navigation to a new line; however, this often looks sloppy and comes across as lazy. Still, this will work if your navigation is text based and if you can align the words so that they are balanced and the line looks intentional instead of heavy on one side. If your navigation is reliant on hover states or mega menus, you will need to create a new system or method for handling all your links.

You should consider two other methods when you are compressing your navigation. The first is to use a menu that drops in, and the second is to use an off-canvas solution.

Both solutions require the use of a menu button or icon that will take the place of your text.

Applying a menu that will drop in requires either using multiple layers, injecting a block of code on a click or tap event, or using classes to change the height and visibility of the content area.

Using an off-screen navigation solution is similar, but it slides in the menu by using animation (either JavaScript or CSS3 transitions) to make the content appear. This should be familiar to you because it is the type of solution Facebook implements in its mobile application and is also used in many Google products as a way to access the menu. Google+ and Google Music use this type of navigation to give you access to settings, playlists, images, groups, and more.

Because every project is different, you will need to play with the breakpoints for when your site navigation changes from text to the menu change. Figure 8.5 demonstrates a site displayed at different sizes, with the navigation changing.

Figure 8.5

Figure 8.5 As the site is viewed on smaller devices, the navigation changes so that it is hidden until activated by the Menu button.

Some plugins might help you with your off-canvas navigation:

Search

Unless your site has an absolute absence of content, you probably have a search box. The good news is that this particular search input adapts very well to mobile layouts.

Depending on your developers, there is already a fantastic chance that you are using the proper input element. HTML5 introduced a special input element made just for searching. It looks like the following:

<input type="search" name="search" />

The benefit of using the search input for your search is that mobile browsers can change the keyboard that appears to use it, and they can even add an icon and show you previous search entries when the field is activated.

The drawback of using this input is that some browsers automatically style the input to match the styles of the OS. For example, iOS rounds the corners of the input to make it appear like the default search element of iOS. This is good because the user can visually understand that it is a search field, but it is also bad because it could throw off your design (rounded corners on a flat design or a second magnifying glass added to the one you have already put on the page).

You have several options for handling the display of your search bar. You can choose to put it just below the header (which contains your logo and menu buttons) of your site, or you can choose to place it in the drop-in or off-canvas navigation area.

Either option is fine, but you should do some A/B testing, use heat maps, or apply other testing methods to make sure the search remains accessible and easy to find. Mobile users can be a finicky lot and will leave your site if they can’t find what they need as fast as possible.

Content Areas

You might not give much thought to the content of your site, but if you are running a comparison site, an eCommerce site, or an informational site, you will run into the problem of having tons of content and not enough screen to properly display it all.

You have three common solutions for handling this particular issue:

  • An accordion (or drawer) shows a particular title or question. The content is hidden until the title is tapped or clicked, when the accordion opens and shows the hidden content. This is commonly used on FAQ pages and pages that want to hide content-rich areas until the user has activated them.

    Note that some accordions allow only one section open at a time and automatically close any other open sections. Pay close attention to your user testing to make sure you are not frustrating users who would like to have multiple sections open at the same time.

  • Tab systems are useful to display short terms that then open content areas that the user can then go through and view. This particular system suffers from the same autoclosing feature of some accordions and also forces you to cram buttons and text into a small space. This system works best on medium-size screens, but you can also use it successfully on smaller screens if you pay proper attention to text or icon size to activate the tabs.
  • With a grid system, you have the option of arranging your content into columns. As the screen size of the device viewing your site shrinks, these columns will start to compress until you decide that the content is no longer legible. At this point, you can “break” the columns so that they take up 100% of the available width instead of the preassigned 25%, 33%, or 50% of screen space.

    The downside to using columns to break apart displayed content is that your pages have the potential to get very long. I’m not talking about a couple hundred pixels long—more like a carpel tunnel–inducing, finger-sprinting marathon of a page of long swipes. You should stick to using this particular style of content display for smaller content areas.

Sliders

I’ll skip the discourse on sliders because I know that, when it comes down to it, some people will tell you that they absolutely need one. In addition, when you are working on retrofitting a site, you will need to know how to handle them.

First, because speed should be one of your primary objectives, you need to remember that sliders are inherently slow. This is the result of having to load multiple images into an area and then get them restyled so that they can be displayed in order. DOM processing is also slowed, and mobile devices will have to work harder to download, inject, and then redraw all the images on and off canvas as needed. Another side effect that you might not be aware of is the tradeoff in battery life. As the mobile device works harder to display your page, CPU and memory are used more and battery life can be affected.

Second, sliders are problematic on mobile devices because of the “pause on hover” effect that no longer works with mobile design. With this effect, the slider on a desktop would normally continue to show one slide after the other, but it stops when the mouse cursor is hovering or stopped on one of the slides. Mobile users might also become frustrated with sliders when they do not respond to screen swipes and when the users have no way of pausing or stopping the sliders.

Many mobile users are comfortable with the concept of swiping to move content around, but when that behavior is unavailable or seems to act funny due to slide timing, this can be a source of aggravation.

To successfully use a slider on mobile devices, remember the following:

  • Let users move the slider.
  • Make your slider touch/swipe friendly.
  • Minimize the amount of data or number of slides in the slider.
  • Load content by use of a deferred method (such as lazy loading) so that the site does not appear broken or waiting to load content.

A couple sliders that work well with mobile devices are BXSlider (http://bxslider.com/) and Owl Carousel (http://owlgraphic.com/owlcarousel/).

Links

A major consideration when moving from a desktop-only site is the size of your links. You might have noticed while visiting various sites that buttons and links are much larger when viewed on mobile devices. This goes deeper than just the Web: The developer guidelines for Windows Phone, Android, and iOS also specify that touch targets, or areas where the user can tap, should be big enough for a finger to tap.

How big is that, exactly? Well, it varies, and various pixel density values can make it somewhat difficult to narrow down. However, the following sizing values will get you started in the right direction:

  • Use a minimum size of 34px by 34px, but consider using at least 44px.
  • The width of your target can be longer than 44px, but the height should be at least 34px.
  • Be sure to provide adequate space between targets—use at least 8px, to minimize accidental tapping.

Learn more about designing for touch devices by visiting these sites:

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020