<table border>
<thead>
<td>ПН</td>
<td>ВТ</td>
<td>СР</td>
<td>ЧТ</td>
<td>ПТ</td>
<td>СБ</td>
<td>ВС</td>
</thead>
<tr id="state">
<td>Выходной</td>
<td>Выходной</td>
<td>Выходной</td>
<td>Выходной</td>
<td>15-21</td>
<td>15-21</td>
<td>16-21</td>
</tr>
</table>
var
$Table = $("<table />"),
$Thead = $("<thead />").appendTo($Table),
$Row = $("<tr />").appendTo($Table),
$_tds = $("#state td"), $_heads = $("thead td"),
start, i = 0;
for(; i < $_tds.length; i++){
start = i;
while(
$_tds.get(i++) && $_tds.eq(i).text() == $_tds.eq(i - 1).text()
){}
$Row.append(
"<td>" + $_tds.eq(--i).text() + "</td>"
);
$Thead.append(
"<td>" + (i == start ? "" : $_heads.eq(start).text() + "-") + $_heads.eq(i).text() + "</td>"
);
}
$("table").replaceWith($Table);
.button{
opacity: 0;
position: fixed;
color: white;
font-size: 70px;
visibility: hidden;
text-align: center;
transition: all 0.5s;
background: #343434;
border-radius: 70px;
display: inline-block;
right: 50px; bottom: 30px;
width: 70px; height: 70px;
}
.visible{
visibility: visible;
opacity: 1;
}
<a href="#toTop" class="button">↑</a>
(function($scrollButton, $win){
$(document).scroll(function(){
$scrollButton.toggleClass("visible", $win.scrollTop() > 300);
});
$scrollButton.click(function(e){
e.preventDefault();
$("body, html").animate({scrollTop : 0}, 500);
});
})( $(".button"), $(window) );
echo strrev("String"); //gnirtS
echo strrev("Строка"); //�коЀтѡ�
), то можно поиграть с кодировкой:function str_reverse($string){
return iconv('utf-16be', 'utf-8', strrev(
iconv('utf-8', 'utf-16le', $string)
));
}
function str_reverse($string){
return implode("", array_reverse(
str_split($string)
));
}
<ul id="load_numAll-shet" style="display:none">
<li data-n="10" class="load_numAll-li">10</li>
<li data-n="50" class="load_numAll-li">50</li>
<li data-n="70" class="load_numAll-li">70</li>
<li data-n="80" class="load_numAll-li">80</li>
</ul>
<output id="load_numAll-show"></output>
var output = document.querySelector("#load_numAll-show"),
lies = document.querySelectorAll(".load_numAll-li");
output.value = Array.prototype.reduce.call(
lies, function(p, t){
return p + (+t.dataset.n);
}, 0
);
<a href="#" id="rr"><img src="img.png"></a>
var elem = document.querySelector("#rr");
elem.matсhes("noindex *"); //true, если элемент лежит в noindex
Array.prototype.reduce.call($("input"), function(p, t){
return p[t.name] = t.value, p;
}, {});
<input type="text" name="one" value="222">
<input type="text" name="two" value="228">
{
one : "222",
two : "228"
}