Archive for October 2018

Better Version of the Perfect Programming Now for You

More than 10 years have passed since JQuery began its widespread use on the Internet, and it is still very popular. In July 2015, JQuery announced alpha version 3.0, the largest update in many years.The current version 3.1.1, which was released in September 2016, fixed many bugs, added new methods and removed redundant ones, and also changed the behavior of some functions. Let’s look at the innovations that were presented in this version.

Methods to hide and display

For better compatibility with responsive design, jQuery3 has been enhanced to allow multiple elements to be hidden. Tests have shown that the new version copes with it 2% faster than the previous one.

Show / hide

In addition, methods hide; .show and .toggle will focus on inline-styles. This feature will allow you to work correctly with the function display, which will allow CSS rules to change dynamically depending on events such as changing the window resolution and screen orientation. For the Query Time import this is important now.

In query 2, wrap all when passing a function as an argument, the method behaved exactly the same as the method .wrap. This has been changed – now it .wrap All (function) calls the function and uses the string representation of the result as a wrapper for the collection.

In query 3, an optional method selector parameter also appeared unwrap. This innovation allows the method to pass a string value that contains a selector expression.

Height and width scroll bars now count

In query 2, the call width returned the width of the content, not counting the scroll bars added by the browser when the content was larger than the element. In order to provide the ability to measure, equivalent to the CSS-media query, outer Width andouter Height now return the width and length, taking into account the scroll bars. This is equivalent to the DOM property window

Data behavior

In query 3, the behavior of the method has data been slightly modified to fit the Dataset API specification? Now it translates property names into camel notation.

As you noticed, the parameter name is translated into camel notation, while in older versions the parameter remained in lower case with a hyphen.

SVG support for class operations

Query still does not fully support SVG, but methods like .has Class or .add Class that control CSS classes can be used to work with SVG. You can modify or find classes in SVG, then apply styles to classes using CSS.

Hide and show filters

JQuery 3 changes the meaning of filters: visible and: hidden. It perceives the elements as: visible if they have at least some layout windows, including those that have zero width and length. For example, an element brand string elements with no content will be highlighted by a filter:visible.

Query no longer rounds height and width

Now JQuery returns fractional values, width andheight instead of an integer if the browser supports it. For users who need sub-pixel accuracy (for example, when designing websites), this can be useful.