Created
July 23, 2008 01:17
-
-
Save weemie/1439 to your computer and use it in GitHub Desktop.
basic.js
This file contains hidden or 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
/*====================================================== | |
auto copyright | |
-------------------------------------------------------*/ | |
function copyright() { | |
if(document.getElementById('copyright')!=null){ | |
startYear = 2008; | |
thisDate = new Date(); | |
thisYear = thisDate.getFullYear(); | |
if (thisYear > startYear) { startYear=startYear + "-" + thisYear } | |
document.getElementById('copyright').innerHTML="© "+startYear+" sow-atelier.jp All Rights Reserved."; | |
} | |
} |
This file contains hidden or 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
/**========================================================= | |
menu selected | |
----------------------------------------------------------*/ | |
function ChangeSelected(id){ | |
if(document.getElementById(id) != null){//IDの存在をチェック | |
//SideMenuの子供のA要素からhref属性の値を取得 | |
var parentNode = document.getElementById(id); | |
var Tags = parentNode.getElementsByTagName("a"); | |
for (var i = 0; i < Tags.length ; i++){ | |
if(Tags[i].href==document.URL){//現在のURLとHREFの値が同じとき | |
//Aのclassを変更 | |
if(Tags[i].parentNode.nodeName!="dd"){ | |
Tags[i].className="active"; | |
} | |
} | |
} | |
} | |
} |
This file contains hidden or 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
/**========================================================= | |
addLoadEvent | |
----------------------------------------------------------*/ | |
function addLoadEvent(func){ | |
var oldonload = window.onload; | |
if (typeof window.onload != 'function'){ | |
window.onload = func; | |
} else { | |
window.onload = function(){ | |
oldonload(); | |
func(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment