热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Jquery到网页的灰色部分-Jquerytogrey-outpartsofthewebpage

Ihaveadesignasshowinthebelowimageandihavearequirementwhereusercanclickonthelink

I have a design as show in the below image and i have a requirement where user can click on the link in Rectangular area named as A, B & C. When one click on the click here link in Box B then all the green area should gray out except the BOX B and same should happen with BOX A, C.

我有一个如下图所示的设计,我有一个要求,用户可以点击名为A,B和C的矩形区域中的链接。当点击框B中点击此处链接时,所有绿色区域应该除了BOX B之外灰色,并且与BOX A,C相同。

Example as shown in image. When User open the page One User open the page

示例如图所示。当用户打开页面时

When User Click on the BOX B link  When User Click on the BOX B link

用户单击BOX B链接时

I am not sure if this is possible if there is any similar example where i can start from. I looked for but could not find similar example. Usually they example are related to whole page grey-out.

如果有任何类似的例子可以从我开始,我不确定这是否可行。我寻找但找不到类似的例子。通常它们的示例与整页灰显有关。

I can do same by using onmouseover and replace the whole image with the another image which has surrounding area in grey. But i am not allowed to do it this way. I am not sure if this is possible. I would appreciate if you can point me in right direction or if this is possible to certain area of page in grey..

我可以通过使用onmouseover执行相同的操作,并将整个图像替换为具有灰色周围区域的另一个图像。但我不允许这样做。我不确定这是否可行。如果你可以指出我正确的方向,或者如果这可以在灰色的页面的某个区域,我将不胜感激。

These page are designed for PHP scripting

这些页面专为PHP脚本而设计

6 个解决方案

#1


6  

I created a little example for you, which you can find here:

我为你创建了一个小例子,你可以在这里找到:

http://jsfiddle.net/Srj82/

Its' basically using a simple css z-index to overlap / hide the entire place, while the current selected element got temporarily a higher z-index than the overlapping

.

它'基本上使用简单的css z-index来重叠/隐藏整个地方,而当前所选元素暂时获得比重叠

更高的z-index。

You'll notice, while the overlapping

is visible, you can still click on the selected box. Anything else is not reachable (without removing event handlers or so). Just because there is another element which overlaps the rest.

您会注意到,当重叠的

可见时,您仍然可以单击所选的框。其他任何东西都无法访问(不删除事件处理程序等)。仅仅因为有另一个元素与其余元素重叠。

#2


0  

On click of A/B/C you can add a div overlay with a transparent grey bg color and increase the z-index of the clicked element higher than the overlay.

单击A / B / C时,您可以添加具有透明灰色bg颜色的div叠加,并将单击元素的z-index增加到高于叠加层。

#3


0  

Use an overlay div that will be positioned absolutely above anything else on your page with z-index then set your clicked box's z-index to overlay's + 1.

使用覆盖div,使用z-index将其定位在页面上的任何其他位置,然后将单击框的z-index设置为overlay + 1。

#4


0  

There are a couple of ways to do this, but a relatively quick and easy way is to make the elements that you need to grey out be of the same class. Then when you select an item give that element an additional class, and change the css for the elements named above except for the selected element with the additional class.

有两种方法可以做到这一点,但是一种相对快速和简单的方法是使你需要灰色的元素属于同一个类。然后,当您选择一个项目时,为该元素添加一个附加类,并更改上面命名的元素的css,除了带有附加类的selected元素。

This is a link describing one way to accomplish this.

这是描述实现此目的的一种方法的链接。

#5


0  

You could try to place an div over the area where A,B,C are placed. In this div you will have a background-color like so :

您可以尝试在放置A,B,C的区域放置div。在这个div中你将有一个像这样的背景颜色:

#myDivHider{
    background-color:rgba(0,0,0,0.4);
    display:none;
}

When you either click a,b or c You "activate" (display:block), the whole thing and set the z.index of your a,b or C that it get's up "higher".

当你点击a,b或c你“激活”(显示:阻止)时,整个事情并设置a,b或C的z.index,它会变得“更高”。

An alternative would be a plugin from jQueryTools, called Expose.

另一种选择是来自jQueryTools的插件,称为Expose。

  • http://jquerytools.org/demos/toolbox/expose/index.html

#6


0  

One way to do it would be to temporarily change positioning of the element to absolute and give it a high z-index, then add a layer below it that would act as the overlay.

一种方法是暂时将元素的位置更改为绝对值并为其赋予高z-index,然后在其下方添加一个层作为叠加层。

You could also use a plugin, for example this one: http://jquerytools.github.io/documentation/toolbox/expose.html

您也可以使用插件,例如:http://jquerytools.github.io/documentation/toolbox/expose.html


推荐阅读
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • FeatureRequestIsyourfeaturerequestrelatedtoaproblem?Please ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 生成对抗式网络GAN及其衍生CGAN、DCGAN、WGAN、LSGAN、BEGAN介绍
    一、GAN原理介绍学习GAN的第一篇论文当然由是IanGoodfellow于2014年发表的GenerativeAdversarialNetworks(论文下载链接arxiv:[h ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • 本文介绍了互联网思维中的三个段子,涵盖了餐饮行业、淘品牌和创业企业的案例。通过这些案例,探讨了互联网思维的九大分类和十九条法则。其中包括雕爷牛腩餐厅的成功经验,三只松鼠淘品牌的包装策略以及一家创业企业的销售额增长情况。这些案例展示了互联网思维在不同领域的应用和成功之道。 ... [详细]
  • 本文详细介绍了Android中的坐标系以及与View相关的方法。首先介绍了Android坐标系和视图坐标系的概念,并通过图示进行了解释。接着提到了View的大小可以超过手机屏幕,并且只有在手机屏幕内才能看到。最后,作者表示将在后续文章中继续探讨与View相关的内容。 ... [详细]
author-avatar
尚伦旺
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有