window.onload = function() { var oMask = document.getElementById('mask'); var oSearch = document.getElementById('searchTip'); var aStep = oSearch.getElementsByTagName('div'); var aA = oSearch.getElementsByTagName('a'); var aAp = oSearch.getElementsByTagName('p'); var aClose = oSearch.getElementsByTagName('span'); var res = document.cookie.substring(10); if (res != "www.open.com.cn") { //mask ?父框 第一單元顯示出來 oMask.style.display = oSearch.style.display = aStep[0].style.display = 'block'; //下一步按鈕 for (var i = 0; i < aStep.length; i++) { aA[i].index = i; //為每一個(gè)按鈕增加一個(gè)index屬性,為后面引用的 aA[i].onclick = function() { this.parentNode.style.display = "none"; if (this.index < aStep.length - 1) { aStep[this.index + 1].style.display = "block"; } else if (this.index == aStep.length - 1) { oMask.style.display = oSearch.style.display = "none"; } } } //關(guān)閉按鈕 for (var i = 0; i < aClose.length; i++) { aClose[i].onclick = function() { oMask.style.display = oSearch.style.display = "none"; } } //添加cookie var oDate = new Date(); oDate.setDate(oDate.getDate() + 30); document.cookie = "name=www.open.com.cn;expires=" + oDate; }}
jq新手引導(dǎo)問題。。。之前有看到課程。如果要添加一個(gè)按鈕上一步的話要怎么寫?
李德勛
2016-11-16 11:20:14