Created
July 11, 2012 14:34
-
-
Save QB/3090754 to your computer and use it in GitHub Desktop.
安田記念のレース結果をいちいち戻ったりリンクをクリックしたりしながら見るのが面倒くさかったので、なんか作ってみた。他のサイトにも色々と応用が効きそう。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>安田記念レース結果</title> | |
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script> | |
$(function(){ | |
var settings = new Array(); | |
set = { | |
//■■ ここから設定 ■■(そのままで大丈夫です。改造したい方だけ、いじってください) | |
"message" : "下の各リンクをクリックすると、当該年の安田記念のレース結果が表示されます。", | |
"first" : 1984, //安田記念の掲載がある最初の年 | |
"font" : "'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif", | |
"link_head" : "http://www.jra.go.jp/datafile/seiseki/g1/yasuda/result/yasuda", | |
"link_foot" : ".html", | |
//■■ 設定ここまで ■■ | |
} | |
$("h3").text(set["message"]); | |
$("*").css("font-family",set["font"]); | |
//西暦算出・リンクの数を調整 | |
var today= new Date(); | |
y = today.getYear() +1900; | |
var dom = ""; | |
for(var i=set["first"]; i<=y; i++){ | |
dom += "<a>"+i+"</a>"; | |
} | |
$("#nav").html(dom); //aタグ書き出し | |
$("a").click(function(){ | |
var link = set["link_head"] + $(this).text() + set["link_foot"]; | |
document.getElementById("frame").src = link; | |
}); | |
}); | |
</script> | |
<style> | |
a{ | |
display:inline-block; | |
color:blue; | |
width:90px; | |
cursor:pointer; | |
text-decoration:underline; | |
} | |
iframe{ | |
display:block; | |
width:100%; | |
height:700px; | |
} | |
</style> | |
</head> | |
<body> | |
<h3></h3> | |
<div id="nav"></div> | |
<hr /> | |
<iframe id="frame"></iframe> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment