Skip to content

Instantly share code, notes, and snippets.

{"lastUpload":"2021-11-01T10:08:01.974Z","extensionVersion":"v3.4.3"}
@nmrhard
nmrhard / Show and hide div
Last active March 9, 2016 10:28
Show and hide div
<div id='butShowHide' style='width:100%;height:50px;text-align:center;margin:0 auto;cursor:pointer'>
<b class="head_b">Показать</b>
</div>
<div id='forPhotosG' style='display:none'>aaaa</div>
$(document).ready(function () {
var $forPhotosG = $('#forPhotosG'),
$head_b = $('.head_b');
$('#butShowHide').click(function () {
function heightDetect() {
$(".main_head").css("height",$(window).height());
};
heightDetect();
$(window).resize(function() {
heightDetect();
});