Это это то, что я собрал, но понятия не имею, как это сделать.
Это исходный HTML-код без элемента :
Код: Выделить всё
Text for one
Text for two
Text for three
Код: Выделить всё
This is available
Text for one
Text for two
Text for three
Код: Выделить всё
This is NOT available
Text for one
Text for two
Text for three
Код: Выделить всё
var isVisible = ":visible";
var target = $('.result-content').children(":first");
//var target;
switch (target.css('display') == isVisible) {
case $('.available'):
console.log('This is available!');
break;
case $('.not-available'):
console.log('This is NOT available!');
break;
default:
//console.log('Nothing is available!!');
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... g-a-switch
Мобильная версия