<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
body .tkl{
display: none;
transition: all .8s linear;
width: 0px;
height: 40px;
float: left;
}
body.open .tkl{
display: inline-block;
}
body.open .tkl.show{
width: 40px;
}
</style>
</head>
<body>
<input id="bbb" name="" type="button" value="go" onclick="go()"><br>
<img src="http://www.infoportal.pp.ua/_ph/13/2/706430891.jpg" alt="" class="tkl">
<img src="http://www.infoportal.pp.ua/_ph/13/2/706430891.jpg" alt="" class="tkl">
<img src="http://www.infoportal.pp.ua/_ph/13/2/706430891.jpg" alt="" class="tkl">
<img src="http://www.infoportal.pp.ua/_ph/13/2/706430891.jpg" alt="" class="tkl">
<img src="http://www.infoportal.pp.ua/_ph/13/2/706430891.jpg" alt="" class="tkl">
<script>
var timer, show, n = 0, fn = ["add","remove"];
function blinker(cls, duration, sel) {
var elems = [].slice.call(document.querySelectorAll(sel));
show = function() {
document.body.classList.add("open");
window.clearTimeout(timer);
};
return function() {
show();
(function mig(a) {
elems[n].classList[fn[0]](cls);
n = ++n % elems.length;
if(!n) {elems.reverse();fn.reverse()}
timer = window.setTimeout(mig, duration)
})()
}
}
var go = blinker("show", 800, ".tkl");
</script>
</body>
</html>