简体   繁体   English

有没有办法模糊所有页面并使用jquery / javascript聚焦某些div?

[英]Is there any way to blur all page and focus certain div with jquery/javascript?

Is there any way to blur all page (for example set new background and give it to the foreground with z-index) and focus certain div (let's say error message) with jquery/javascript? 有没有办法模糊所有页面(例如设置新背景并使用z-index将其赋予前景)并使用jquery / javascript聚焦某些div(假设错误消息)? Do you know any plugin for that purpose? 你知道任何插件用于那个目的吗?

That's what I wanna get: 这就是我想得到的:

在此输入图像描述

You can use the jQuery UI dialog and use CSS to change the overlay div background with a blur background image, like here: 您可以使用jQuery UI对话框并使用CSS来更改带有模糊背景图像的叠加div背景,如下所示:

http://css-tricks.com/examples/BlurryBackgroundEffect/ http://css-tricks.com/examples/BlurryBackgroundEffect/

--or-- - 要么 -

You can use the jQuery UI dialog mixed with the CSS Text blur effect found here: 您可以使用jQuery UI对话框与此处的CSS Text blur效果混合使用:

http://motyar.blogspot.com/2010/04/blur-effect-with-css-and-jquery.html http://motyar.blogspot.com/2010/04/blur-effect-with-css-and-jquery.html

However, I assume this will NOT be backwards compatible with non-html5 browsers. 但是,我认为这不会向后兼容非html5浏览器。

Here's a JS fiddle for proof of concept: http://jsfiddle.net/khalifah/vgGtK/ 这是一个JS小提琴,用于概念验证: http//jsfiddle.net/khalifah/vgGtK/

Here's one with the style I think you want: http://jsfiddle.net/khalifah/7L5jG/ 这是我认为你想要的风格: http//jsfiddle.net/khalifah/7L5jG/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 jQuery模糊div不在焦点 - jQuery blur div not in focus jquery:绘制和擦除焦点上的边框,并在div的任何子元素上模糊 - jquery: drawing and erasing border on focus and blur on any child elements of a div jQuery / JavaScript模糊/焦点和设置超时 - jquery/javascript blur/focus & settimeout JavaScript会侦听所有焦点/模糊事件 - JavaScript listen for all focus/blur events 只有在输入字段中发生焦点和模糊的情况下,才可以使用javascript调用函数吗? - Is there any way where we can call function in javascript only if focus and blur happen with change in input field? 在JavaScript中,是否可以在IE上注册一个事件侦听器,以捕获页面上所有的更改,焦点和模糊事件? - In JavaScript is it possible on IE to register one event listener to capture all the change, focus, and blur events on the page? JavaScript / jQuery:是否只有在焦点对准表的情况下才能使用该函数? - JavaScript/jQuery: Is there any way to use a function on a table only when it is in focus? 有什么办法可以表明页面已滚动到某个div? - Is there any way to tell that the page has scrolled over a certain div? 通过javascript或jquery删除某些div索引之后的任何子元素 - remove any child element after certain div index by javascript or jquery jQuery blur()出现在焦点上 - jQuery blur() appears on focus
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM