1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-10-16 15:38:44 +02:00
cheatsheets/jquery.md
Rico Sta. Cruz 511de900ba
Formatting updates (#2133)
- Update some sheets which have very long sections
- Remove `layout: 2017/sheet` (everything has the same layout now)
- Remove outdated sheets
2024-04-03 18:30:24 +11:00

694 B

title, category, tags, weight
title category tags weight
jQuery JavaScript libraries
WIP
-1

Traversing

$('.box')
  .children()
  .closest('div')
  .filter(':selected')
  .find('div')
  .has('div')
  .first()
  .next('div')
  .nextUntil('div')

Advanced features

Extending selectors

$.expr[':'].inline = function (el) {
  return $(el).css('display') === 'inline'
}

Enables $(':inline')

Extend CSS properties

$.cssHooks.someCSSProp = {
  get: function (elem, computed, extra) {
  },
  set: function (elem, value) {
  }
}

// Disable "px"
$.cssNumber["someCSSProp"] = true

fn.animate() hooks

$.fn.step.someWhatever = function(fx) {
  // ...
}