Hey Leute,
ich suche verzweifelt nach einer Möglichkeit, Klassen statt IDs anzusprechen. Im folgenden Code wird #box angesprochen, es soll aber .box angesprochen werden. Kann mir jemand helfen?
ich suche verzweifelt nach einer Möglichkeit, Klassen statt IDs anzusprechen. Im folgenden Code wird #box angesprochen, es soll aber .box angesprochen werden. Kann mir jemand helfen?
Code:
<script type="text/javascript">window.addEvent('domready', function(){
//First Example
var el = $('box'),
color = el.getStyle('backgroundColor');
// We are setting the opacity of the element to 0.5 and adding two events
$('box').set('opacity', 0.5).addEvents({
mouseenter: function(){
// This morphes the opacity and backgroundColor
this.morph({
'opacity': 0.5,
'background-color': '#fff'
});
},
mouseleave: function(){
// Morphes back to the original style
this.morph({
'opacity': 1,
});
}
});
});
</script>