Показать сообщение отдельно
  #7 (permalink)  
Старый 15.01.2012, 18:24
Аватар для 9xakep
сегодня в 12:34|Комментир
Отправить личное сообщение для 9xakep Посмотреть профиль Найти все сообщения от 9xakep
 
Регистрация: 12.04.2011
Сообщений: 1,180

<div id='colors'>
<div style='height:25px;width:25px;background:red' onclick="a('red')"></div><div style='height:25px;width:25px;background:green' onclick="a('green')"></div><div style='height:25px;width:25px;background:blue' onclick="a('blue')"></div></div>
<input type='button' value='hide' id='show_button' onclick='b()'>
<div id='sqare' style="height:100px;width:100px;background:red"><div>

<style type="text/css">
   #colors {
    border: solid; 
    width: 25px
   }
  </style>
<script>
function a(color) {
	document.getElementById('sqare').style.background = color

}
function b() {
	with(document.getElementById('colors').style) {
		display == 'none' ? display = 'block' : display = 'none'
			with(document.getElementById('show_button'))
			display == 'none' ? value = 'show' : value = 'hide'
	}
}
</script>
__________________
оляля, ололо
Ответить с цитированием