English 中文(简体)
某些事件的风格适用于html的每个部分,并配有假肢
原标题:Apply style on some event to each element of html with id accordian

我需要做如下事情。

我有同一名助手。

如今,四分五裂的转变背景应当改为千分之十。 FF.

我正在使用 mo器1.2。

下面是我使用的法典,但不是行文。

<script type="text/javascript" language="javascript">
window.addEvent( domready , function() {

    var accordian_divs = $$( #accordion );

    accordian_divs.addEvents({
                 mouseover :function(){
                    $(accordian_divs).setStyle( background-color ,  #000000 );
                },
                 mouseout :function(){
                    $(accordian_divs).setStyle( background-color ,  #FFFFFF );
                }
            })  

});



</script>

任何人都可以建议该法典有什么错误。

增 编

Avinash

最佳回答

erm - 由于 c子解决办法在e6/7中赢得了四肢解工作,因此,如何在 mo子中做到这一点:

添加对iv的分类,删除id,因为它需要独一无二。

使用:

window.addEvent( domready , function() {
    $$( div.accordion ).addEvents({
        mouseenter: function() {
            this.setStyle( background-color ,  #000000 );
        },
        mouseleave: function() {
            this.setStyle( background-color ,  #FFFFFF );
        }
    });
});
问题回答

除非你真的需要为此使用javascript,否则你可以取得与社会保障局相同的结果:

#accordion{background-color:#FFF}
#accordion:hover{background-color:#000}




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签