0
你好,對不起我的英語不好。我用一個循環「for」創建對象,或多或少有200個對象,它們在具有鼠標懸停和鼠標移動的動態圖像內部。問題是,所有的對象都可以,圖像,問題是,更多的不是很好的鼠標懸停和出,我不知道爲什麼。沒有給我一個錯誤的JavaScript只有一個警告與圖書館。如果任何人都可以用鼠標來查看一組有圖像的對象。MouseOver和Mousedown裏面的物體
CREATE OBJECTS--->
for (var j=0;j<datos.length;j++){ //
iconos[j]= new icono(images._icono,1, datos[j] ,_conv_lat,_conv_long,factor_conversion_mapa,ConvLat,ConvLong,layer_iconos,stage,j,etiquetas);
FUNCTION --->
function icono(icono_mapa,tipo,datos,_conv_lat,_conv_long,factor_conversion_mapa,ConvLat,ConvLong,layer_icono,stage,i,etiquetas){
// DEL PIXEL 679 VA EN NEGATIVO ESTE VALOR (IBIZA-CORUÑA) //Pixel /Grado
//this._conv_lat=_conv_lat;
this.num=i;
// DEL PIXEL 241 VA EN POSITIVO ESTE VALOR
//this._conv_long=_conv_long;
//this.factor_conversion_mapa= factor_conversion_mapa;
this.Datos= new Array();
this.Datos= datos.slice();
this.imagen=icono_mapa;
this.Lat=0;
this.Long=0;
this.ConvLat=ConvLat;
this.ConvLong=ConvLong;
var _this = this;
.
.
.
.
.
this.base = new Kinetic.Image({x: _this.Long-(_this.size/2.0), y: _this.Lat -(this.size/2.0)+5, image:_this.imagen, width: _this.size, height: _this.size , name: "icono_"+_this.num});
this.base.on('mouseover', function(evt) {
document.body.style.cursor = 'pointer';
etiquetas[_this.num].labelLeft.setAttr('opacity',1);
layer_etiquetas.draw();
evt.cancelBubble = true;
});
this.base.on('mouseout', function(evt) {
document.body.style.cursor = 'default';
etiquetas[_this.num].labelLeft.setAttr('opacity',0);
layer_icono.draw();
evt.cancelBubble = true;
});
謝謝 如果有人能幫助我。