¡@

Home 

2014/10/16 ¤W¤È 12:03:08

jquery Programming Glossary: el.data

Watching for DOM changes, the elegant way

http://stackoverflow.com/questions/11491628/watching-for-dom-changes-the-elegant-way

data.props function i data.vals i el.css data.props i el.data data if typeof this.onpropertychange object el.bind propertychange.. setInterval func timeout function __check el var data el.data changed false temp for var i 0 i data.props.length i temp..

jQuery Change event on an <input> element - any way to retain previous value?

http://stackoverflow.com/questions/1159046/jquery-change-event-on-an-input-element-any-way-to-retain-previous-value

function Get the initial value var el '#myInputElement' el.data 'oldVal' el.val el.change function store new value var this..

Highlight search terms (select only leaf nodes)

http://stackoverflow.com/questions/3241169/highlight-search-terms-select-only-leaf-nodes

.contents .each function i el if el.nodeType 3 var data el.data if data data.replace re replacement var wrapper span .html data..

Hiding Options of a Select with JQuery

http://stackoverflow.com/questions/4699410/hiding-options-of-a-select-with-jquery

this 'option' this. el .each function i obj var el obj el.data 'status' 'enabled' _this.items.push attribute el.attr _this.opts.attribute.. i item if item.attribute key item. el.remove item. el.data 'status' 'disabled' enable function key var _this this .each.. while true if t _this.items.length if _this.items t . el.data 'status' 'enabled' _this.items t . el.before item. el item...

JQuery Sortable set item to an index programmatically

http://stackoverflow.com/questions/4928002/jquery-sortable-set-item-to-an-index-programmatically

var el ui.item var directionUp ui.absolutePosition.top el.data 'initialPos' true false _rearrange el directionUp el.data 'initialPos'.. el.data 'initialPos' true false _rearrange el directionUp el.data 'initialPos' var _rearrange function el directionUp initialPos..

achieving equal height columns in a responsive / flexible layout

http://stackoverflow.com/questions/6041654/achieving-equal-height-columns-in-a-responsive-flexible-layout

of this .fn.eqHeights function var el this if el.length 0 el.data 'eqHeights' window .bind 'resize.eqHeights' function el.eqHeights.. window .bind 'resize.eqHeights' function el.eqHeights el.data 'eqHeights' true return el.each function var curHighest 0 this..

Is there a JQuery plugin which combines Draggable and Selectable

http://stackoverflow.com/questions/705250/is-there-a-jquery-plugin-which-combines-draggable-and-selectable

ev ui selected .ui selected .each function var el this el.data offset el.offset if this .hasClass ui selected this .addClass.. at when it was selected before drag var el this off el.data offset el.css top off.top dt left off.left dl CSS Styles to..

How to hide email in this jquery form and send blind or carbon copy to another owner?

http://stackoverflow.com/questions/9233922/how-to-hide-email-in-this-jquery-form-and-send-blind-or-carbon-copy-to-another-o

tmp trueVal defVal inp.val defVal trueVal defVal label.data defVal defVal inp .bind 'focus' function inp.val defVal.. el var tmp return tmp el.find _.targets .val '' tmp el.data 'defVal' validateFu function _.labels.each function var..

Including PHP variables in an external JS file?

http://stackoverflow.com/questions/9653651/including-php-variables-in-an-external-js-file

post id ' .click function var el this var data 'post_id' el.data 'post id' 'user_id' Globals.active_user_id data Globals.token..

How to lock the first word of a textarea?

http://stackoverflow.com/questions/9704795/how-to-lock-the-first-word-of-a-textarea

type text javascript var el textarea#message_create_body el.data 'oldVal' el.val el.bind 'keydown keyup keypress' function var..

Watching for DOM changes, the elegant way

http://stackoverflow.com/questions/11491628/watching-for-dom-changes-the-elegant-way

this el data props props.split func callback vals .each data.props function i data.vals i el.css data.props i el.data data if typeof this.onpropertychange object el.bind propertychange callback else if .browser.mozilla el.bind DOMAttrModified.. else if .browser.mozilla el.bind DOMAttrModified callback else setInterval func timeout function __check el var data el.data changed false temp for var i 0 i data.props.length i temp el.css data.props i if data.vals i temp data.vals i temp..

jQuery Change event on an <input> element - any way to retain previous value?

http://stackoverflow.com/questions/1159046/jquery-change-event-on-an-input-element-any-way-to-retain-previous-value

here e.g script look no global needed document .ready function Get the initial value var el '#myInputElement' el.data 'oldVal' el.val el.change function store new value var this this var newValue this.data 'newVal' this.val .focus function..

Highlight search terms (select only leaf nodes)

http://stackoverflow.com/questions/3241169/highlight-search-terms-select-only-leaf-nodes

use term var replacement span class 'highlight' term span base .contents .each function i el if el.nodeType 3 var data el.data if data data.replace re replacement var wrapper span .html data el .before wrapper.contents .remove function dehighlight..

Hiding Options of a Select with JQuery

http://stackoverflow.com/questions/4699410/hiding-options-of-a-select-with-jquery

object creation ExtraBox.prototype init function var _this this 'option' this. el .each function i obj var el obj el.data 'status' 'enabled' _this.items.push attribute el.attr _this.opts.attribute el el disable function key .each this.items.. el el disable function key .each this.items function i item if item.attribute key item. el.remove item. el.data 'status' 'disabled' enable function key var _this this .each this.items function i item if item.attribute key var t.. function i item if item.attribute key var t i 1 while true if t _this.items.length if _this.items t . el.data 'status' 'enabled' _this.items t . el.before item. el item. el.data 'status' 'enabled' break else t else..

JQuery Sortable set item to an index programmatically

http://stackoverflow.com/questions/4928002/jquery-sortable-set-item-to-an-index-programmatically

'.drag' event.target .removeClass 'drag' .addClass 'blockdrag' var el ui.item var directionUp ui.absolutePosition.top el.data 'initialPos' true false _rearrange el directionUp el.data 'initialPos' var _rearrange function el directionUp initialPos.. var el ui.item var directionUp ui.absolutePosition.top el.data 'initialPos' true false _rearrange el directionUp el.data 'initialPos' var _rearrange function el directionUp initialPos if el.offset .top initialPos '.blockdrag' el.parent .removeClass..

achieving equal height columns in a responsive / flexible layout

http://stackoverflow.com/questions/6041654/achieving-equal-height-columns-in-a-responsive-flexible-layout

set the columns to that height. Something along the lines of this .fn.eqHeights function var el this if el.length 0 el.data 'eqHeights' window .bind 'resize.eqHeights' function el.eqHeights el.data 'eqHeights' true return el.each function var.. function var el this if el.length 0 el.data 'eqHeights' window .bind 'resize.eqHeights' function el.eqHeights el.data 'eqHeights' true return el.each function var curHighest 0 this .children .each function var el this elHeight el.height..

Is there a JQuery plugin which combines Draggable and Selectable

http://stackoverflow.com/questions/705250/is-there-a-jquery-plugin-which-combines-draggable-and-selectable

to be doing on start #selectable div .draggable start function ev ui selected .ui selected .each function var el this el.data offset el.offset if this .hasClass ui selected this .addClass ui selected offset this .offset drag function ev ui var dt.. el current element we are on off what position was this element at when it was selected before drag var el this off el.data offset el.css top off.top dt left off.left dl CSS Styles to be able to see what's happening #selectable width 100 height..

How to hide email in this jquery form and send blind or carbon copy to another owner?

http://stackoverflow.com/questions/9233922/how-to-hide-email-in-this-jquery-form-and-send-blind-or-carbon-copy-to-another-o

' . ' . tmp tmp 1 tmp 1 inp.html return defVal '' defVal tmp trueVal defVal inp.val defVal trueVal defVal label.data defVal defVal inp .bind 'focus' function inp.val defVal inp.val '' _.hideEmptyFu label label.removeClass _.invalidCl.. false el.addClass _.invalidCl return ret isEmpty function el var tmp return tmp el.find _.targets .val '' tmp el.data 'defVal' validateFu function _.labels.each function var th this _.isEmpty th _.showEmptyFu th _.hideEmptyFu..

Including PHP variables in an external JS file?

http://stackoverflow.com/questions/9653651/including-php-variables-in-an-external-js-file

JavaScript may look like document .ready function ' data post id ' .click function var el this var data 'post_id' el.data 'post id' 'user_id' Globals.active_user_id data Globals.token Globals.hash .ajax 'type' 'POST' 'url' 'http domain.com ajax..

How to lock the first word of a textarea?

http://stackoverflow.com/questions/9704795/how-to-lock-the-first-word-of-a-textarea

like the solution below as it requires no Javascript. script type text javascript var el textarea#message_create_body el.data 'oldVal' el.val el.bind 'keydown keyup keypress' function var header Header var this this this.data 'newVal' this.val var..