텍스트 위로 가져 가면 해당 이미지가 표시됩니다. 그러나 이것에 따르면 그것은 작동하지만 모든 이미지에 대해 동일한 id가있을 때만 첫 번째 것을 선택합니다. 이 문제를 해결하려면 아무도 알려주십시오. 이것은 나의 첫 번째 게시물입니다. Pls는 내가 틀린 일을 게시했을 때 변명했습니다. 미리 감사드립니다.HTML/JS/JQUERY의 목록 위로 마우스를 가져 가면 이미지 팝업
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Selectable - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script type = "text/javascript" src = "js/jquery.js"></script>
<script type = "text/javascript" src = "js/jquery_ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
#feedback { font-size: 1.4em; }
#selectable .ui-selecting { background: #FECA40; }
#selectable .ui-selected { background: #F39814; color: white; }
#selectable { list-style-type: none; margin: 0; padding: 0; width: 20%; }
#selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
img
{
position:absolute;
left:250px;
display:none;
}
</style>
<script>
$(function() {
$("#selectable").selectable();
});
</script>
</head>
<body>
<table id="myTable">
<td>
<tr>
<ol id="selectable" onmouseover="show(next,true)" onmouseout="show(next,false)">
<li>Item 1 <img src="next.jpg" id="next"></li>
<li>Item 2 <img src="next.jpg" id="next"></li>
<li>Item 3 <img src="next.jpg" id="next"></li>
<li>Item 4 <img src="next.jpg" id="next"></li>
<li>Item 5 <img src="next.jpg" id="next"></li>
</ol>
</tr>
</td>
</table>
<script type = "text/javascript">
$(document).ready(function() {
$('#selectable').fadeIn('very slow');
});
</script>
<script language="javascript">
//function to display the immage
function show(id,disp) {
if (disp == true) {
id.style.display = "block";
}
if (disp == false) {
id.style.display = "none";
}
}
</script>
</body>
</html>
다른 ID 사용자는 아이디의이 같은 이름 한 기운. 수업을 이용하십시오. ID와 클래스의 차이점은 하나의 요소를 식별하는 데 ID를 사용할 수있는 반면 클래스는 둘 이상의 요소를 식별하는 데 사용할 수 있다는 것입니다. [여기에 대해 읽으십시오] (http://www.htmldog.com/guides/css/intermediate/classid /) – Ruddy