How to use a circleType for several elements
up vote
0
down vote
favorite
I want all labels to have a circleType. When I define a circleType only for one label with getElementById , it succeeds. But when I use getElementsByClassName it does not work.
<div id="playlistAll">
<div class="divHover">
<label class="class-name" id="first">AAAAA</label>
<div class="playlistCon">
</div>
</div>
<div class="divHover">
<label class="class-name">BBBBBB</label>
<div class="playlistCon">
</div>
</div>
working
const circleType = new CircleType(document.getElementById('first'));
circleType.radius(100);
not working
const circleType = new CircleType(document.getElementsByClassName('class-name'));
circleType.radius(100);
Does anyone have an idea?
Thanks in advance.
html css
add a comment |
up vote
0
down vote
favorite
I want all labels to have a circleType. When I define a circleType only for one label with getElementById , it succeeds. But when I use getElementsByClassName it does not work.
<div id="playlistAll">
<div class="divHover">
<label class="class-name" id="first">AAAAA</label>
<div class="playlistCon">
</div>
</div>
<div class="divHover">
<label class="class-name">BBBBBB</label>
<div class="playlistCon">
</div>
</div>
working
const circleType = new CircleType(document.getElementById('first'));
circleType.radius(100);
not working
const circleType = new CircleType(document.getElementsByClassName('class-name'));
circleType.radius(100);
Does anyone have an idea?
Thanks in advance.
html css
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want all labels to have a circleType. When I define a circleType only for one label with getElementById , it succeeds. But when I use getElementsByClassName it does not work.
<div id="playlistAll">
<div class="divHover">
<label class="class-name" id="first">AAAAA</label>
<div class="playlistCon">
</div>
</div>
<div class="divHover">
<label class="class-name">BBBBBB</label>
<div class="playlistCon">
</div>
</div>
working
const circleType = new CircleType(document.getElementById('first'));
circleType.radius(100);
not working
const circleType = new CircleType(document.getElementsByClassName('class-name'));
circleType.radius(100);
Does anyone have an idea?
Thanks in advance.
html css
I want all labels to have a circleType. When I define a circleType only for one label with getElementById , it succeeds. But when I use getElementsByClassName it does not work.
<div id="playlistAll">
<div class="divHover">
<label class="class-name" id="first">AAAAA</label>
<div class="playlistCon">
</div>
</div>
<div class="divHover">
<label class="class-name">BBBBBB</label>
<div class="playlistCon">
</div>
</div>
working
const circleType = new CircleType(document.getElementById('first'));
circleType.radius(100);
not working
const circleType = new CircleType(document.getElementsByClassName('class-name'));
circleType.radius(100);
Does anyone have an idea?
Thanks in advance.
html css
html css
asked Nov 10 at 19:49
gliklach
53
53
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
The readme for CircleType indicates that the constructor only accepts an HTML element, not elements. So, if you really want to use that class for multiple elements, you'll probably need to loop over each element and create an instance of CircleType for each one.
I create the labels dynamically. In what other way can I set the label to be rounded to everyone?
– gliklach
Nov 10 at 21:43
You could always tinker with the CSS border-radius property.
– Snake14
Nov 10 at 22:25
Border-radius makes the label border rounded but not the text, am I wrong?
– gliklach
Nov 10 at 23:00
Correct. It only affects the border of the label.
– Snake14
Nov 10 at 23:12
Is there a way to affects the text of some labels?
– gliklach
Nov 10 at 23:22
|
show 2 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
The readme for CircleType indicates that the constructor only accepts an HTML element, not elements. So, if you really want to use that class for multiple elements, you'll probably need to loop over each element and create an instance of CircleType for each one.
I create the labels dynamically. In what other way can I set the label to be rounded to everyone?
– gliklach
Nov 10 at 21:43
You could always tinker with the CSS border-radius property.
– Snake14
Nov 10 at 22:25
Border-radius makes the label border rounded but not the text, am I wrong?
– gliklach
Nov 10 at 23:00
Correct. It only affects the border of the label.
– Snake14
Nov 10 at 23:12
Is there a way to affects the text of some labels?
– gliklach
Nov 10 at 23:22
|
show 2 more comments
up vote
0
down vote
accepted
The readme for CircleType indicates that the constructor only accepts an HTML element, not elements. So, if you really want to use that class for multiple elements, you'll probably need to loop over each element and create an instance of CircleType for each one.
I create the labels dynamically. In what other way can I set the label to be rounded to everyone?
– gliklach
Nov 10 at 21:43
You could always tinker with the CSS border-radius property.
– Snake14
Nov 10 at 22:25
Border-radius makes the label border rounded but not the text, am I wrong?
– gliklach
Nov 10 at 23:00
Correct. It only affects the border of the label.
– Snake14
Nov 10 at 23:12
Is there a way to affects the text of some labels?
– gliklach
Nov 10 at 23:22
|
show 2 more comments
up vote
0
down vote
accepted
up vote
0
down vote
accepted
The readme for CircleType indicates that the constructor only accepts an HTML element, not elements. So, if you really want to use that class for multiple elements, you'll probably need to loop over each element and create an instance of CircleType for each one.
The readme for CircleType indicates that the constructor only accepts an HTML element, not elements. So, if you really want to use that class for multiple elements, you'll probably need to loop over each element and create an instance of CircleType for each one.
answered Nov 10 at 20:02
Snake14
27917
27917
I create the labels dynamically. In what other way can I set the label to be rounded to everyone?
– gliklach
Nov 10 at 21:43
You could always tinker with the CSS border-radius property.
– Snake14
Nov 10 at 22:25
Border-radius makes the label border rounded but not the text, am I wrong?
– gliklach
Nov 10 at 23:00
Correct. It only affects the border of the label.
– Snake14
Nov 10 at 23:12
Is there a way to affects the text of some labels?
– gliklach
Nov 10 at 23:22
|
show 2 more comments
I create the labels dynamically. In what other way can I set the label to be rounded to everyone?
– gliklach
Nov 10 at 21:43
You could always tinker with the CSS border-radius property.
– Snake14
Nov 10 at 22:25
Border-radius makes the label border rounded but not the text, am I wrong?
– gliklach
Nov 10 at 23:00
Correct. It only affects the border of the label.
– Snake14
Nov 10 at 23:12
Is there a way to affects the text of some labels?
– gliklach
Nov 10 at 23:22
I create the labels dynamically. In what other way can I set the label to be rounded to everyone?
– gliklach
Nov 10 at 21:43
I create the labels dynamically. In what other way can I set the label to be rounded to everyone?
– gliklach
Nov 10 at 21:43
You could always tinker with the CSS border-radius property.
– Snake14
Nov 10 at 22:25
You could always tinker with the CSS border-radius property.
– Snake14
Nov 10 at 22:25
Border-radius makes the label border rounded but not the text, am I wrong?
– gliklach
Nov 10 at 23:00
Border-radius makes the label border rounded but not the text, am I wrong?
– gliklach
Nov 10 at 23:00
Correct. It only affects the border of the label.
– Snake14
Nov 10 at 23:12
Correct. It only affects the border of the label.
– Snake14
Nov 10 at 23:12
Is there a way to affects the text of some labels?
– gliklach
Nov 10 at 23:22
Is there a way to affects the text of some labels?
– gliklach
Nov 10 at 23:22
|
show 2 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242798%2fhow-to-use-a-circletype-for-several-elements%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown