public marks

PUBLIC MARKS from decembre with tags css & jQuery

2017

JQUERY - LIBRARY - jQuery.copyCSS

jQuery.copyCSS: Quick, simple jQuery extension to retrieve or copy all styles (with optional whitelist and blacklist) from an HTML element.

CSS / jQuery - Why I Love Element Queries & You Should Too! - Hashnode

by 1 other
For the past three years, I've done a lot of research and experiments related to the idea of style scoping and element queries in CSS. Since experimenting with element queries, I've noticed a big transformation in how I write HTML, and the fine-grained nature of element queries has improved the way I write CSS too. In this article I am going to explain why I love Element Queries and how you can get started easily.

2015

jQuery - Does jQuery .remove() clear out loaded javascript when it is used to remove a script tag? - Stack Overflow

No. Once a script is loaded, the objects and functions it defines are kept in memory. Removing a script element does not remove the objects it defines. This is in contrast to CSS files, where removing the element does remove the styles it defines. That's because the new styles can easily be reflowed. Can you imagine how hard it would be to work out what a script tag created and how to remove it? EDIT: However, if you have a file that defines myFunction, then you add another script that redefines myFunction to something else, the new value will be kept. You can remove the old script tag if you want to keep the DOM clean, but that's all removing it does. EDIT2: The only real way to "clean up" functions that I can think of is to have a JS file that basically calls delete window.myFunction for every possible object and function your other script files may define. For obvious reasons, this is a really bad idea.

BOKMARKLET - jQuery UI dialog in Bookmarklet and GreaseMonkey - Stack Overflow

(via)
Thanks to some awesome answers in other threads, I learned how to: load jQuery and jQuery-UI in a bookmarklet load a CSS into a bookmarklet using jQuery create a DIV in a bookmarklet using jQuery create jQuery UI dialog (external link) and I could manage to combine all four things into a single script which works both as a BookMarklet and as a GreaseMonkey script, which is absolutely awesome.

jQuery - TUTO - Iframe - Créer un élément HTML dans le DOM avec jQuery

Le sélecteur jQuery est la plupart du temps utilisé pour sélectionner des éléments existant dans le DOM, via une règle CSS. Mais le sélecteur peut aussi créer de nouveaux éléments HTML de manière extrêmement simple ! Voici un petit exemple très simple qui créé un élément div , écrit "Salut !" à l'intérieur, puis enfin ajoute cet élément à la fin de la page web (en l'ajoutant à la fin body) :

2013

JAVASCRIPT - jQuery - Lazy Load Plugin for jQuery

by 10 others (via)
Lazy Load is delays loading of images in long web pages. Images outside of viewport are not loaded until user scrolls to them. This is opposite of image preloading. Using Lazy Load on long web pages will make the page load faster. In some cases it can also help to reduce server load.