求解释这段JAVASCRIPT 急!!!!

2025-03-07 07:19:29
推荐回答(3个)
回答1:



不明白就M 我

回答2:


function show_hiddendiv(){//定义函数 函数名为 show_hiddendiv
document.getElementById("hidden_div").style.display='block';//隐藏id是hidden_div的元素
document.getElementById("_strHref").href='javascript:hidden_showdiv();';//修改id是_strHref的href属性为'javascript:hidden_showdiv();也就是注册一个事件
document.getElementById("_strSpan").innerHTML="隐藏部分";//更新 ID 为_strSpan内部的HTML源码
}
//下段大体意思同上。自己想想看
function hidden_showdiv(){
document.getElementById("hidden_div").style.display='none';
document.getElementById("_strHref").href='javascript:show_hiddendiv();';
document.getElementById("_strSpan").innerHTML="显示全部";
}

回答3:

用cookie实现的。

换肤之后把cookie写到cookie里去。
然后载入的时候读取。