When you register a delegated event using on (or the deprecated delegate / live), it is somewhat hard to manually trigger...
In Rails 2, you could use link_to_remote...
...:update => 'id' to automatically replace the content of $('#id').
SudoSlider is a simple yet powerful content slider that makes no (or very few) assumptions about your markup and is...
This snippet makes links that refer to an anchor (like "...
...") scroll softly to it.\ In this example we only do...
jQuery doesn't store information about event listeners and data values with the element itself. This information is instead stored...
When you cannot make Selenium trigger events you rely on (e.g. a "change" event when filling in a form field...
In Webkit you can use the HTML5-attribute autofocus: = form.text_field :title, :autofocus => 'autofocus' Here is a jQuery fallback for...
Attached (see below) is some code to allow using unobtrusive JavaScript on pages fetched with an AJAX call.
Many jQuery plugins suffer from a good plugin architecture. When you write jQuery plugins you should use the plugin pattern...
...Capybara::Selenium::Driver) # disable future ajax requests page.execute_script <<-JAVASCRIPT if ( (typeof jQuery) !== 'undefined' ) { jQuery.ajaxPrefilter(function(options, originalOptions, jqXHR) { jqXHR.abort(); }); } JAVASCRIPT # wait for active ajax requests to complete patiently do...
...page.execute_script("return (typeof jQuery) === 'undefined' || jQuery.active === 0").should == true end end end The code above depends on Spreewald for patiently...
The $.cssHooks object provides a way to define functions for getting and setting particular CSS values. It can also be...
to create a Gallery that has a name and has_many :images, which in turn have a...
jQuery's find looks in the element's descendants. It will never return the current element itself, even if the...
...Modern versions of the jQuery UI date time picker come with an additional file jquery-ui-sliderAccess.js. This adds plus/minus buttons next to the hour and minute sliders. After including the file...
Using the jQuery adapter breaks the built-in save function of CKEditor. Phenomenon: The page is submitted correctly, but the...
When using jQueryUI's Sortable plugin (either directly or via Angular's ui.sortable), you might struggle testing your nice drag&drop GUI since Selenium webdriver does not support native dragging...
But jQueryUI uses jquery.simulate for their testing, so why shouldn't you? There is even an extension to it that makes testing drag & drop quite easy.
...matching ones. The example below is ES6, on ES5 could write something similar using jQuery.grep. let classes = Array.from($element.prop('classList')) let existingModifiers = classes.filter(className => { return className.match(/^is-/) }) $layout.removeClass(existingModifiers.join(' '))
If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...
If you have jQuery code like this: if (condition) { $element.show(); } else { $element.hide(); } ... you can shorten this to: $element.toggle(condition);
An alert alternative for jQuery that looks good. Apprise is a very simple, fast, attractive, and unobtrusive way to communicate...
You can say this in Javascript: $.fn.jquery => "1.11.1"
...very hard. Even when you explicitely set the selection inside the textarea (e. g. using jquery-fieldselection) the browser will not scroll the textarea to this selection.
$textarea.blur(); $textarea.val(textBeforePosition); $textarea.focus(); $textarea.val(text); $textarea.setSelection(position, position); // assumes that you use jquery-fieldselection.js } I'm sorry! Also see Scroll a textarea to a given line with jQuery...
Twitter's Bootstrap CSS blueprint as a jQuery UI theme. Even if you don't want to use Bootstrap as...
When you are working with jQuery selectors and collections, many times you want to know if the collection actually contains...