level 2
我想访问 这个函数里面的 this.id 在 外面调用他。请问怎么做
function Spot(x, y) {
// function displaydiv1(eleId){
// if(document.getElementById(eleId).style.display=="none")
// document.getElementById(eleId).style.display="block";
// else
// document.getElementById(eleId).style.display="none";
// }
//这个id = 点的id
this.id = spotID;
//这个类型 = 点
this.type = 'spot';
//这个里的x = x
this.x = x;
//这个里的y = y
this.y = y;
//这个里的内容为空
var divShow = 'hb-spot-' + this.id + '';
this.content = '';
var omso = onmouseover ;
//这个里的html = 一个DIV 他的class是hb-spot hb-spot-object id是hb-spot- 拼接这个id div下嵌套一个div class是hb-tooltip-wrap 再嵌套一个div他的class
是hb-tooltip
this.html = '<div class="hb-spot hb-spot-object" id="hb-spot-' + this.id + '" > id = '+divShow+'<div class="hb-tooltip-wrap"><div class="hb-
tooltip"></div></div></div>';
//这个css是空
this.css = '';
//这个根为空
this.root = '';
//这个宽度为30
this.width = 30;
//这个高度为30
this.height = 30;
//这个提示的宽度为自动
this.tooltipWidth = 'auto';
//这个settings 是一个对象 他的属性 可见, 可见 ,开启显示, 全局里的settings ,里的 ,打开显示 ,弹出位置:左,内容:空,提示宽度:200 ,提示层自
动宽度为真
this.settings = { "visible" : "visible", "show_on" : globals.settings['show_on'], "popup_position" : "left", "content" : "", "tooltip_width" :
200, "tooltip_auto_width" : true };
//spotID自增
spotID++;
}
我想让鼠标放在这个JQ创建的div 上 显示另一个 div 但是外面取不到他的id 。里面加上onmouseover="displaydiv('shell')" 后jq出错 什么效果都没有
2015年11月13日 05点11分