是否可以在从链接打开页面时隐藏div,而不是导航到?

时间:2022-12-01 15:02:25

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?

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

1 个解决方案

#1


0  

Yes,

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

在链接中提供了一个查询参数,例如:&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.

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

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

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

Cheers

#1


0  

Yes,

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

在链接中提供了一个查询参数,例如:&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.

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

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

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

Cheers