Skip to content

Instantly share code, notes, and snippets.

View haruhiko-zht's full-sized avatar
😇
RAGE QUIT MY LIFE, THANK YOU.

haruhiko-zht

😇
RAGE QUIT MY LIFE, THANK YOU.
View GitHub Profile
@haruhiko-zht
haruhiko-zht / child.html
Last active October 10, 2018 01:20
iframe-picture_modal
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/stylesheet.css">
</head>
<body>
<a id="modal-picture" href="img/picture.jpg"><img src="img/picture.jpg"></a>
@haruhiko-zht
haruhiko-zht / stylesheet.css
Created October 10, 2018 01:31
iframe-picture_modal
#bg {
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.4);
}
#photo {
@haruhiko-zht
haruhiko-zht / script.js
Last active October 10, 2018 01:56
iframe-picture_modal
$(function() {
$("#iframe-child").on("load", function() {
$("#iframe-child").contents().find("#modal-picture").click(function() {
$("body").append('<div id="bg"></div>');
$("body").append('<div id="photo"></div>');
$("#bg").hide();
$("#photo").hide();
@haruhiko-zht
haruhiko-zht / parent.html
Created October 10, 2018 01:40
iframe-picture_modal
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/stylesheet.css">
<script src="js/jquery-3.3.1.min.js"></script>
</head>
<body>
@haruhiko-zht
haruhiko-zht / script.js
Created October 10, 2018 10:40
iframe_decide_parent-or-child
if(window == window.parent) {
alert("親ページです");
} else {
alert("子ページです");
}
@haruhiko-zht
haruhiko-zht / script.js
Created October 10, 2018 10:50
iframe_decide_parent-or-child
if(window == window.parent) {
$("body").css("min-width","1080px");
}
@haruhiko-zht
haruhiko-zht / index.html
Created October 11, 2018 04:40
slide_links()
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/stylesheet.css">
<script src="js/jquery-3.3.1.min.js"></script>
</head>
<body>
@haruhiko-zht
haruhiko-zht / stylesheet.css
Created October 11, 2018 04:56
slide_links()
#links-content {
width: 500px;
height: 500px;
position: relative;
background-color: rgba(0,0,0,0.6);
display: flex;
}
#content {
width: 470px;
@haruhiko-zht
haruhiko-zht / script.js
Created October 11, 2018 04:57
slide_links()
$(function(){
// クリックされた時に関数を呼び出す
$("#tab a").click(function(){
links_slide();
});
// 関数
function links_slide(){
if($("#links-content").css("left").replace("px","") < 0){
@haruhiko-zht
haruhiko-zht / index.html
Created October 12, 2018 05:43
css_position_study
<body>
<div class="aaa"></div>
<div class="bbb">
<div class="ccc"></div>
</div>
</body>