这个js代码在火狐谷歌浏览器上不能用

<script>
var s=5;
var minheight=50;
var maxheight=230;
function shoppingcat(){
var key = document.getElementById("key").innerText;
if(mrc.style.pixelHeight==0)mrc.style.pixelHeight=minheight;
if(key=="[ + 展开 ]"){
mrc.style.pixelHeight+=s;
if(mrc.style.pixelHeight<maxheight){
setTimeout("shoppingcat();",1);
}else{
document.getElementById("key").innerText="[ - 关闭 ]";
}
}else{
mrc.style.pixelHeight-=s;
if(mrc.style.pixelHeight>minheight){
setTimeout("shoppingcat();",1);
}else{
document.getElementById("key").innerText="[ + 展开 ]";
}
}
}
</script>

<div id="mrc"><script src="http://www.xxxxx.cn/d/js/acmsd/681761_vip_110.js"></script><div class="clr"></div>
</div><div style="width:88px;height:28px;line-height:28px; float:right;text-align:left;margin-top:10px;"><span id="key"onclick="shoppingcat();" style="background-color:#66A6F4; color:white;">[ + 展开 ]</span></div><div class="clr"></div>

大家能帮忙看看吗?

尊敬的用户,您好!很高兴为您答疑

很抱歉地告诉您,您因为您所提供代码中引入的js文件无法获取,所以如果您希望获得进一步的帮助,请您提供相关文件,否则无法进行js脚本问题跟踪定位。
希望我的回答对您有所帮助,如有疑问,欢迎继续咨询我们。追问

百度不让我贴网址

温馨提示:内容为网友见解,仅供参考
第1个回答  2013-11-26
代码贴全了吗?
mrc是哪来的对象?
setTimeout("shoppingcat();",1); 才参数给的也不对,
应该是setTimeout(shoppingcat,1);
并且setTimeout在函数内部,并且有执行 没终止,
逻辑思路也不对,不死网页就是命好了,追问

代码就是这样,IE正常

本回答被提问者采纳
相似回答