You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement this TagCloud as a ImageCloud but I encountered a problem with the opacity / Zindex :
I resolved it by adding an observer to every .tagcloud--item. I've not managed changed object class name but here is the code:
// Options for the observer (which mutations to observe)constconfig={attributes: true,attributeFilter: ['style']};// Callback function to execute when mutations are observedconstchangeOpacity=function(mutationsList,_){for(constmutationofmutationsList){if(mutation.type==='attributes'&&mutation.attributeName==='style'){mutation.target.style.zIndex=100*(mutation.target.style.opacity);}}};// Create an observer instance linked to the callback functionconstobserver=newMutationObserver(changeOpacity);consttags=document.querySelectorAll(.tagcloud--item);for(consttagoftags){// Start observing the target node for configured mutationsobserver.observe(tag,config);}
Here is the final result 👍
Hope this helps !
The text was updated successfully, but these errors were encountered:
I'm trying to implement this TagCloud as a ImageCloud but I encountered a problem with the opacity / Zindex :
I resolved it by adding an observer to every
.tagcloud--item
. I've not managed changed object class name but here is the code:Here is the final result 👍
Hope this helps !
The text was updated successfully, but these errors were encountered: