jquery问题 : var jq = jQuery.noConflict(); 让出 $ 符号
一个图片变化,一个是倒计时的。只显示倒计时的,图片变化的幻灯片不显示。求大神修改。好像是要“varjq=jQuery.noConflict();让出$符号”,但是我不懂啊...
一个图片变化,一个是倒计时的。只显示倒计时的,图片变化的幻灯片不显示。求大神修改。好像是要“var jq = jQuery.noConflict(); 让出 $ 符号”,但是我不懂啊!!!!!
代码:
<script type="text/javascript">
window.onload = function() {
var oBox = document.getElementById("yee-box");
var oList = oBox.getElementsByTagName("ul")[0];
var aImg = oBox.getElementsByTagName("img");
var timer = playTimer = null;
var index = i = 0;
var bOrder = true;
var aTmp = [];
var aBtn = null;
//生成数字按钮
for (i = 0; i < aImg.length; i++) aTmp.push("<li>" + (i + 1) + "</li>");
//插入元素
var oCount = document.createElement("ul");
oCount.className = "yee-count";
oCount.innerHTML = aTmp.join("");
oBox.appendChild(oCount);
aBtn = oBox.getElementsByTagName("ul")[1].getElementsByTagName("li");
//初始化状态
cutover();
//按钮点击切换
for (i = 0; i < aBtn.length; i++) {
aBtn[i].index = i;
aBtn[i].onmouseover = function() {
index = this.index;
cutover()
}
}
function cutover() {
for (i = 0; i < aBtn.length; i++) aBtn[i].className = "";
aBtn[index].className = "current";
startMove(-(index * aImg[0].offsetHeight))
} 展开
代码:
<script type="text/javascript">
window.onload = function() {
var oBox = document.getElementById("yee-box");
var oList = oBox.getElementsByTagName("ul")[0];
var aImg = oBox.getElementsByTagName("img");
var timer = playTimer = null;
var index = i = 0;
var bOrder = true;
var aTmp = [];
var aBtn = null;
//生成数字按钮
for (i = 0; i < aImg.length; i++) aTmp.push("<li>" + (i + 1) + "</li>");
//插入元素
var oCount = document.createElement("ul");
oCount.className = "yee-count";
oCount.innerHTML = aTmp.join("");
oBox.appendChild(oCount);
aBtn = oBox.getElementsByTagName("ul")[1].getElementsByTagName("li");
//初始化状态
cutover();
//按钮点击切换
for (i = 0; i < aBtn.length; i++) {
aBtn[i].index = i;
aBtn[i].onmouseover = function() {
index = this.index;
cutover()
}
}
function cutover() {
for (i = 0; i < aBtn.length; i++) aBtn[i].className = "";
aBtn[index].className = "current";
startMove(-(index * aImg[0].offsetHeight))
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询