why does the script affect everything on my Rails 3 app even when cased in this code?

前端 未结 1 340
小鲜肉
小鲜肉 2021-01-24 00:11

I have a third party script which is


<
相关标签:
1条回答
  • 2021-01-24 00:56

    After your clarified in a comment

    Yeah, including javascript will apply pagewide if nothing else is specified in the javascript.

    You need to do something like:

    <div class="post <%= 'copyright' if post.copyright%>">
      <img src="somesrc.jpg"></img>
    </div>
    

    and then apply the javascript only to the css selector 'div.copyright img'. Something along the lines of that. Depends on what the javascript supports or if you can change the source.

    0 讨论(0)
提交回复
热议问题