Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

JQuery Cheat Sheet: Selectors and Events, Cheat Sheet of Computer Programming

In this cheat sheet you find Selectors and Events of JQuery

Typology: Cheat Sheet

2019/2020

Uploaded on 11/27/2020

sumaira
sumaira ๐Ÿ‡บ๐Ÿ‡ธ

4.8

(57)

263 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
JQuery Cheat Sheet
by luigi0555 via cheatography.com/28075/cs/8279/
Selectors
$('*'); $('ele๎˜ment');
$('.cl๎˜ass'); $('#ID');
$('sel๎˜ector1, selector2, select๎˜orN');
DOM
.append() .prepend()
.appen๎˜dTo() .prepe๎˜ndTo()
.after() .before()
.inser๎˜tAf๎˜ter() .inser๎˜tBe๎˜fore()
.next() .prev()
.data() .attr(๎˜'at๎˜tri๎˜but๎˜eNa๎˜me'๎˜,'a๎˜tri๎˜bute')
.remov๎˜eProp() prop()
.empty() .remove()
.remov๎˜eAttr() .first()
.last() .child๎˜ren()
.find() .html()
.text(); .val()
.end() .css('๎˜sty๎˜leN๎˜ame๎˜','๎˜style')
.addCl๎˜ass() .remov๎˜eCl๎˜ass()
toggle๎˜Class() .eq()
.end() not()
var object = $.exte๎˜nd({}, object1, object2);
Anim๎˜ations and Effects
.slideUp() .slide๎˜Down()
.width๎˜('0px') .heigh๎˜t('๎˜0px')
.fadeO๎˜ut(ms) .fadeI๎˜n(ms)
.hide(ms) .show(ms)
.fadeT๎˜oggle() .slide๎˜Tog๎˜gle()
.toggl๎˜e('๎˜fas๎˜t,s๎˜low๎˜',ms) .finish()
.stop() .queue()
clearQ๎˜ueue() .dequeue()
.anima๎˜te(๎˜{'r๎˜egl๎˜a:c๎˜ss'๎˜},m๎˜s,f๎˜unc๎˜tio๎˜n(){});
Event List
Browser Events
.resize() .scroll()
Document Loading
.holdR๎˜eady
()
ready()
Event Handler Attach๎˜ment
.on() .bind()
form events
.blur() .change() .focus()
.select() .submit()
Keyboard Events
.keydown() .keypr๎˜ess() .keyup()
Mouse Events
.click() .dblcl๎˜ick() focusin()
focusout() .hover๎˜(ha๎˜ndl๎˜erI๎˜n,H๎˜
and๎˜lerOut)
.hover๎˜(ha๎˜ndl๎˜e
rI๎˜nOut)
.mouse๎˜dow
n()
.mouse๎˜enter() .mouse๎˜leave(
)
.mouse๎˜mo
ve()
.mouse๎˜out() .mouse๎˜over()
.mouseup()
basic syntax
$('sel๎˜ector')
.metho๎˜dOne()
.metho๎˜dTwo()
.metho๎˜dN();
encaps๎˜ulated function
(funct๎˜ion(){
})();
Event Object
e.curr๎˜ent๎˜Target e.data
e.isDe๎˜fau๎˜ltP๎˜rev๎˜ented() e.name๎˜space
e.isIm๎˜med๎˜iat๎˜ePr๎˜opa๎˜gat๎˜ion๎˜Sto๎˜pped()
e.isPr๎˜opa๎˜gat๎˜ion๎˜Sto๎˜pped()
e.pageX e.pageY
e.prev๎˜ent๎˜Def๎˜ault() e.rela๎˜ted๎˜Target
e.result
e.stop๎˜Imm๎˜edi๎˜ate๎˜Pro๎˜pag๎˜ation()
e.stop๎˜Pro๎˜pag๎˜ation() e.target
e.time๎˜Stamp e.type
e.which
Event Handler
$('sel๎˜ect๎˜or'๎˜).e๎˜ven๎˜t(f๎˜unc๎˜tio๎˜nName);
$('sel๎˜ect๎˜or'๎˜).e๎˜ven๎˜t(f๎˜unc๎˜tio๎˜n(){});
$('sel๎˜ect๎˜or'๎˜).o๎˜n('๎˜eve๎˜nt'๎˜,fu๎˜nct๎˜ion๎˜Name);
$('sel๎˜ect๎˜or'๎˜)on๎˜('e๎˜ven๎˜t',๎˜fun๎˜cti๎˜onN๎˜ame๎˜(){});
$bind(๎˜'ev๎˜ent๎˜',f๎˜unc๎˜tion);
$(this)
AJAX
.ajaxC๎˜omp๎˜lete() ajax.E๎˜rror()
.ajaxS๎˜end() .ajaxS๎˜tart()
.ajaxS๎˜top() .ajaxS๎˜ucc๎˜ess()
Helper Functi๎˜ons
JQuery.pa๎˜ram() .seria๎˜lize()
serial๎˜ize๎˜Array()
Low-๎˜Level Interf๎˜ace
JQuery.ajax() JQuery.aj๎˜ax.S๎˜etup()
Shor๎˜tHand Methods
JQuery.get() JQuery.ge๎˜tJSON()
JQuery.ge๎˜tSc๎˜ript() JQuery.ge๎˜tSc๎˜rip๎˜t().load()
JQuery.post()
By luigi0555
cheatography.com/luigi0555/
Published 23rd May, 2016.
Last updated 23rd May, 2016.
Page 1 of 1.
Sponsored by Readability-Score.com
Measure your website readability!
https://readability-score.com

Partial preview of the text

Download JQuery Cheat Sheet: Selectors and Events and more Cheat Sheet Computer Programming in PDF only on Docsity!

JQuery Cheat Sheet

by luigi0555 via cheatography.com/28075/cs/8279/

Selectors $('*'); $('element'); $('.class'); $('#ID'); $('selector1, selector2, selectorN'); DOM .append() .prepend() .appendTo() .prependTo() .after() .before() .insertAfter() .insertBefore() .next() .prev() .data() .attr('attributeName','atribute') .removeProp() prop() .empty() .remove() .removeAttr() .first() .last() .children() .find() .html() .text(); .val() .end() .css('styleName','style') .addClass() .removeClass() toggleClass() .eq() .end() not() var object = $.extend({}, object1, object2); Animations and Effects .slideUp() .slideDown() .width('0px') .height('0px') .fadeOut(ms) .fadeIn(ms) .hide(ms) .show(ms) .fadeToggle() .slideToggle() .toggle('fast,slow',ms) .finish() .stop() .queue() clearQueue() .dequeue() .animate({'regla:css'},ms,function(){}); Event List Browser Events .resize() .scroll() Document Loading .holdReady () ready() Event Handler Attachment .on() .bind() form events .blur() .change() .focus() .select() .submit() Keyboard Events .keydown() .keypress() .keyup() Mouse Events .click() .dblclick() focusin() focusout() .hover(handlerIn,H andlerOut) .hover(handle rInOut) .mousedow n() .mouseenter() .mouseleave( ) .mousemo ve() .mouseout() .mouseover() .mouseup() basic syntax $('selector') .methodOne() .methodTwo() .methodN(); encapsulated function (function(){ })(); Event Object e.currentTarget e.data e.isDefaultPrevented() e.namespace e.isImmediatePropagationStopped() e.isPropagationStopped() e.pageX e.pageY e.preventDefault() e.relatedTarget e.result e.stopImmediatePropagation() e.stopPropagation() e.target e.timeStamp e.type e.which Event Handler $('selector').event(functionName); $('selector').event(function(){}); $('selector').on('event',functionName); $('selector')on('event',functionName(){}); $bind('event',function); $(this) AJAX .ajaxComplete() ajax.Error() .ajaxSend() .ajaxStart() .ajaxStop() .ajaxSuccess() Helper Functions JQuery.param() .serialize() serializeArray() Low-Level Interface JQuery.ajax() JQuery.ajax.Setup() ShortHand Methods JQuery.get() JQuery.getJSON() JQuery.getScript() JQuery.getScript().load() JQuery.post() By luigi cheatography.com/luigi0555/ Published 23rd May, 2016. Last updated 23rd May, 2016. Page 1 of 1. Sponsored by Readability-Score.com Measure your website readability! https://readability-score.com