Namespace: cq-advertisement

WebComponents. cq-advertisement

Advertisement web component <cq-advertisement>.

Displays an advertisement banner as a "marker" (inside the chart, use CSS to position absolutely against the chart panel). The advertisement should contain content that can be enabled by calling CIQ.UI.Advertisement#show based on your business logic.

The advertisement will automatically adjust the height to accommodate the content (assuming overflow-y: auto)


<cq-advertisement style="display: block; height: 106px;">
    <cq-close class="ciq-tight"></cq-close>
	<div class="sample ciq-show">
		<div cq-desktop="">
			<div><translate original="$1 Trades">$1 Trades</translate></div>
			<div><translate original="Use code ">Use code </translate><strong><translate original="Sample">Sample</translate></strong></div>
			<a target="_blank" href="https://yourURL?codeSample&desktop"><translate original="Click to learn more">Click to learn more</translate></a>
		<div cq-phone="">
			<div><translate original="$1 Trades">$1 Trades</translate></div>
			<a target="_blank" href="https://yourURL?codeSample&mobile"><translate original="Click to learn more">Click to learn more</translate></a>



Hides the advertisement and surpresses it for 24 hours by storing it in local storage. If the selector itself changes however then the ad will reappear.

setSleepAmount(units, unitType)

Sets the sleep time for this amount of time before re-displaying

Name Type Description
units Number


unitType string

Unit type. Value values "minute","hour","day","week"

show( [selector] [, ignoreSleep])

Show the advertisement. This should be a div inside of the web component.

Name Type Argument Default Description
selector Selector <optional>

A selector. If none specified then the first div will be selected.

ignoreSleep Boolean <optional>

If true then ignore sleep

watchForRemoteClose( [ms])

Call this to force the advertisement to monitor the nameValueStore for updates. It will do this by polling. This is useful when running in multiple windows, do that if the advertisement is closed in one window then it will automatically close in the other windows.

Name Type Argument Default Description
ms Number <optional>

Number of milliseconds to poll.