spin.js icon indicating copy to clipboard operation
spin.js copied to clipboard

Right positioning is required

Open andreszs opened this issue 10 years ago • 3 comments

Since only the ´top´ and ´left´ attributes are provided, it's impossible to properly align the spinner to the right of the page. Providing a ´right´ parameter would solve this.

andreszs avatar Jan 22 '15 02:01 andreszs

This would complicate positioning (i.e. if both left and right are specified which one would you use?), and it's easy enough on your side, so closing.

right = '60%'
left = (100 - (+(right.slice(0, -1)))) + '%'
// '40%'

right = 60
left = (100 - right) + '%'
// '40%'

TimothyGu avatar May 26 '15 18:05 TimothyGu

This fix doesn't work if I want to position the spinner 30px from the right without knowing the element width (on a button, for example).

dorian-marchal avatar Jun 04 '15 22:06 dorian-marchal

If we were to specifically support right positioning, to be consistent we would also need to support bottom positioning.

@dorian-marchal Is there anything preventing you from using CSS to accomplish this? For example:

var spinner = new Spinner({className: 'right-spinner', left: 'auto'});

And your CSS could contain something like this:

.right-spinner {
    right: 30px;
}

theodorejb avatar Nov 15 '17 17:11 theodorejb