Code Monkey home page Code Monkey logo

jquery.tabs.js's Introduction

jQuery.tabs.js

Simple but effective jQuery plugin to display tab navigation on custom markup

Usage

Let's assume the following markup

<div class="tabbed-content">
    <ul class="tab-nav">
        <li data-target="div.raw">Raw</li>
        <li data-target="div.html">HTML</li>
    </ul>
<div class="raw tab-content">
      <!--Content-->
    </div>
    <div class="html tab-content">
      <!--Content-->
    </div>
 </div>

Then the following JavaScript code :

$('div.tabbed-content').tabs();

And that's it!

The only mandatory thing about the markup here is to have your DOM elements representing the tabs within the tab container (the element on which you initialize the plugin) plus an attribute named data-target on each tab element containing the jQuery selector to it's target.

Everything else is pure HTML logic, you can use whatever markup, or tags you want for both tabs and tabs content containers, though tabs content containers should be block elements you can still put your tab content in a span element and put a display: block; on it if that's the kind of things you're into.

Credits

Inspired by http://red-team-design.com/google-play-minimal-tabs-with-css3-jquery/

Licence

MIT

jquery.tabs.js's People

Contributors

serybva avatar

Watchers

James Cloos avatar  avatar

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.