Select to view content in your preferred language

How to position zoom slider in UR corner (override default style)

2994
3
10-08-2015 08:41 PM
DirkVandervoort
Frequent Contributor

I've got a map dijit - by default the simple zoom slider (+/-) is in the upper left corner. I want to place it in the upper right corner. According to the documentation I can use this in my CSS:

.esriSimpleSliderTL {

    top: 50px;

    right: 50px

}

Unfortunately all this does is stretch the zoom slider. Like this:

scalestr.png

Try it here: http://jsfiddle.net/bEwcD/3/

How to I get that zoom slider 50px by 50px from the upper right?

TIA

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Dirk,

  you have to unset the left constraint.

.esriSimpleSliderTL {
    right: 50px;
    top: 50px;
    left: unset;
}
DirkVandervoort
Frequent Contributor

Close but not quite there yet. Turns out that unset is not supported in IE, Safari, and Opera.

unset - CSS | MDN

unset_-_CSS___MDN.png

RobertScheitlin__GISP
MVP Emeritus

Dirk,

  OK to make it work in browsers that don't support "unset" use "auto"

.esriSimpleSliderTL {
  right: 50px;
  top: 50px;
  left: auto;
}