parse_str(file_get_contents('php://input'), $request);
.fold {
display: none;
}
<ul class="main-menu">
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4</li>
<li>item 5</li>
<li>item 6</li>
<li>item 7</li>
<li>item 8</li>
<li>item 9</li>
<li>item 10</li>
</ul>
function Folding() {
var maxShowCount=7,
main_menu=document.querySelector('.main-menu'),
items= (main_menu) ? main_menu.querySelectorAll('li') : false,
i,
show_more,
fold=0;
if (!items) return;
for (i in items) {
if (i >= maxShowCount) {
items[i].className='fold';
fold++;
}
}
if (fold) {
show_more=document.createElement('a');
show_more.appendChild(document.createTextNode('Показать больше'));
main_menu.appendChild(show_more);
show_more.addEventListener("click", show_all);
}
function show_all(e) {
var fold_items=main_menu.querySelectorAll('.fold'),
a;
show_more.removeEventListener("click", show_all);
e.target.remove();
for (a in fold_items) {
fold_items[a].className='';
}
};
}
Folding();
var radiobutton={
radios: document.querySelectorAll('input[type="radio"]'),
getSelect: function(event) {
var el=event.target,
val=el.value;
el.parentNode.parentNode.querySelectorAll('span')[0].textContent=val;
},
init: function() {
Array.prototype.forEach.call(this.radios, function (el, i) {
el.addEventListener('click', this.getSelect);
}.bind(this));
}
};
radiobutton.init();
function shuffle(arr) {
var newArr=[],
count=arr.length
i=null,
rnd=null;
for (i=0; i<count; i++) {
rnd=~~(Math.random() * arr.length);
newArr.push(arr[rnd]);
arr.splice(rnd,1);
}
return newArr;
}
console.log(shuffle(m));
var checkIfFlashEnabled = function() {
var isFlashEnabled = false;
// Проверка для всех браузеров, кроме IE
if (typeof(navigator.plugins)!="undefined" && typeof(navigator.plugins["Shockwave Flash"])=="object") isFlashEnabled = true;
else if (typeof window.ActiveXObject !="undefined") {
// Проверка для IE
try {
if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) isFlashEnabled = true;
} catch(e) {};
};
return isFlashEnabled;
};