# Slider Coding Questions

**URL:** <https://discourse.psychopy.org/t/slider-coding-questions/9332>\
**Category:** Builder\
**Created:** [October 8, 2019, 1:06pm UTC](https://discourse.psychopy.org/t/slider-coding-questions/9332 "2019-10-08T13:06:16Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [October 9, 2019, 2:13pm UTC](https://discourse.psychopy.org/t/slider-coding-questions/9332/10 "2019-10-09T14:13:48Z")

</div>

Weird, that worked for me. Have you also set the color and markersize at the beginning of the experiment? Here is a working version [https://run.pavlovia.org/dvbridges/sliderunits/html/](https://run.pavlovia.org/dvbridges/sliderunits/html/) . The code:

```auto
# Begin Experiment
col = new util.Color('green')
markerSize = 35;

# Each Frame
try {
    if (slider._markerColor.int !== col.int) {
        slider._markerColor = col;
        slider._marker.lineStyle(1, col.int, 1, 0.5);
        slider._marker.beginFill(col.int, 1);
        
        // Triangle Marker
        slider._marker.moveTo(0, 0);
        slider._marker.lineTo(markerSize, -markerSize);
        slider._marker.lineTo(-markerSize, -markerSize);
        slider._marker.endFill();
        
        // Circle marker
        // slider._marker.drawCircle(0, 0, 35/2);
        // slider._marker.endFill();
        slider._needUpdate = true;
        slider._updateIfNeeded();

     }
} catch (err) {}

```

---

_[View the full topic](https://discourse.psychopy.org/t/slider-coding-questions/9332)._
