1 contributor
<script>
function init() {
var imgDefer = document.getElementsByTagName("img");
for (var i=0; i<imgDefer.length; i++) {
if(imgDefer[i].getAttribute("data-src")) {
console.log("defer init: "+i);
imgDefer[i].setAttribute("src",imgDefer[i].getAttribute("data-src"));
} } }
window.onload = init;
function onArticle(index) {
if(index < 0) index = 0;
var string_index = "article-"+index;
//console.log("onArticle("+index+") : "+string_index);
var url = location.href;
var x = document.getElementById("item-active");
x.className = string_index;
document.getElementById("article-current").innerHTML =
document.getElementById(string_index).innerHTML;
location.href = "#article-top";
//console.log(document.getElementById(string_index).innerHTML);
}
</script>
</body>
</html>