문제가 있습니다. 내 영역 모양 href = "/ kosmetikstudios/deutschland/Bayern"태그가 그렇게 보입니다. 그리고 나는 매개 변수 "Bayern"을 사용할 것입니다 (이것은 URL의 마지막 매개 변수입니다).URL의 매개 변수를 사용하는 자바 스크립트
나는이 동적이 필요합니다. 여기
<script type="text/javascript">
$(document).ready(function(){
var mName="passiv";
$("#map area").mouseenter(function(){
mName = $(this).attr("href"); // i don't have idea to implement this
bName="images/" +mName + ".png";
$("#map img").attr("src",bName);
});
$("#map area").mouseleave(function(){
bName="images/Europa.png";
$("#map img").attr("src",bName);
});
});
</script>
내 HTML 코드 나는 누군가가 나를 도울 수 있기를 바랍니다
<area shape="poly" coords="356,300,355,299,354,298....." href="/kosmetikstudios/deutschland/Bayern" title="Kosmetikstudios in Bayern" alt="Kosmetikstudios in Bayern" />
<area shape="poly" coords="156,200,425,699,154,298....." href="/kosmetikstudios/deutschland/Berlin" title="Kosmetikstudios in Berlin" alt="Kosmetikstudios in Bayern" />
있습니다 : 여기
내 자바 스크립트 코드입니다. 당신은이 작업을 수행 할 수감사합니다,
데이브
당신은 간단하게 사용할 수는 'this.href'는 jQuery를 개체는 필요하지 않습니다. – bfavaretto
예. 그렇지. 그렇지. :-) – Vinay