, , "" . , , .
,
$(document).on("keydown", function (e) { if (e.keyCode == 70 && e.ctrlKey) { ... } });
Ctrl f .
, , ( : 1 div, -, , - ), select . , DOM (, http://mark.koli.ch/2009/09/use-javascript-and-jquery-to-get-user-selected-text.html), , .
, !
, , ctrl-f.
HTML :
<div class="booklet">
<h1>Header 1</h1>
<div>Content in this flap</div>
<h1>Header 2</h1>
<div>Content in this flap</div>
<h1>Header 3</h1>
<div>Content in this flap</div>
</div>
h1 , , , cursor: pointer background-color, , , :
.booklet h1
{
cursor:pointer;
background-color:#3cf;
color:white;
border-top-left-radius:5px;
border-top-right-radius:5px;
padding:5px;
}
.booklet div
{
display:none;
border: 1px solid #3cf;
border-bottom-left-radius:5px;
border-bottom-right-radius:5px;
padding:5px;
}
Javascript:
$('.booklet').on("click", "h1", function()
{
$('.booklet div').hide();
$(this).next("div").show();
});
$('.booklet div').first().show();
$(document).on("keydown", function (e)
{
if (e.keyCode == 70 && e.ctrlKey)
{
$('.booklet div').show();
}
});
, , .