嘿,我有一些代码可以设置元素 style.width、height 和 position,但它不起作用,我认为这是因为它不在头部,但我想像 mouseclick 事件一样更改 css,所以选项卡会滑出和东西,但我宁愿不使用 jquery 有没有办法做到这一点?
编辑:好的,所以我解决了宽度和高度问题,当我尝试定位它时它似乎没有响应
这是我的代码
for (i=1; i<=tab_array.length-1; i++)
{
    if (i==3)
    {
        document.getElementById("_"+i).style.cssText='height:'+Math.floor(p(100,gheight))+'px;'+
                                 'width:' +Math.floor(p(80,gwidth ))+'px;'+
                                 'background:black;'+
                                 'postion:absolute;'+
                                 'left:'+Math.floor(p(tab_array.across,gwidth)-gwidth)+'px;'
                                 ;
    }
    else
    {
        document.getElementById("_"+i).style.cssText='height:'+Math.floor(p(80,gheight))+'px;'+
                                 'width:' +Math.floor(p(80,gwidth ))+'px;';
    }               
}