2017-02-10 2 views
0

Hallo, ich versuche, Liste auf Maus über anzuzeigen, wenn die Länge> 0 ist, dann zeige ich count.On Maus über Liste ich möchte Liste anzeigen.Aber in meinem Fall Liste wird immer angezeigt, wenn Länge> o.Wie angezeigt wird Liste nur auf Maus über? , was genau ich versucheWie Liste bei Mouseover in Javascript anzeigen?

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>", 

Antwort

0

Das Problem ist, muss ich auf meine Tooltip setzen, wenn Popup-Lasten.

$('[rel="tooltip"]').tooltip();