init
This commit is contained in:
parent
06f61d8ce8
commit
f301cb744d
2271 changed files with 103162 additions and 0 deletions
1
02-ui/05-widgets/02-widgets-structure/menu-1/.plnkr
Executable file
1
02-ui/05-widgets/02-widgets-structure/menu-1/.plnkr
Executable file
|
@ -0,0 +1 @@
|
|||
{"name":"menu-1","plunk":"RdmJqSRbccWlmhJL4jkb"}
|
29
02-ui/05-widgets/02-widgets-structure/menu-1/index.html
Executable file
29
02-ui/05-widgets/02-widgets-structure/menu-1/index.html
Executable file
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="http://code.jquery.com/jquery.min.js"></script>
|
||||
<script src="menu.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="sweets-menu" class="menu">
|
||||
<span class="title">Сладости</span>
|
||||
<ul>
|
||||
<li>Торт</li>
|
||||
<li>Пончик</li>
|
||||
<li>Пирожное</li>
|
||||
<li>Шоколадка</li>
|
||||
<li>Мороженое</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var menu = new Menu({
|
||||
elem: $('#sweets-menu')
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
11
02-ui/05-widgets/02-widgets-structure/menu-1/menu.js
Executable file
11
02-ui/05-widgets/02-widgets-structure/menu-1/menu.js
Executable file
|
@ -0,0 +1,11 @@
|
|||
function Menu(options) {
|
||||
var elem = options.elem;
|
||||
|
||||
// отмена выделения при клике на меню
|
||||
elem.on('mousedown selectstart', false);
|
||||
|
||||
elem.on('click', '.title', function() {
|
||||
elem.toggleClass('open');
|
||||
});
|
||||
|
||||
}
|
20
02-ui/05-widgets/02-widgets-structure/menu-1/style.css
Executable file
20
02-ui/05-widgets/02-widgets-structure/menu-1/style.css
Executable file
|
@ -0,0 +1,20 @@
|
|||
|
||||
.menu ul {
|
||||
display: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.menu .title {
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
background: url(http://js.cx/clipart/arrow-right.png) left center no-repeat;
|
||||
padding-left: 18px;
|
||||
}
|
||||
|
||||
.menu.open ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.menu.open .title {
|
||||
background-image: url(http://js.cx/clipart/arrow-down.png);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue