The title pretty much says it. I would like to show a lightbox on page load only if the url is www.example.com/#popup versus www.example.com
标题几乎说得好。我想在页面加载时显示一个灯箱,如果网址是www.example.com/#popup而不是www.example.com
If this could be accomplished with google tag manager that would be grand
如果这可以通过谷歌标签管理器完成,这将是伟大的
I've see bits and pieces of this but I'm having trouble piecing it all together.
我已经看到了这个零碎的东西,但是我把它拼凑在一起很麻烦。
HTML:
HTML:
<a href="#" data-featherlight="#mylightbox">Open element in lightbox</a>
<div id="mylightbox">This div will be opened in a lightbox</div>
1 个解决方案
#1
2
if (window.location.hash == "#popup") {
$.featherlight("#mylightbox");
}
See https://github.com/noelboss/featherlight/#manual-calling-of-featherlight
请参阅https://github.com/noelboss/featherlight/#manual-calling-of-featherlight
Fiddle Shows manual lightbox open call. http://jsfiddle.net/fm9wp96r/
小提琴显示手动灯箱打开电话。 http://jsfiddle.net/fm9wp96r/
#1
2
if (window.location.hash == "#popup") {
$.featherlight("#mylightbox");
}
See https://github.com/noelboss/featherlight/#manual-calling-of-featherlight
请参阅https://github.com/noelboss/featherlight/#manual-calling-of-featherlight
Fiddle Shows manual lightbox open call. http://jsfiddle.net/fm9wp96r/
小提琴显示手动灯箱打开电话。 http://jsfiddle.net/fm9wp96r/