{"title":"Adding Hotspot Layer","id":51930,"link":"https:\/\/env.averta.net\/en\/step\/adding-hotspot-layer\/","parent":[51827],"content":"<p>Hotspot layer adds a small area over the slider. This small area shows a tooltip when the mouse cursor moves over the point. You can use hotspot layers to add additional info related to some specific areas of the slide image or a layer on the slide. For example, you can attach info for every part of a product over the slide.<\/p>\n<p>Below example shows how to create a hotspot layer. Like other layer types, you need to specify the layer by <code>ms-layer<\/code> class name and set its type by <code>data-type=\"hotspot\"<\/code> attribute.<\/p>\n<pre class=\"lang:xhtml decode:true \">\t&lt;div id=\"masterslider\" class=\"master-slider\"&gt;\r\n\t\t&lt;div class=\"ms-slide\"&gt;\r\n\t\t\t&lt;!-- .... --&gt;\r\n\t\t\t&lt;div class=\"ms-layer\" data-type=\"hotspot\"&gt;\r\n\t\t\t\t&lt;!-- tooltip content --&gt;\r\n\t\t        &lt;h3&gt;LOREM IPSUM DOLOR&lt;\/h3&gt;\r\n\t\t        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt.\r\n\t\t        &lt;!-- end of tooltip content --&gt;\r\n\t\t\t&lt;\/div&gt;\r\n\t\t\t&lt;!-- .... --&gt;\r\n\t\t&lt;\/div&gt;\r\n\t\t&lt;!-- .... --&gt;\r\n\t&lt;\/div&gt;<\/pre>\n<h2>Layer attributes<\/h2>\n<p>Hotspot layer has some data attributes to control the appearance of the hotspot point and the tooltip.<\/p>\n<ul>\n<li><code>data-align<\/code> &#8211; Specifies the alignment of the tooltip. Its default value is <code>\"top\"<\/code>.<\/li>\n<li><code>data-width<\/code> &#8211; Specifies the width of the tooltip container in pixels.<\/li>\n<li><code>data-transparent<\/code> &#8211; Hides the hotspot point (<code>data-transparent=\"true\"<\/code>).<\/li>\n<li><code>data-stay-hover<\/code> &#8211; Sets the tooltip stays until mouse cursor is over it (<code>data-stay-hover=\"true\"<\/code>). This option is disabled by default.<\/li>\n<li><code>data-tooltip-class<\/code> &#8211; Adds class name(s) to the tooltip container.<\/li>\n<\/ul>\n<h2>Set custom point<\/h2>\n<p>If you need to add a custom point as the hotspot, you can add it directly inside the hotspot layer and specify it as the hotspot point by <code>ms-hotspot-point<\/code> class name like the example below:<\/p>\n<pre class=\"lang:xhtml decode:true \">\t&lt;div id=\"masterslider\" class=\"master-slider\"&gt;\r\n\t\t&lt;div class=\"ms-slide\"&gt;\r\n\t\t\t&lt;!-- .... --&gt;\r\n\t\t\t&lt;div class=\"ms-layer\" data-type=\"hotspot\"&gt;\r\n\t\t\t\t&lt;!-- tooltip content --&gt;\r\n\t\t        &lt;h3&gt;LOREM IPSUM DOLOR&lt;\/h3&gt;\r\n\t\t        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt.\r\n\t\t        &lt;!-- end of tooltip content --&gt;\r\n\t\t        &lt;img src=\"...\/path\/to\/custom-hotspot-point.jpg\" alt=\"\" class=\"ms-hotspot-point\"&gt;\r\n\t\t\t&lt;\/div&gt;\r\n\t\t\t&lt;!-- .... --&gt;\r\n\t\t&lt;\/div&gt;\r\n\t\t&lt;!-- .... --&gt;\r\n\t&lt;\/div&gt;<\/pre>\n<p>This article only describes how to create the layer. I you need more information about layers, check out following articles:<\/p>\n<ul>\n<li><a href=\"https:\/\/env.averta.net\/en\/step\/positioning-layers\/?b=51939,51939\" title=\"Positioning Layers\">Positioning layers<\/a><\/li>\n<li><a href=\"https:\/\/env.averta.net\/en\/step\/defining-animation-for-the-layers\/?b=51959,51959\" title=\"Defining Animation for the Layers\">Animating layers<\/a><\/li>\n<li><a href=\"https:\/\/env.averta.net\/en\/step\/masking-a-layer\/?b=51971,51971\" title=\"Masking a Layer\">Masking layers<\/a><\/li>\n<li><a href=\"https:\/\/env.averta.net\/en\/step\/adding-a-layer-parallax-effect\/?b=51972,51972\" title=\"Adding a Layer Parallax Effect\">Layer parallax effect<\/a><\/li>\n<li><a href=\"https:\/\/env.averta.net\/en\/step\/linking-a-layer\/?b=51973,51973\" title=\"Linking a Layer\">Linking layer<\/a><\/li>\n<\/ul>\n","type":"solution"}