#15: Click selection of slides from menu

This commit is contained in:
imakewebthings 2011-08-31 16:21:37 +08:00
parent 8ecc5ed7c9
commit 4e28b1e511
9 changed files with 41 additions and 6 deletions

View file

@ -14,10 +14,11 @@
left: 0;
top: 0;
visibility: visible;
cursor: pointer;
}
.deck-menu iframe, .deck-menu img, .deck-menu video {
max-width: 100%;
}
.deck-menu .deck-current {
.deck-menu .deck-current, .no-touch .deck-menu .slide:hover {
background: #ddf;
}

View file

@ -102,9 +102,22 @@ on the deck container.
}
touchEndTime = now;
});
// Selecting slides from the menu
$.each($[deck]('getSlides'), function(i, $s) {
$s.unbind('click.deckmenu').bind('click.deckmenu', function(e) {
if (!$[deck]('getContainer').hasClass(opts.classes.menu)) return;
$[deck]('go', i);
$[deck]('hideMenu');
e.stopPropagation();
e.preventDefault();
});
});
})
.bind('deck.change', function(e, from, to) {
var container = $[deck]('getContainer');
if (container.hasClass($[deck]('getOptions').classes.menu)) {
container.scrollTop($[deck]('getSlide', to).offset().top);
}

View file

@ -16,13 +16,14 @@
left:0;
top:0;
visibility:visible;
cursor:pointer;
}
iframe, img, video {
max-width:100%;
}
.deck-current {
.deck-current, .no-touch & .slide:hover {
background:#ddf;
}
}

View file

@ -103,3 +103,12 @@
-moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
}
.no-touch .deck-container.deck-menu .slide:hover {
background: #444;
}
.no-touch.boxshadow .deck-container.deck-menu .slide:hover {
background: #000;
-webkit-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
-moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
}

View file

@ -124,5 +124,16 @@
box-shadow:0 0 20px #f0a, 0 0 5px #fff;
}
}
.no-touch & .slide:hover {
background:#444;
}
.no-touch.boxshadow & .slide:hover {
background:#000;
-webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
-moz-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
box-shadow:0 0 20px #f0a, 0 0 5px #fff;
}
}
}

View file

@ -70,6 +70,6 @@
.deck-container.deck-menu .slide {
background: #eee;
}
.deck-container.deck-menu .deck-current {
.deck-container.deck-menu .deck-current, .no-touch .deck-container.deck-menu .slide:hover {
background: #ddf;
}

View file

@ -84,7 +84,7 @@
background:#eee;
}
.deck-current {
.deck-current, .no-touch & .slide:hover {
background:#ddf;
}
}

View file

@ -170,7 +170,7 @@
.rgba .deck-container.deck-menu .slide {
background: rgba(0, 0, 0, 0.1);
}
.deck-container.deck-menu .slide.deck-current, .rgba .deck-container.deck-menu .slide.deck-current {
.deck-container.deck-menu .slide.deck-current, .rgba .deck-container.deck-menu .slide.deck-current, .no-touch .deck-container.deck-menu .slide:hover {
background: #fff;
}
.deck-container .goto-form {

View file

@ -192,7 +192,7 @@
background:rgba(0,0,0,.1);
}
&.deck-current, .rgba &.deck-current {
&.deck-current, .rgba &.deck-current, .no-touch &:hover {
background:#fff;
}
}