繁体   English   中英

如何使用 jquery 在 hayden 模板中注入链接横幅图像?

[英]How can I inject a link banner image in an hayden template with jquery?

我的一位客户在 squarespace 上有一个使用 hayden 模板的网站。 他们在主页上有一个横幅图片(缩略图),上面有文字和按钮链接。 该按钮链接到一个联系页面,但我也试图让整个背景图片链接到一个外部 URL。

我无权访问 HTML,我只能添加自定义 CSS。 还有一个叫做 PAGE HEADER CODE INJECTION(输入将被注入到这个页面的头部的代码。)

我一直在尝试将 jquery 注入高级编辑器,但我认为我可能使用了错误的 ID 或类?

这就是我一直在尝试的。 无论如何,我可以在不接触 HTML 的情况下链接此图像吗?

网站网址:www.ironathleteclinics.com

我将它注入到标题中:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

这进入页脚:

<script> $(document).ready(function(){ $('#collection-55dc8e2fe4b00187e448da91 .content-fill').css('cursor', 'pointer'); }); </script>

<script>$(function(){ $('#collection-55dc8e2fe4b00187e448da91 .content-fill').bind('click',function() { window.location = "www.google.com" }); });</script>

实际上,我刚刚在 hayden 模板上的特殊情况下弄清楚了! 标题:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

页脚:

$('#promotedGalleryWrapper, .promoted-gallery-wrapper, .banner-thumbnail-wrapper, .sqs-featured-posts-gallery').css('cursor', 'pointer'); }); </script>

<script>
   $(function(){ 
      $('#promotedGalleryWrapper, .promoted-gallery-wrapper, .banner-thumbnail-wrapper, .sqs-featured-posts-gallery')
      .bind('click',function() { 
                        window.location = "http://www.athleteps.com/nike-weightlifting/" 
           }); 
      });
 </script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM