• Stars
    star
    134
  • Rank 269,935 (Top 6 %)
  • Language
  • Created over 13 years ago
  • Updated over 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extends jQuery to add support for CSS3 xxx-of-type selectors

#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.

More Repositories

1

selectivizr

selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.
JavaScript
1,715
star
2

ZzFXM

A super small music generator for use in size-limited JavaScript productions
JavaScript
382
star
3

gadebugger

A Chrome, Firefox & Opera devtools extension for debugging Google Analytics tracking code
JavaScript
238
star
4

3d-model-element

A custom element for rendering inline 3D models in a HTML document and allowing them to be transformed with CSS.
JavaScript
204
star
5

css-feature-toggle-devtools-extension

A devtools extension for toggling CSS features allowing developers to see how pages/apps render in browsers that don't support modern CSS features
JavaScript
157
star
6

fuse-devtools

A boilerplate for creating a devtools extension for multiple browsers from a single code base.
JavaScript
134
star
7

cssvr

CSSVR is an experiment that simulates browser support for creating VR experiences using media queries and CSS transforms.
JavaScript
82
star
8

ComputedStyleObserver

Prototype implementation of a `computedStyle` observer for DOM elements
JavaScript
19
star
9

surrogate

This is a tiny JavaScript library targeted at modern web browsers and designed to mimic the common parts of jQuery's funtions and syntax using modern ECMAScript and DOM implementations
JavaScript
4
star
10

imagedata

A collection of packages for working with images in JavaScript environments that don't implement the ImageData interface.
JavaScript
2
star
11

zzfxm-songs

A collection of songs for use with ZzFXM
2
star
12

sculpt

JavaScript
2
star
13

stylescribe

Stylescribe is a CSS documentation generator. It's goal is to produce a reference document that can be used to quickly build web pages without having to dive into the inner workings of a projects CSS.
JavaScript
2
star
14

atari-chunked-blits

Testing the feasibility of automatically breaking HOG blits into smaller chunks, allowing large objects to be drawn without interfering with interrupts
Assembly
2
star
15

selection-element

A web component for selecting HTML elements or other web components.
JavaScript
1
star