Сообщение от aleks7890
|
как на javascript присвоить этим меню эти классы?
|
Как вариант...
obj.className='имя_класса'
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251">
<style type="text/css">
li {
margin-bottom: 5px;
cursor: pointer;
}
.on {
border: 1px solid;
}
</style>
<script type='text/javascript'>
function Go(Obj) {
Obj.className=(Obj.className=='on')? '': 'on'
}
</script>
</head>
<body>
<ul>
<li onclick='Go(this)'>Item 1</li>
<li onclick='Go(this)'>Item 2</li>
<li onclick='Go(this)'>Item 3</li>
<li onclick='Go(this)'>Item 4</li>
<li onclick='Go(this)'>Item 5</li>
</ul>
</body>
</html>