Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 77806

Re: Re: Display Images based on site's URL

$
0
0

So it would look something like this:

/* Convert the web address to lower case for comparisons sake */
var webAddress = window.location.href.toLowerCase();


/* Check if the web address contains part of the URL name */
if(webAddress.indexOf('victortechnologies')>-1){  /* The Web Address contains "victortechnologies' so set the Captivate User Variable to 'Victor' */   window.cpAPIInterface.setVariableValue('vImageToDisplay', 'Victor');
}else{  /* The Web Address does not contain "victortechnologies' so set the Captivate User Variable to 'Thermal' */    window.cpAPIInterface.setVariableValue('vImageToDisplay', 'Thermal');


}

 

So you'd use a 2-step Conditional Advanced Action on entry of the first slide to:

  • Execute this JavaScript (set 1 = 1 for the condition)
  • Check the value of the vImageToDisplay user variable and show/hide the appropriate image.

step1.jpg

 

Note that you'll want to check if vImageToDisplay is equal to "Victor".  I was using "HTML5" in my action below because my images were different.

step2-A.jpg

step2-B.jpg

 

I tested this and did not run into any timing issues.


Viewing all articles
Browse latest Browse all 77806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>