| 
		
			 Цитата: 
		
	 | 
	| 
		Что я не могу сделать:
	 | 
	
В следующий раз - как пробовали, и.т.д
<div id="target">
	<button>Click me</button>
</div>
<script>
	var config = {
		target: document.getElementById('target'),
		hide: { min: 3000, max: 5000 },
		show: { min: 5000, max: 10000 }
	};
	document.querySelector('button').onclick = function(){ toggle(config) };
	function rand(min, max) {
		return Math.round(min + Math.random() * (max - min));
	}
	function toggle(config) {
		var hideThrough = rand(config.hide.min, config.hide.max),
			showThrough = rand(config.show.min, config.show.max);
		
		if (config.target.getAttribute('data-isHiding')) {
			return false;
		}
		
		config.target.setAttribute('data-isHiding', true);
		
		// test
		console.log('I\'m going to hide target element via %s ms', hideThrough);
		
		setTimeout(function() {
			config.target.style.display = 'none';
			
			// test
			console.log('I\'ll show it via %s ms', showThrough);
			
			setTimeout(function() {
				config.target.style.display = 'block';
				config.target.removeAttribute('data-isHiding');
			}, showThrough);
		}, hideThrough);
	}
</script>