簡體   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