본문 바로가기
웹 개발/JavaScript

[jQuery]maphilight.js - map태그 마우스오버할 때 강조 효과 나타내는 플러그인

by NanaJ 2023. 4. 5.

공식사이트 & 문서

https://projects.davidlynch.org/maphilight/docs/#maphilight

 

jQuery maphilight documentation

maphilight applies to images with a 'usemap' attribute, and outlines the areas defined in their map on mouseover. This would hilight every image with a map on the page: $('img[usemap]').maphilight() $.maphilight.defaults The defaults for all uses of maphil

projects.davidlynch.org

데모

https://projects.davidlynch.org/maphilight/docs/demo_usa.html

 

jQuery maphilight documentation

 

projects.davidlynch.org

사용법

//특정 영역에만 적용할 경우
$('.mapImg').maphilight()

//모든 맵태그 이미지에 적용할 경우
$('img[usemap]').maphilight()

//options
$('.mapImg').maphilight({
    "fill": true,
    "fillColor": "000000", // "#"없이 코드만 작성 
    "fillOpacity" : 0.2
    "stroke":true,
    "strokeColo"r:"ffaaff",
    "strokeOpacity":0.2,
    "strokeWidth":1
    //...다른 옵션들은 공식사이트에서 확인
})

파일

maphilight.zip
0.01MB

 

 

 

 

 

 

반응형

댓글