Giter Club home page Giter Club logo

touchdown's Introduction

TouchDown

Touchdown is a tiny bit of JavaScript that converts <ul> or <ol> navigation elements to <select> dropdowns—which is nice if you’re using an iPhone or something.

Want to see a demo? http://samuelcotterall.github.com/touchdown/:

Here’s how you use it:

Make some lists like this:

<ul id="social-networks">
	<li><a href="https://plus.google.com/113158264847735001631/posts">Google+</a></li>
	<li><a href="http://twitter.com/samuelcotterall/">Twitter</a></li>
	<li><a href="http://samuelcotterall.tumblr.com/">Tumblr</a></li>
	<li><a href="http://www.last.fm/user/samuelcotterall/">last.fm</a></li>
</ul>

<ul id="powered-by">
	<li><a href="http://jquery.com">jQuery</a></li>
	<li><a href="http://html5boilerplate.com//">HTML5 Boilerplate</a></li>
</ul>	

Call the script and initialise it:

<script defer src="../jquery.touchdown.js"></script>
<script>
	$(document).ready(function(){
		$('#social-networks, #powered-by').Touchdown();
	});
</script>

Use Media Queries or whatever to show/hide the lists and <select>s depending on screensize. Do this however you like, it’s up to you:

.touchdown-list {display: none;}
.touchdown {display: block;}

@media only screen and (min-width: 768px) {
.touchdown-list {display: block;}
.touchdown {display: none;}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.