Giter Club home page Giter Club logo

jquery-extended-selectors's Introduction

#jQuery Extra Selectors#

This jQuery "plugin" adds support for the following CSS3 pseudo-class selectors to jQuery:

  • :first-of-type
  • :last-of-type
  • :only-of-type
  • :nth-of-type
  • :nth-last-of-type

The project was written to service the needs of selectivizr users but it can be used in any project based on the jQuery library.

##Using the script##

Before using the script you'll need to include it in your page (shown below). Make sure you add it after the main jQuery script. Once included, you'll be able to use the selectors above in your jQuery statements.

<script src="{path}/jquery.js"></script>
<script src="{path}/jquery-extended-selectors.js"></script>

###Examples###

$("div:only-of-type").css("background", "red");
$("p:first-of-type").css("color", "red");

##Note for selectivizr users##

If you are using this script purely to extend jQuery's support for selectivizr then you'll only need to include this script for IE6-8. The best way to do that is, add it to the same conditional comment as the selectivizr script. This will prevent browsers that already support these selectors from downloading this plugin.

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.