1

I've found angular-spinner which is based on spin.js, and I want to use it. Anyway, the example found in angular-spinner's README (http://plnkr.co/edit/BGLUYcylbIVJRz6ztbhf?p=preview) doesn't work as I expect. I want the spinner to overlay the selected DOM element and not the global window.

I have modified the plunker: http://plnkr.co/edit/9xsi8OFui3VeYuZ810VZ?p=preview - here you can see that there is a <div> element with red background. The spinner is outside it - what can I do to make it centered inside the red-background div?

ducin
  • 25,621
  • 41
  • 157
  • 256

1 Answers1

1

Add

position: relative;

in that red container

http://plnkr.co/edit/oPStHrLHXKUq3HE9pET0?p=preview

Linh Pham
  • 3,005
  • 23
  • 34
  • @tkoomzaaskz It is how the plugin was made. From what I seen, it used to force the spin to be centered within its container (for vertical and horizontal centering). – Linh Pham Mar 31 '15 at 09:38
  • @tkoomzaaskz Also I think the plugin was designed to use with a specific responsive framework (or it was tested with one). Since most of responsive framework will automatically add `position: relative;` to pretty much every elements... Just my opinion... – Linh Pham Mar 31 '15 at 09:44