【问题标题】:How to activate thickbox from a query string on the end of a url如何从 url 末尾的查询字符串激活thickbox
【发布时间】:2010-03-10 20:06:23
【问题描述】:

我是编程新手,也是这个网站的新手。我有一个关于使用thickbox和jquery在网站上显示叠加视频的快速问题。

我的问题是,当有人单击电子邮件中的链接时,我希望显示覆盖。所以链接应该是这样的:mywebsite.com/landingpage.html#playVideo,然后所有其他访问该网页的人都必须点击一个链接来激活覆盖。

我已经看到有关如何使用 js 为访问该网站的每个人播放覆盖的文档,但不适用于来自 html 链接的特定人员。

我对这方面的东西很陌生,主要是作为一名设计师,但我熟悉基本的编程,并且知道足以让自己在这种情况下陷入困境。我在截止日期前,任何人都可以做的任何帮助将不胜感激。我想您可以将其称为页面上厚框中显示的一段内容的永久链接。

提前谢谢你...

<head>
<script type="text/javascript" src="overlay_js/jquery.js"></script>
<script type="text/javascript" src="overlay_js/thickbox.js"></script>
<script type="text/javascript"> var tb_pathToImage = "images/loadingAnimation.gif";</script>

<style type="text/css" media="screen">@import "css/thickbox.css";</style>
</head>
<body>
<h2>Video Overlay Example</h2>
<div id="videoDisplay" style="display:none;">
<!– start embed code copied directly from youTube.com –>
<object width="425" height="355">
  <param name="movie" value="http://cdn-static.viddler.com/flash/simple_publisher.swf?key=c28782d6&autoplay=t"></param>
  <param name="wmode" value="transparent"></param>
  <embed src="http://cdn-static.viddler.com/flash/simple_publisher.swf?key=c28782d6&autoplay=t" type="application/x-shockwave-flash" width="425" height="355"></embed>
</object>
<!– end embed code copied directly from youTube.com –>
</div>
<a href="#TB_inline?height=365&width=425&inlineId=videoDisplay"
  class="thickbox" title="Bill Aulet">Click here to see my video</a>
</body>
</html>

【问题讨论】:

  • 您应该突出显示所有 HTML,然后点击代码按钮以正确格式化它,以便我们可以看到代码。

标签: jquery html query-string thickbox


【解决方案1】:

您可以使用 jquery 的插件 http://plugins.jquery.com/project/querystring 获取查询字符串信息,然后调用厚框加载/出现在您的 $(document).ready() 事件中:-)

【讨论】:

  • 我会告诉你如何加载你的thickbox,但是那里有很多“thickbox”,我不确定你在使用什么,但应该有关于他们的文档网站(无论您使用哪个)讨论如何做到这一点:-)
  • 是的,我的负载部分运行良好。我只是无法弄清楚这部分。我看到了查询字符串链接,但在记录如何实现它以捕获和传递数据方面并没有太大帮助。就像我说的那样,我对这一切都很陌生,我觉得我有点过头了。我很惊讶以前没有人愿意这样做。
猜你喜欢
  • 2012-05-11
  • 2012-12-13
  • 2018-07-17
  • 1970-01-01
  • 1970-01-01
  • 2012-09-30
  • 1970-01-01
  • 1970-01-01
  • 2010-11-05
相关资源
最近更新 更多