find classes according to a regular expression
// find classes with scrollbars
// input regular expression pattern as input argument
function findClass( pattern ){
var allClassesTmp = {}, allMatchedClasses = [];
var rx = pattern ? (new RegExp(pattern)) : (new RegExp(".*"));
$('*[class]').each( function(){
var cn = this.className.split(/\s+/);
for(var i=cn.length;--i>-1;){
if(rx.test(cn[i]))allClassesTmp[ cn[i] ] = 1
}
});
var size = Object.keys(allClassesTmp).length;
console.log('total number:', size)
for(var i in allClassesTmp){
let attr = $('.'+i).css('overflow-y') == 'auto';
console.log(attr);
if (typeof attr !== typeof undefined && attr !== false) {
console.log('className',i);
console.log("Scroll Heights:",document.querySelector('.'+i).scrollHeight);
allMatchedClasses.push(i)
if(document.querySelector('.'+i).scrollHeight > document.querySelector('.'+i).clientHeight){
console.log(i);
allMatchedClasses.push(i)
}
}
};
return allMatchedClasses;
}
Also in JavaScript:
- textinput onpress react native
- how to create json file in c#
- angular in memory web api login curd exmpal
- Process event is emitted right before Node Process crashes and exits:
- update one component from another component angular 9
- javascript in viewport
- how to make link in discord.js
- jquery slideup
- how to get timestamp in javascript of a date object
- react native spinkit
- javascript picture delete after time
- vue get height of element ref
- what is jquery
- webpack css not shoud be empty
- set value of input javascript
- output event angular
- react native text input number only
- react/redux reducers sintaxe
- how to smooth scroll in javascript
- react strict mode
- ERROR TypeError: Cannot assign to read only property 'reportAirport' of object '[object Object]
- slap user discord.js
- use callback vs use memo
- preventive vs reactive