Browse Source

label z-index

xzw 3 years ago
parent
commit
b7a26c6b8f
3 changed files with 24 additions and 4 deletions
  1. 1 1
      css/main.css
  2. 1 1
      js/Hot.js
  3. 22 2
      js/manage.js

+ 1 - 1
css/main.css

@@ -7100,7 +7100,7 @@ a.hasHover.tag-link:hover {
 	width: 100%;
 	height: 100%;
     pointer-events:none; 
-	z-index: 101; 
+	/* z-index: 101;  */
 }
 #hot>div{
     position: absolute;

+ 1 - 1
js/Hot.js

@@ -889,7 +889,7 @@ window.initHot = function(model){
             //return true
             if(window.isEdit)return true // 太容易move了
              
-            if(player.mode == 'panorama'){
+            if(player.mode == 'panorama' && player.currentPano){
                 if(!player.camera) return
                   
                 var cornerPointInfo = this.getCornerPoint(); 

+ 22 - 2
js/manage.js

@@ -1162,7 +1162,7 @@ function initByTHREE(THREE){
         
     }
 
-
+    let labels = []
 
 
 
@@ -1193,7 +1193,7 @@ function initByTHREE(THREE){
             this.visible = true
             this.shelterByModel = o.shelterByModel
             this.floorIndex = o.floorIndex
-            
+            labels.push(this)
              
             if(window.player.model){
                 this.init()
@@ -1349,7 +1349,27 @@ function initByTHREE(THREE){
             }
         
         })
+        
+        
+        player.on("view.changed",(e)=>{ 
+             if(e.cameraChanged){
+                 //if(needUpdateZIndex){
+                     let label_ = labels.filter(e=>e.elem[0].style.display == 'block')
+                     label_.sort((a,b)=>b.pos2d.z - a.pos2d.z)
+                     label_.forEach((e,index)=>e.elem.css('z-index', index+1000)); 
+                     
+                 //} 
+             } 
+        })
+        
+        
+        
     })
+    
+    
+    
+    
+    
 }