是否可以在从链接打开页面时隐藏div,而不是导航到?(Is it possible to hide a div when a page is opened from a link, rather th

编程入门 行业动态 更新时间:2024-10-28 17:13:26
是否可以在从链接打开页面时隐藏div,而不是导航到?(Is it possible to hide a div when a page is opened from a link, rather than navigated to?)

我想要一种情况,如果我提供链接到页面并且查看者单击它,则该页面上隐藏了单个元素(面包屑),但如果该人自己导航到该页面,则会显示相同的元素(面包屑) 。

是否有快速而肮脏的方法来实现这一目标?

I want a situation where if I supply a link to a page and a viewer clicks it, a single element (breadcrumbs) is hidden on that page, but if that person navigates to the page on their own that same element (breadcrumbs) is displayed.

Is there a fast and dirty way to accomplish this?

最满意答案

是,

在链接中提供了一个查询参数,例如:&clickedFromLink = true

然后使用您使用的任何语言或javascript,检查页面上的URL中是否存在此属性,您具有痕迹并相应地进行更改。

当有人输入URL时,他们将没有URL参数。

干杯

Yes,

In the link provide a query paramater something like: &clickedFromLink=true

Then using whatever language you use or javascript, check if this property exists in the URL on the page you have breadcrumb and make changes accordingly.

When someone just typed in the URL, they will not have the URL parameter.

Cheers

更多推荐

本文发布于:2023-08-02 07:00:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1371096.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是   页面   链接   div   hide

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!