Comments (14)
Can't you just use CSS for this yourself outside the javascript plugin?
from spin.js.
I don't believe there is a very good way to select the spinner.
from spin.js.
In css:
.spinner {
color: black;
display: inline-block;
height: 44px;
width: 44px;
}
.spinner.someclass {
color: white;
}
In html:
<div class="spinner"></div>
<div class="spinner someclass"></div>
In js:
$(".spinner").spin();
This works on my spinners!
from spin.js.
Sure that works, but I shouldn't need to add extra markup to use the spinner.
from spin.js.
I added this to Spinner.defaults:
className: 'spinner',
And this:
el.setAttribute('class', self.opts.className);
Right before
el.setAttribute('aria-role', 'progressbar');
That adds a class of 'spinner' to the outermost div, which you can use to select and set z-index & positioning (will need to use !important for 'top' and 'left' to override inline style.
from spin.js.
Love this spinner, but I wanted to put in an upvote on this issue as well. I have some really tall elements that I'd like to be able to spin on, and instead of centering vertically, I'd like to just be able to set a vertical offset from the top of the element.
Maybe if the option 'vertical-offset' were set to something it could override the vertical centering?
from spin.js.
Just adding a class to the spinner automatically would be helpful, then I could target it in my CSS.
from spin.js.
I still don't see the issue personally. Assuming you're using a selector to find the elements you want to attach the spinner to, then you can use the same selector in CSS. If you're not using a selector and instead are manually targeting every place you want to apply the spinner in your javascript, then I personally think that's poor form and you'll find it gets really annoying later on as the project grows and you use it in more places.
On the other hand, if you don't like my idea, then I prefer ozike's method of adding a global classname to all the spinners.
from spin.js.
Created a pull request to address this issue: #55
from spin.js.
There are now new config options in 1.2.4: zIndex
, className
, top
and left
.
from spin.js.
Thanks Felix!
from spin.js.
I agree with the rename to top/left (vs. the topOffset/leftOffset from my patch), but I feel like they should just take valid CSS settings and not add the px. So, for instance, I should be able to do:
top: '50%'
from spin.js.
top: '50%' would be awesome.
from spin.js.
Is there a way to both have the spinner going and at the same time be able click at other elements within the page?
from spin.js.
Related Issues (20)
- Spin do not show animation in UI after updating Bootstrap and jQuery HOT 2
- please make sure newest versions are CDNs. HOT 7
- Since I upgrade the script the spin does not stop anymore.. HOT 4
- Pointers on how to use in Vue HOT 1
- problem
- div issue / undefined HOT 1
- Spinner looks weird when centered on odd number parent container widths... HOT 1
- NO spin.js HOT 2
- IE 11 Spinner Not Showing HOT 2
- Need to change spinner color HOT 1
- Sveltekit Vite error: SyntaxError: Unexpected token 'export'
- browserify HOT 1
- Uncaught SyntaxError: Unexpected token 'export' (at spin.js:82:1) HOT 2
- add mask
- Improving Documentation Website Font Legibility and Design
- Spinner Percentage Not Increase Continously In Increasing Order
- How Can I Remove Spinner In Spin.js? HOT 1
- spin.js module not recognized
- Invoking spinner before a "promise" not working HOT 5
- Clarification needed: how can I run spin.js options file detailed on website?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spin.js.