![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
jquery-visibility
Advanced tools
This plugin gives you a very simple API that allows you to execute callbacks when the page’s visibility state changes.
It does so by using the Page Visibility API where it’s supported, and falling back to good old focus
and blur
in older browsers.
http://mathiasbynens.be/demo/jquery-visibility
Typical use cases include but are not limited to pausing/resuming slideshows, video, and/or embedded audio clips.
This plugin simply provides two custom document events for you to use: show
and hide
. When the page visibility state changes, the appropriate event will be triggered.
You can use them separately:
$(document).on('show', function() {
// the page gained visibility
});
$(document).on('hide', function() {
// the page was hidden
});
For most applications you'll need both events, so the most convenient option is to use an events map. This way, you can bind both event handlers in one go:
$(document).on({
'show': function() {
console.log('The page gained visibility; the `show` event was triggered.');
},
'hide': function() {
console.log('The page lost visibility; the `hide` event was triggered.');
}
});
Or bind both to the same callback and distinguish using the event variable.
$(document).on('show hide', function (e) {
console.log('The page is now', e.type === 'show' ? 'visible' : 'hidden');
});
The plugin will detect if the Page Visibility API is natively supported in the browser or not, and expose this information as a boolean (true
/false
) in $.support.pageVisibility
.
Warning: $.support
was marked deprecated in jQuery version 1.9, so it is likely to be removed in the future.
if ($.support.pageVisibility) {
// Page Visibility is natively supported in this browser
}
If the Page Visibility API is supported the plugin will also store the current visibility state in document.hidden
.
if (!document.hidden) {
// Page is currently visible
}
This plugin is not a Page Visibility polyfill, as it doesn’t aim to mimic the standard API. It merely provides a simple way to use this functionality (or a fallback) in your jQuery code.
This plugin is available under the MIT license.
FAQs
Page visibility shim for jQuery.
The npm package jquery-visibility receives a total of 188 weekly downloads. As such, jquery-visibility popularity was classified as not popular.
We found that jquery-visibility demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.