Show layer titles while swipe

927
2
Jump to solution
11-14-2020 11:29 PM
cadgism
Occasional Contributor

How can I display the image's title on both side of the view while at swipe

 

   

 
 

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
AnneFitz
Esri Regular Contributor

Here's another option, you can change whether the layer title is displayed or not based on the position of the swipe widget. In this sample, I only show layer2 (left side) label when the swipe widget is less than position 25, I only show layer1 (right side) label when position is greater than 75, and I show both labels otherwise.

https://codepen.io/annefitz/pen/zYBgROw

View solution in original post

Tags (1)
0 Kudos
2 Replies
AnneFitz
Esri Regular Contributor

This is one option for displaying the layer titles when swiping: you can update the opacity of the layer title based on the position of the Swipe widget. Here's an example: https://codepen.io/annefitz/pen/ZEOZyOz

AnneFitz
Esri Regular Contributor

Here's another option, you can change whether the layer title is displayed or not based on the position of the swipe widget. In this sample, I only show layer2 (left side) label when the swipe widget is less than position 25, I only show layer1 (right side) label when position is greater than 75, and I show both labels otherwise.

https://codepen.io/annefitz/pen/zYBgROw

Tags (1)
0 Kudos