dpts,
http://stackoverflow.com/questions/9...-in-javascript
window.addEventListener('DOMContentLoaded', function() {
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var view = +getParameterByName('view')||1,
li = document.querySelectorAll('.os-settings-li'),
div = document.querySelectorAll('.content');
[].forEach.call(li, function(el, i) {
el.addEventListener('click', function() {
[].forEach.call(div, function(d, k) {
i != k && (li[k].classList.remove('show'), d.classList.remove('show'));
});
el.classList.toggle('show')
div[i].classList.toggle('show')
});
});
li[--view].click()
});