jQuery Properties |context |jquery Property| jQuery.fx.interval |jQuery.fx.off |jQuery.support|

jQuery Properties :

Method Description
context Deprecated in version 1.10. Contains the original context passed to jQuery()
jquery Contains the jQuery version number
jQuery.fx.interval Change the animation firing rate in milliseconds
jQuery.fx.off Globally disable/enable all animations
jQuery.support A collection of properties representing different browser features or bugs (Intended for jQuery’s internal use)
length Contains the number of elements in the jQuery object

jQuery context Property :

Example :

  • Determine the context:
$("div").append("<p>" + $("div").context + "</p>")
.append("<p>" + $("div",document.body).context.nodeName + "</p>");

Definition and Usage :

  • The context property was deprecated in jQuery version 1.10.
  • The context property contains the original context passed to jQuery, which could be a DOM node context, or, if no node is passed, the document context.

Syntax :

context

jquery Property :

Example   :

  • Alert the current running jQuery version:
$("button").on("click",function(){
var version = $().jquery;
alert("You are running jQuery version: " + version);
});

Definition and Usage :

  • The jquery property returns a string containing the jQuery version number.

Syntax :

$().jquery

jQuery.fx.interval :

Example :

  • Cause the animation of a <div> element to run with less frames:
$("#toggle").on("click", function(){
$("div").toggle(5000);
});
$("#interval").on("click", function(){
jQuery.fx.interval = 500;
});

Definition and Usage :

  • The jQuery.fx.interval property is used to change the animation firing rate in milliseconds.
  • The default value is 13 milliseconds. This property is often used to modify the number of frames per second at which animations will run. Lowering the firing rate can make animations to run smoother. However, it may cause performance and CPU implications.
  • Note: For any changes to this property to take effect, no animation should be running or all animations should be stopped first.
  • Note: This property has no effect in browsers that support the requestAnimationFrame property.

Syntax  :

jQuery.fx.interval = <em>milliseconds</em>;
Parameter Description
milliseconds Required. Specifies the animation firing rate in milliseconds. Default is 13 milliseconds

jQuery.fx.off :

Example :

  • Toggle animation on and off:
$("#true").click(function(){
jQuery.fx.off = true;
});
$("#false").click(function(){
jQuery.fx.off = false;
});
$("#toggle").click(function(){
$("div").toggle("slow");
});

Definition and Usage :

  • The jQuery.fx.off property is used to globally disable/enable all animations.
  • Default value is false, which allows animations to run normally. When set to true, all animation methods will be disabled, which will immediately set elements to their final state, instead of displaying an effect.
  • Tip: To shorten the code, it is possible to use $.fx.off instead of jQuery.fx.off.

Syntax :

jQuery.fx.off = true|false;

jQuery.support :

Example :

Test whether the browser can create an XMLHttpRequest object:

$(document).ready(function(){
$(“p”).html(“This browser can create XMLHttpRequest object: ” + jQuery.support.ajax);
});