<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Opacity Slider in ListItem Panel in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/opacity-slider-in-listitem-panel/m-p/1122744#M75475</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a Slider in a LayerList Item to change the transparency of the layers. The Problem is it doesn't work smooth if you drag it, it jumps or tremble. I think it could be a problem of the height of the item in the panel. I changed it in the developer console of the browser but it didn't resolve the problem.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would expect a behaviour like in thsis example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=featureeffect-geometry" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=featureeffect-geometry&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  view.when(() =&amp;gt; {

    // Layer List -&amp;gt; BEGIN
    const layerList = new LayerList({
      container: document.createElement("div"),
      view: view,
      listItemCreatedFunction: function(event){
        const item = event.item;
        
        const mySlider = new Slider({
          min: 0,
          max: 100,
          steps: 1,
          values: [100],
          visibleElements: {
            labels: true,
            rangeLabels: true}
        }); //mySlider

        mySlider.on("thumb-drag", function(event){ 
        item.layer.opacity = event.value/100;
        }); // mySlider.on

        item.panel = { 
          //content: "legend",
          content: mySlider,
          className: "esri-icon-chart"
        }; // item.panel

        item.actionsSections = [
          [ {
            title: "Layer information",
            className: "esri-icon-description",
            id: "information"
          }],
          [{
            title: "Increase opacity",
            className: "esri-icon-up",
            id: "increase-opacity"
          }, {
            title: "Decrease opacity",
            className: "esri-icon-down",
            id: "decrease-opacity"
          }]
        ]; // item.actionsSections
      } // listItemCreatedFunction
    }); // LayerList&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Dec 2021 17:57:48 GMT</pubDate>
    <dc:creator>GünterLassy</dc:creator>
    <dc:date>2021-12-04T17:57:48Z</dc:date>
    <item>
      <title>Opacity Slider in ListItem Panel</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/opacity-slider-in-listitem-panel/m-p/1122744#M75475</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a Slider in a LayerList Item to change the transparency of the layers. The Problem is it doesn't work smooth if you drag it, it jumps or tremble. I think it could be a problem of the height of the item in the panel. I changed it in the developer console of the browser but it didn't resolve the problem.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would expect a behaviour like in thsis example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=featureeffect-geometry" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=featureeffect-geometry&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  view.when(() =&amp;gt; {

    // Layer List -&amp;gt; BEGIN
    const layerList = new LayerList({
      container: document.createElement("div"),
      view: view,
      listItemCreatedFunction: function(event){
        const item = event.item;
        
        const mySlider = new Slider({
          min: 0,
          max: 100,
          steps: 1,
          values: [100],
          visibleElements: {
            labels: true,
            rangeLabels: true}
        }); //mySlider

        mySlider.on("thumb-drag", function(event){ 
        item.layer.opacity = event.value/100;
        }); // mySlider.on

        item.panel = { 
          //content: "legend",
          content: mySlider,
          className: "esri-icon-chart"
        }; // item.panel

        item.actionsSections = [
          [ {
            title: "Layer information",
            className: "esri-icon-description",
            id: "information"
          }],
          [{
            title: "Increase opacity",
            className: "esri-icon-up",
            id: "increase-opacity"
          }, {
            title: "Decrease opacity",
            className: "esri-icon-down",
            id: "decrease-opacity"
          }]
        ]; // item.actionsSections
      } // listItemCreatedFunction
    }); // LayerList&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Dec 2021 17:57:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/opacity-slider-in-listitem-panel/m-p/1122744#M75475</guid>
      <dc:creator>GünterLassy</dc:creator>
      <dc:date>2021-12-04T17:57:48Z</dc:date>
    </item>
  </channel>
</rss>

