다음은 javascript/jquery를 사용하여 두 번째 범위에있는 단어 "표준"좌표를 원할 때의 예입니다.컨테이너 div의 컨텍스트에서 스팬의 문자 좌표를 가져옵니다
HTML :
<div class="container">
<span>Some text is here</span>
<span>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span>
<span>Some text is here too.</span>
<span>Some text is here too.</span>
<span>Some text is here too.</span>
<span>Some text is here too.</span>
</div>
CSS :
.container{
position: relative;
padding: 100px;
}
span{
position:relative;
float:left;
padding:10px;
}
'좌표'란 무엇을 의미합니까? 이 예에서 '표준'이라는 단어에 대해 필요한 결과는 무엇입니까? –
예, x와 y 좌표는 – user3624983
입니다. "표준"은 제가 제시 한 예입니다. 스팬에있는 특정 단어의 왼쪽, 위쪽 (x, y) 위치를 알고 싶습니다. – user3624983