Last week, we mentioned that Vladik Rikhter used Google AdWords to max out his Dropbox account with all the space he could get from referrals for a fraction of the cost required to upgrade his account by using Google AdWords. Many of you have already done the same, but some of you told us you didn't want to spend any money at all. Well, here's how to get an additional 8GB for free, using AdWords credits and smart keywords. More »
Computer Services Information
Wednesday, November 2, 2011
How to Get 8GB+ Extra Dropbox Space for Free with Google AdWords [Dropbox]
Last week, we mentioned that Vladik Rikhter used Google AdWords to max out his Dropbox account with all the space he could get from referrals for a fraction of the cost required to upgrade his account by using Google AdWords. Many of you have already done the same, but some of you told us you didn't want to spend any money at all. Well, here's how to get an additional 8GB for free, using AdWords credits and smart keywords. More »
Google rolls out new look for Gmail: streamlined conversation view, high-res themes, better search
Google gave us a hint of Gmail's new look with a preview earlier this year, and it's now finally begun to roll out the real thing. Sometime over the next few days you should see a "switch to the new look" link in the bottom right corner of Gmail which, if clicked, will open up a range of new features and design changes. Those include a streamlined conversation view (complete with profile pictures), three different density settings (plus "elastic density" based on your display), a new batch of high resolution themes, improved search, and a refined navigation panel. Head on past the break for a quick video detailing the changes.
Update: Well, it looks like those "few days" turned into just a few hours. Google's now confirmed that the new look is available to everyone.
Google rolls out new look for Gmail: streamlined conversation view, high-res themes, better search originally appeared on Engadget on Tue, 01 Nov 2011 12:31:00 EDT. Please see our terms for use of feeds.
Permalink |
Official Google Blog | Email this | Comments
Friday, July 15, 2011
Convert a Menu to a Dropdown for Small Screens
The Five Simple Steps website has a responsive design with a neat feature. When the browser window is narrow, the menu in the upper right converts from a regular row of links into a dropdown menu.

When you're on a small screen (iPhone shown here) and click the dropdown, you get an interface to select an option where each option is nice and big and easy to choose.

That sure makes it easier to pick a place to go than a tiny link. Yeah, it's two taps instead of one, but that's arguable since you'd probably have to zoom in to tap the right link otherwise.
The HTML
The HTML for these two menus is different. As far as I know, you can't style <select> and <option> elements to look and behave like <a>s or vice versa. So we need both. You could just put both in the markup. That's what Five Simple Steps does:
<nav>
<ul>
<li><a href="/" class="active">Home</a></li>
<li><a href="/collections/all">Books</a></li>
<li><a href="/blogs/five-simple-steps-blog">Blog</a></li>
<li><a href="/pages/about-us">About Us</a></li>
<li><a href="/pages/support">Support</a></li>
</ul>
<select>
<option value="" selected="selected">Select</option>
<option value="/">Home</option>
<option value="/collections/all">Books</option>
<option value="/blogs/five-simple-steps-blog">Blog</option>
<option value="/pages/about-us">About Us</option>
<option value="/pages/support">Support</option>
</select>
</nav>Let's go with that for now.
The CSS
By default we'll hide the select menu with display: none;. This is actually good for accessibility, as it will hide the redundant menu from screen readers.
nav select {
display: none;
}Then using media queries, we'll do the switcheroo at some specific width. You can determine that on your own (here's some standard breakpoints).
@media (max-width: 960px) {
nav ul { display: none; }
nav select { display: inline-block; }
}But now you gotta maintain two menus?
Well yeah, that's one concern. Maybe your menus are created dynamically and you can't control the output easily. Maybe you and hand crafting menus but want to make sure you don't accidentally get your menus out of sync. One way we can fight this is to dynamically create the dropdown menu from the original.
Using jQuery, we can do that with just a few lines of code:
// Create the dropdown base
$("<select />").appendTo("nav");
// Create default option "Go to..."
$("<option />", {
"selected": "selected",
"value" : "",
"text" : "Go to..."
}).appendTo("nav select");
// Populate dropdown with menu items
$("nav a").each(function() {
var el = $(this);
$("<option />", {
"value" : el.attr("href"),
"text" : el.text()
}).appendTo("nav select");
});Then to make the dropdown menu actually work...
$('nav select').change(function() {
window.location = $(this).find('option:selected').val();
});But aren't dropdown menus kinda obtrusive?
Kinda. Most small screens these days are mobile and most mobile devices are JavaScript friendly, so not a huge concern. But, if you want to ensure this works with or without JavaScript I have an article about that.
Demo & Download
Video
Quick video example in case you are reading this from somewhere you can't adjust the browser size and play with it to see what the heck we're talking about here.
Convert a Menu to a Dropdown for Small Screens is a post from CSS-Tricks
"
