Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
E ae galera!
Eu to tentando criar um menu com links que tenham uma opacidade mais baixa e, quando passo com o mouse por cima do link, a opacidade fica em 100%.
Entretanto, eu quero também que, quando clico em um link, ele permaneça com opacidade 100%.
O CSS tá assim:
a.linkopacity:active img {
filter:alpha(opacity=100);
-moz-opacity: 1.0;
opacity: 1.0;
-khtml-opacity: 1.0;
}
a.linkopacity:hover img {
filter:alpha(opacity=100);
-moz-opacity: 1.0;
opacity: 1.0;
-khtml-opacity: 1.0;
}
a.linkopacity img {
filter:alpha(opacity=70);
-moz-opacity: 0.7;
opacity: 0.7;
-khtml-opacity: 0.7;
}<a class="linkopacity" href="javascript:toggleLayer('contato');"><img src="Images/menu_contato.png" title="Contato"/></a>
Já tentei utilizar todas as pseudoclasses do link (active, visited, hover e link), já tentei mudar a ordem das descrições de cada classe, já tentei de tudo, mas não consigo fazer isso funcionar no FF, só no IE. Aliás, a opacidade em 70% inicial e a opacidade 100% com o hover até funcionam, mas o active (ou o visited, já tentei com ambos) não funcionam.
Não sei se é por causa do script em JS que eu estou utilizando, que o FF não entende o link como um link de verdade, ou qualquer outra coisa que não consigo entender do pq não funcionar no firefox.
Alguém tem alguma ideia do que pode ser?
O JS que to usando é pra utilizar o hide/show div.
O código é esse:
function toggleLayer( whichLayer ) {
var elem, vis;
if( document.getElementById ) // this is the way the standards work
elem = document.getElementById( whichLayer );
else if( document.all ) // this is the way old msie versions work
elem = document.all[whichLayer];
else if( document.layers ) // this is the way nn4 works
elem = document.layers[whichLayer];
vis = elem.style;
// if the style.display value is blank we try to figure it out here
if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
Valeu! :)
Carregando comentários...