Questions tagged [custom-element]

Custom Elements are a feature of HTML that provide a way for you to build your own fully-featured DOM elements and use them in your HTML markup, CSS stylesheets, and JavaScript code

Custom Elements are natively supported in all browsers, but for browsers that don’t yet implement them natively, some support is available through the use of a JavaScript polyfill.

Latest changes in Javascript / Ecmascript 2017, allow you to easily create HTML custom elements in an OOP like fashion that makes your code clear and your HTML mark-up more intuitive.

See also:

For a gallery of available custom elements check out WebComponents

973 questions
-1
votes
1 answer

maintaining a JS scope in a Custom Element constructor call

I am experimenting with a new pattern, where each newly created Card element uses the constructor scope to store (private) variables: pseudo code: class CardtsCard extends HTMLElement { constructor(){ let private = 666; …
Danny '365CSI' Engelman
  • 16,526
  • 2
  • 32
  • 49
-1
votes
1 answer

How can I place slotted elements into css grid?

My HTML is like this:
I have formatted the above with CSS like this: #grid-container { display: grid; } However, the items that I filled into the slot seem to be out of…
Jinghui Niu
  • 990
  • 11
  • 28
-1
votes
1 answer

Custom element with position absolute

I am trying to contain/put a fin-hypergrid within a web component, but because it's scrollbars are custom divs with position: absolute on them, they are positioned absolute to the window rather that the component itself. Here is my jsfiddle:…
Cheetah
  • 13,785
  • 31
  • 106
  • 190
-1
votes
1 answer

Two-way binded propery in custom polymer element

I want to modulize parts of my code. I've created a custom element that are to work with an Array and a Number. With two-way binding this should not be an issue. It is. It seem as though the child gets the property before it's ready.
Niklas Ternvall
  • 510
  • 1
  • 3
  • 19
-1
votes
1 answer

Custom
element with URI Template support

Is there a custom element, which allow the use of RFC6570 URI templates? This is very similar to this question. Here's the sample HTML used there.
Tomasz Pluskiewicz
  • 3,622
  • 1
  • 19
  • 42
-1
votes
1 answer

Why doesn't Custom Element work properly on static page?

(originally from https://github.com/w3c/webcomponents/issues/392, moved here) I'm working on a library (at http://infamous.io, for now at least) in which I'm creating a set of Custom Elements for rendering a 3D scene. The library registers two…
trusktr
  • 44,284
  • 53
  • 191
  • 263
-1
votes
2 answers

Polymer 1.0 dropdowns not showing in custom elements

I'm using the paper-dropdown-menu in several places in a polymer app. It works great in the topmost file (index.php). But somehow it doesn't work in all custom elements. I must be doing something wrong as I can't find anyone else online complaining…
Edward
  • 766
  • 2
  • 8
  • 18
-2
votes
1 answer

Create web page using JavaScript with a different web address

I have created a custom element using JavaScript. This custom element has been added to my HTML page. When the user clicks on this element, the user should be directed to a new page. This page should be created dynamically using JavaScript. I…
mufc9000
  • 9
  • 6
-2
votes
2 answers

What is the minimal implementation for custom elements example mentioned in the specifications?

https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-autonomous-example:htmlelement In the specification they've provided an example for Creating an autonomous custom element. However, they've left _updateRendering() method…
the Hutt
  • 16,980
  • 2
  • 14
  • 44
-2
votes
3 answers

Polymer Second Paper Drawer

i need a second paper drawer on the right side of my site. Is this possible with polymer 1 and the paper-drawer element? have anyone a code sample for me? thanks for your help!
-2
votes
1 answer

Custom Elements in ES2015 / JS6

What is the ES205 / JS6 way, to make a custom element equivalent to this one made by DartLang
Hasan A Yousef
  • 22,789
  • 24
  • 132
  • 203
-3
votes
1 answer

registerElement('my-tag', {prototype: progo}) how to do this with customeElements.define

I have the following: var importDoc = document.currentScript.ownerDocument; // importee var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { // get template in this doc. This is importDoc. var template =…
bartonlp
  • 123
  • 1
  • 6
1 2 3
64
65