Difference between revisions of "Template:Team:Bielefeld-CeBiTec/JS"

(final final new navbar fix)
(added code to zoom into figures)
Line 108: Line 108:
 
}
 
}
 
resizeNavbar();
 
resizeNavbar();
 +
$(".cover").hide();
 +
$("#cover-set").hide();
 +
$("#cover").css({"background":"rgba(0, 0, 0, 0.5)"});
 +
$("#cover-box").css({"background":"rgba(255, 255, 255, 1)"});
 
});
 
});
  
Line 463: Line 467:
 
}, 10);
 
}, 10);
  
 +
 +
$(document).ready(function() {
 +
    $(".figure").mousedown(function() {
 +
$clickItem = $(this);
 +
$img = $clickItem.children("img");
 +
$p = $clickItem.children("p");
 +
$("#cover-img").attr("src", $img.attr("src"));
 +
$("#cover-set").attr("src", $img.attr("src"));
 +
$size = $("#cover-set").height();
 +
if ($size > $("#cover-box").height() * 0.85) {
 +
$newSize = ($("#cover-box").height() * 0.85);
 +
$("#cover-img").height($newSize + "px");
 +
}
 +
$("#cover-p").html($p.html());
 +
$(".cover").fadeIn(200);
 +
$(".test").html($size);
 +
    });
 +
});
 +
 +
$(document).ready(function() {
 +
    $(".cover").mousedown(function() {
 +
$(".cover").fadeOut(200);
 +
    });
 +
});
  
  

Revision as of 20:51, 23 September 2017