ugrás a tartalomhoz

Archívum - Nov 26, 2009 - Fórum téma

menü probléma

Batka1985 · 2009. Nov. 26. (Cs), 18.54
http://fairiesworld.atw.hu/

Sziasztok, kérdésem a következő lenne, a fenti címen található oldalon látható oldalt csinálgatom, és a menüt úgy szeretném megcsinálni, hogy mikor a kurzor a menüpont fölött van a teljes sáv színeződjön el ne csak a betüknél. Mit kéne vele kezdenem?
Előre is köszi a válaszokat
 

Opacity fade nem működik osztály esetén

kamba · 2009. Nov. 26. (Cs), 11.41
Sziasztok az a problémám hogy van egy opacity fade-elő kódom ami szép átlátszóságot generál.ezt is szeretném átalakítani egy osztállyá hogy ha kell több is működjön egyszerre.legjobb ha bemásolom a működő kódot és a nemműködőt is.
  1. function opacity(id, opacStart, opacEnd, millisec) {  
  2.     //speed for each frame  
  3.     var speed = Math.round(millisec / 100);  
  4.     var timer = 0;  
  5.     //determine the direction for the blending, if start and end are the same nothing happens  
  6.     if(opacStart > opacEnd) {  
  7.         for(i = opacStart; i >= opacEnd; i--) {  
  8.             window.setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));  
  9.             timer++;  
  10.         }  
  11.     } else if(opacStart < opacEnd) {  
  12.         for(i = opacStart; i <= opacEnd; i++)  
  13.             {  
  14.             window.setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));  
  15.             timer++;  
  16.         }  
  17.     }  
  18. }  
  19.   
  20. //change the opacity for different browsers  
  21. function changeOpac(opacity, id) {  
  22.     var object = document.getElementById(id).style;   
  23.     object.opacity = (opacity / 100);  
  24.     object.MozOpacity = (opacity / 100);  
  25.     object.KhtmlOpacity = (opacity / 100);  
  26.     object.filter = "alpha(opacity=" + opacity + ")";  
  27. }  
Ez működik is szépen
most az osztály amit összetákoltam:
[colorer=css]
var opacity2 = function(id, opacStart, opacEnd, millisec) {
this.object = document.getElementById(id).style;
this.opacStart = opacStart;
this.opacEnd = opacEnd;
//speed for each frame
var speed = Math.round(millisec / 100);
var timer= 0;
//this.intid = new Array();
}
//determine the direction for the blending, if start and end are the same nothing happens
opacity2.prototype.fade = function(){
var self= this;
if(this.opacStart > this.opacEnd) {
for(i = this.opacStart; i >= this.opacEnd; i--) {
//alert(i);
window.setTimeout(function (){self.changeOpac(i);},(this.timer * this.speed));
this.timer++;
}
} else if(this.opacStart < this.opacEnd) {
for(i = this.opacStart; i <= this.opacEnd; i++) {
//alert(i);
window.