dcamilleri / query-dom-components Goto Github PK
View Code? Open in Web Editor NEWQuery your dom components from html and store them into a JavaScript object
License: MIT License
Query your dom components from html and store them into a JavaScript object
License: MIT License
Hey Dorian,
I came across an issue today using query-dom-components
and having jQuery
defined in window
;
I'm using the regular JavaScript NodeList
afterwards, so passing a jQuery object returns an error.
I did a really quick patch as you can see in my fork, but it makes hasJquery
to false
by default if it's not previously specified in options
.
I guess this is not the idea behind it so we could do the opposite:
var wantJquery = opts.jQuery || true;
var hasJquery = wantJquery && typeof jQuery !== 'undefined';
So we'll need to do this to prevent jQuery being used (even if it's loaded):
var DOM = query({ el: this.el, jQuery: false });
Let me know what you think!
Hello, it's is me again :)
So, I have this use case; I'd like to apply a css prop on all .js-el
elements and after that, apply a tween on all .js-stagger
elements.
<div class="js-el js-stagger"></div>
<div class="js-el js-stagger"></div>
<div class="js-stagger"></div>
Currently, you cannot have multiple js-
classes on a single element.
The expected object would therefore be:
var object = {
el: NodeList[2],
stagger: NodeList[3]
};
Let me know what you think!
Hey Dorian,
I can't make query-dom-components
work for some reasons. I tried to console.log targetElements
under index.js
and it returns an empty NodeList (see screenshot).
var targetElements = container.querySelectorAll('*[class*="' + prefix + '"]');
console.log(container);
console.log(targetElements);
The last console.log is the queryDom
object:
var DOM = queryDom({el: document.getElementById('page-home')});
Using this HTML structure:
Do you have any ideas of what I'm doing wrong?
Merci! :)
Yo!
J'essaye d'utiliser query-dom-components
sur un SVG, et j'ai cette erreur:
Uncaught TypeError: element.className.split is not a function
(ligne 22)
As-tu une idée de ce qui pourrait produire ca?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.