I have this code
<script>
var content = document.getElementById('float_content_right');
var hide = document.getElementById('hide_float_right');
function hide_float_right() {
if (content.style.display == "none") {
content.style.display = "block";
hide.innerHTML = '<a href="javascript:hide_float_right()">Close [X]</a>';
} else {
content.style.display = "none";
hide.innerHTML = '<a href="javascript:hide_float_right()">Open...</a>';
}
}
var images = new Array();
images[0] = "<a href='http://phuongnuochoa.com' target='_blank'><img src='http://thegioidoco.net/gif/1.gif'></a>";
images[1] = "<a href='http://quattran.com' target='_blank'><img src='http://thegioidoco.net/gif/2.gif'></a>";
images[2] = "<a href='http://dogoducthien.vn' target='_blank'><img src='http://thegioidoco.net/gif/3.gif'></a>";
$(images[Math.floor(Math.random() * images.length)]).appendTo('#float_content_right');
setInterval(function () {
$('#float_content_right').empty();
$(images[Math.floor(Math.random() * images.length)]).appendTo('#float_content_right');
}, 5000);
</script>
And now i want, When I press the Close button the image is hidden, then F5 again the picture is still hidden. And if I don't press the Close button, then when I F5 the image is still there.
Please help me, this is my exercise!
Thanks.
localStoragefor this.