0
안녕하세요, 길이가 0 이상이면 마우스로 목록을 표시하려고합니다. 목록 위에 마우스를 놓으면 목록이 표시됩니다.하지만 길이가 길면 항상 내 사례 목록에 표시됩니다. 표시 방법 마우스를 올려 놓을 때만 목록에 표시 할 수 있습니까? 정확히 내가 시도하고 문제는 내가 때 팝업 부하 상단에 내 툴팁을 둘 필요가있다자바 스크립트에서 마우스 오버시 목록을 표시하는 방법?
if (feature.attributes.hasOwnProperty("ExceptionType")) {
var exceptionType = 'x,y';
if (exceptionType)
{ var activeExceptions = exceptionType.split(','); }
else
{ var activeExceptions = []; }
var item, items = [];
for (var i = 0; i < activeExceptions.length; i++) {
item = {};
item.activeexception = activeExceptions[i];
items.push(item);
}
var main = $("<ul>");
var str = "<ul>";
for (var i = 0; i < items.length; i++) {
str += "<li>" + items[i].activeexception + "</li>";
}
$('[rel="tooltip"]').tooltip();
main.html(str);
if (activeExceptions.length == 0) {
feature.attributes.Hoverlist = ".showme{display: none}";
feature.attributes.ShowExceptionType = "display:none";
}
else
feature.attributes.Hoverlist = ".showhim:hover .showme{ display : block;}";
feature.attributes.ShowExceptionType = "display:block";
feature.attributes.HoverContent = str;
feature.attributes.ExceptionCount = activeExceptions.length;
}
"description": "<div class='showhim' style='{ShowExceptionType}' ng-mouseover='alert('hi');'>{ExceptionCount}<div class='showme' style='{Hoverlist}'>{HoverContent}</div></div>",