Jquery not working on new Cornerstone elements

Hi,

I’m using some custom JQuery that swaps content depending on referrer. It works fine on older cornerstone layouts, but isn’t working on pages I built with newer versions of cornerstone. Any idea what could be going on?

Example of code:

jQuery('#BgImg').css('background-image', 'url(http://treehouserecovery.com/wp-content/uploads/2018/05/after- 
addiction.jpg)');

This should swap the image above “Medication Philosophy.”

Also, swapping the header “About” isn’t working on this page. I am trying to use the following code:

document.getElementById("dynamicHead").textContent="newtext";

Thanks so much!

Hi there,

I am not sure why the codes you have provided did not work when you tried it but when I added it in the Global JS, it seems to work fine. You can find it in the Dynamic About page.

Hope this helps.

yes. They seem to be working now. Sorry about that. Thanks so much!

Glad to hear that. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.