Draw an arrow between two divs

后端 未结 5 897
不思量自难忘°
不思量自难忘° 2021-01-31 02:45

I\'m searching for a solution of the question that I expected to be solved already. But I saw only big projects with a lot of features but no simple solution.

Actually I

5条回答
  •  遇见更好的自我
    2021-01-31 03:23

    You might consider SVG.

    enter image description here

    In particular, you can use a line with a marker-end shaped with an arrow-path.

    Be sure to set orient=auto so the arrowhead will be rotated to match the slope of the line.

    Since SVG is a DOM element, you can control the start/end position of the line in javascript.

    Here is code and a Fiddle: http://jsfiddle.net/m1erickson/9aCsJ/

    
    
        
            
                
            
        
    
        
    
    
    

提交回复
热议问题