Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1407846
    Gabriel Z
    Participant

    Hi,

    I’m using the latest X 4.6.4 and I need to add a rel=”noshare” attribute to the background image which was added with the customizer.

    <script>jQuery.backstretch([‘//domain.com/images/2017/03/my-background.png’], {fade: 0});</script>

    I’m using image sharing buttons and I’m getting popups on mobile when someone accidentally hits the background. The problem accrues in a full-width template on mobile.

    How can I add a rel=”noshare” attribute to the background image?

    Thanks,
    Gabriel

    #1408149
    Rupok
    Member

    Hi Gabriel,

    Thanks for writing in! You can’t directly set any attributes to the background image but could be possible with some custom JS. Can you provide your URL so that I can test some code for your site?

    Cheers!

    #1409914
    Gabriel Z
    Participant
    This reply has been marked as private.
    #1410471
    Friech
    Moderator

    Hi There,

    Please add this in Custom > Global JavaScript on Customizer.

    jQuery(document).ready(function($){
    $(".backstretch img").attr("rel", "noshare");
    });

    Hope it helps, Cheers!

    #1411147
    Gabriel Z
    Participant

    Hi Friech,

    Super, works like charm. 🙂

    Thank you very much for your help.

    Cheers,
    Gabriel

    #1411440
    Jade
    Moderator

    You’re most welcome, Gabriel.

  • <script> jQuery(function($){ $("#no-reply-1407846 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>