HoverMe´Â ½º¸¶Æ® È»ìÇ¥ À§Ä¡¸¦ »ç¿ëÇÏ¿© ¾Ö´Ï¸ÞÀ̼ÇÀÌ Àû¿ëµÈ »ç¿ëÀÚ Á¤ÀÇ ÅøÆÁÀ» ¸¸µå´Â °¡º¿î jQuery Ç÷¯±×ÀÎÀÔ´Ï´Ù.
ÅøÆÁ Å©±â³ª ¿ä¼Ò Å©±â¿¡ °ü°è¾øÀÌ, ¸¶¿ì½º¸¦ ¿Ã·Á³õÀº ¿ä¼ÒÀÇ Áß¾ÓÀ» Á÷Á¢ °¡¸®Å°µµ·Ï È»ìÇ¥ ¹èÄ¡¸¦ ÀÚµ¿À¸·Î °è»êÇÕ´Ï´Ù.

# ¶óÀ̼¾½º : MIT
# »ç¿ë¹æ¹ý
1. HEAD ¿¡ CSS Ãß°¡ ÇÕ´Ï´Ù.
±âº»ÀûÀ¸·Î hoverMe.css ¸¸ À־ µË´Ï´Ù.
<link rel="stylesheet" href="hoverMe.css">
<style>
html,* { font-family: 'Inter'; }
body { background-color: #fafaf8; line-height:1.6;}
.lead { font-size: 1.5rem; font-weight: 300;background: linear-gradient(to right, #000000 0%, #000000 50%,#999999 100%);
-webkit-background-clip: text;
-webkit-text-fill-color:transparent; }
.container { margin: 20px auto; max-width: 960px; }
h1 {
background: linear-gradient( 120deg, #bd34fe 30%, #41d1ff );
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
button {
margin: 20px;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
.wide-button {
width: 200px;
}
.narrow-button {
width: 200px;
}
</style>
2. ¶óÀ̺귯¸® È£Ãâ
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="hoverMe.js"></script>
3. ¿ä¼Ò¿Í ÅøÆÁÀÇ ¼Ó¼ºÀ» Á¤ÇÕ´Ï´Ù.
<button data-title="Tooltip Content A" data-position="top" data-color="#059669" data-text-color="#fff">Hover Me</button>
<button data-title="Tooltip Content B" data-position="bottom" data-color="#1f2937" data-text-color="#f9fafb">Hover Me</button>
<button data-title="Tooltip Content C" data-position="left" data-color="#10b981" data-text-color="#fff">Hover Me</button>
<button data-title="Tooltip Content D" data-position="right" data-color="#059669" data-text-color="#fff">Hover Me</button>
<button data-title="Tooltip Content E" data-color="#059669" data-text-color="#fff">Hover Me</button>
<button data-title="Tooltip Content F" data-color="#1f2937" data-text-color="#f9fafb">Hover Me</button>
<button data-title="Tooltip Content G" data-color="#10b981" data-text-color="#fff">Hover Me</button>
4. ÇÔ¼ö¸¦ È£ÃâÇÏ¿© Àû¿ë ÇÕ´Ï´Ù.
<script>
$("[data-title]").HoverMe({
position: 'top',
color: '#333',
textColor: '#fff',
borderRadius: '4px',
fontSize: '14px',
padding: '6px 10px'
});
</script>
|