Home » JavaScript » Page 39

JavaScript

jQuery Selector Example

The aim of this example is to go through some of the most important and used jQuery selectors widely used over websites to achieve specific results depending on the case. Selectors can be considered as identifiers for jQuery to match what is written in the quotes with what is actually part of the document, and not necessarily what we write ...

Read More »

jQuery Val Example

The aim of this example is to explain and use the .val() method of jQuery. This method Gets the current value of the first element in the set of matched elements or sets the value of every matched element. In other words, the method returns or sets the value attribute of the selected elements. The .val() method is primarily used ...

Read More »

jQuery Prepend Example

The aim of this example is to explain and use the .prepend() method of jQuery. This method will allow you to insert content, specified by the parameter, to the beginning of each element in the set of matched elements. It is similar to the .append() method, except that the .append() method inserts content at the end of the selected elements. ...

Read More »

jQuery Filter Example

The aim of this example is to have a look at the .fiter(); method of jQuery. What this method does is reduce the set of matched elements to those that match the selector or pass the function’s test. In other words, the filter() method returns elements that match a certain criteria. It lets you specify a criteria. Elements that do ...

Read More »

jQuery Fadeout Example

In this example, the aim is to explain and use the .fadeOut() jQuery method. The fadeOut() method gradually changes the opacity, for selected elements, from visible to hidden (fading effect). If you’ve used this method previously, you probably know it is just the opposite of the .fadeIn() method. It hides the matched elements by fading them to transparent. It comes ...

Read More »

jQuery slideToggle / slideUp / slideDown Example

In this example, we’ll be considering three popular jQuery methods .slideUp, .slideDown, .slideToggle. For your basic understanding, know that slideUp hides the matched elements with a sliding motion, slideDown displays the matched elements with a sliding motion, while slideToggle will toggle between the two states, meaning it will display or hide the matched elements with a sliding motion. The methods ...

Read More »

jQuery Find Example

In this example we’re going to talk about the .find() method of jQuery. What this method does is kind of self-explanatory, it gets the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. A descendant is a child, grandchild, great-grandchild, and so on. It has only one argument, which is ...

Read More »

jQuery Siblings Example

The aim of this example is to go through the .siblings() method of jQuery. Basically, the siblings() method returns all sibling elements of the selected element. Just for your understanding, sibling elements are elements that share the same parent. This method traverse forward and backwards along siblings of DOM elements. In a more strict definition, given a jQuery object that ...

Read More »

jQuery Mousewheel Plugin Example

The aim of this example is to use the Mousewheel Plugin, a jQuery plugin that adds cross-browser mouse wheel support with delta normalization. Mouse Wheel is a lightweight plugin that has been used for many years in a wide variety of jQuery plugins, websites and web applications. In order to use the plugin, simply bind the mousewheel event to an ...

Read More »