NAVER Careers

๊น€์ข…๋ฏผยท2023๋…„ 8์›” 14์ผ
0

Portfolio

๋ชฉ๋ก ๋ณด๊ธฐ
3/9
post-thumbnail

NAVER Careers ํด๋ก ์ฝ”๋”ฉ


๐Ÿ”Ž ์ž‘์—…๋‚ด์šฉ

  • ์‚ฌ์ดํŠธ๋ช…: ๋„ค์ด๋ฒ„ ์ปค๋ฆฌ์–ด์Šค
  • ์ž‘์—… ๊ธฐ๊ฐ„: 3์ผ
  • ์œ ํ˜•: ๋ฐ˜์‘ํ˜• ์›น, ํด๋ก  ์ฝ”๋”ฉ
  • ํŠน์ง•: ๋ฏธ๋””์–ด ์ฟผ๋ฆฌ๋ฅผ ์ด์šฉํ•œ ๋ฐ˜์‘ํ˜• ์›น์‚ฌ์ดํŠธ, ๋ฐ˜์‘ํ˜• ์‚ฌ์ดํŠธ์—์„œ ์ด๋ฏธ์ง€ ํฌ๊ธฐ ๋งž์ถ”๊ธฐ swiper-slide์˜ ํ™œ์šฉ, ์…€๋ ‰ํŠธ ๋ฐ•์Šค ๋ณ€ํ˜•, ์ฒดํฌ๋ฐ•์Šค ํ™œ์šฉ,

์Šค์™€์ดํผ ์Šฌ๋ผ์ด๋“œ ํ…์ŠคํŠธ ํšจ๊ณผ

์Šค์™€์ดํผ ์Šฌ๋ผ์ด๋“œ autoplay๋กœ ๋„˜์–ด๊ฐ€๊ฒŒ ๋˜๋ฉด ํ…์ŠคํŠธ๊ฐ€ ์‹œ๊ฐ„ํ…€์„ ๋‘๊ณ 
์ขŒ์—์„œ ์šฐ๋กœ ์Šค๋ฅด๋ฅต ๋“ฑ์žฅํ•˜๋Š” ํ…์ŠคํŠธ ํšจ๊ณผ๊ตฌํ˜„

<!--css-->
.sc-visual .swiper-slide .text{
    position: absolute;
    text-align: center;
    top: 50%;
    transform: translate(-50%,-50%);
    left: 50%;
    font-size: 100px;
    line-height: 1.2;
    letter-spacing: -2.4px;
    font-weight: 800;
    color: #fff;
}
.sc-visual .swiper-slide .text br{display: none;}
.sc-visual .swiper-slide .text span{
    display: block;
    white-space: nowrap;
    width:0%;  ๐Ÿ‘ˆ
    overflow: hidden;๐Ÿ‘ˆ
    opacity: 0;  ๐Ÿ‘ˆ
    transition: width 0.3s 0.8s,opacity 0.8s 0.8s;
}
.sc-visual .swiper-slide-active .text span{
    width: 100%;  ๐Ÿ‘ˆ
    opacity: 1;  ๐Ÿ‘ˆ
}

swiper slide์˜ .text์— width: 0%๋ฅผ ์ฃผ๊ณ  ๋„˜์น˜๋ฉด ์‚ฌ๋ผ์ง€๋„๋ก
overflow: hidden์ฒ˜๋ฆฌ๋ฅผ ํ•˜์˜€๋‹ค. ๊ทธ ํ›„์—๋Š” ํˆฌ๋ช…๋„๋ฅผ 0์œผ๋กœ ์ฒ˜๋ฆฌํ•˜์—ฌ ๋‚˜ํƒ€๋‚  ๋•Œ ํˆฌ๋ช…๋„ 0์—์„œ ์‹œ์ž‘ํ•˜๋„๋ก ์„ค์ •!
๊ทธ ํ›„ swiper slide๊ฐ€ active ์ƒํƒœ๊ฐ€ ๋˜์—ˆ์„ ๋•Œ์˜ .text ํšจ๊ณผ๋ฅผ ์ฃผ๋ฉด ๋์ด๋‹ค! width: 100%;, opacity: 1;

swiper-slide-active ์ƒํƒœ๊ฐ€ ๋˜๋ฉด width๊ฐ€ 0% โ†’ 100%,
opacity๊ฐ€ 0 โ†’ 1์ด ๋œ๋‹ค!, ์ข€๋” ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ์ฒ˜๋ฆฌ๋ฅผ ํ•˜๊ธฐ์œ„ํ•ด
transition์„ ์ฃผ๋Š”๋ฐ width์™€ opacity๋ฅผ ๊ฐ๊ฐ ๋ช…๋ช…ํ•˜์—ฌ ์ฒ˜๋ฆฌ๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค.

transition: width 0.3s 0.8s,opacity 0.8s 0.8s;

width์˜ 0.3s๋Š” ์ง€์†์‹œ๊ฐ„์„ ์˜๋ฏธ, 0.8s๋Š” delay๋ฅผ ์˜๋ฏธํ•œ๋‹ค.


<!--js-->
const mainSwiper = new Swiper('.sc-visual .swiper', {
  autoplay:{
        delay:5000,
    },
    loop :true,
    speed: 1000,
    simulateTouch: false, //๋งˆ์šฐ์Šค ๋“œ๋ž˜๊ทธ ๋ง‰๊ธฐ
});

์ˆ˜๋™์œผ๋กœ ์Šฌ๋ผ์ด๋“œ ๋˜์ง€ ์•Š๋„๋ก simulateTouch: false๋กœ ๋งˆ์šฐ์Šค ๋“œ๋ž˜๊ทธ๋ฅผ ๋ง‰์•„์ฃผ์—ˆ๋‹ค.
speed๊ฐ’์„ ์กฐ์ ˆํ•˜์—ฌ ๋‹ค์Œ ์Šฌ๋ผ์ด๋“œ๋กœ ๋„˜์–ด๊ฐˆ ๋•Œ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ๋ณด์—ฌ์ง€๋„๋ก ํ–ˆ๋‹ค.



์…€๋ ‰ํŠธ ๋ฐ•์Šค ๋ณ€ํ˜•

<!--html-->
<div class="cor-area [select-area]">
	<span class="title">๋ฒ•์ธ</span>
    <select name="" class="selectbox">
		<option value="" disabled selected>๋ฒ•์ธ์„ ํƒ</option>
		<option value="NAVER">NAVER</option>
		<option value="NAVER Cloud">NAVER Cloud</option>
		<option value="WORKS MOBILE">WORKS MOBILE</option>
		<option value="SNOW">SNOW</option>
		<option value="NAVER LABS">NAVER LABS</option>
		<option value="NAVER WEBTOON">NAVER WEBTOON</option>
		<option value="NAVER FINANCIAL">NAVER FINANCIAL</option>
		<option value="NAVER I&S">NAVER I&S</option>
	</select>
</div>


swiper-slide-disable

์Šค์™€์ดํผ์˜ ๋„ค๋น„๊ฒŒ์ด์…˜์ด ์Šฌ๋ผ์ด๋“œ ๋งจ ์ฒ˜์Œ์— ์˜ค๊ฑฐ๋‚˜, ๋งˆ์ง€๋ง‰์— ๋‹ค๋‹ค๋ž์„ ๋•Œ ๋ฒ„ํŠผ์˜ ์ƒ‰์ƒ์„ ๋ณ€๊ฒฝํ•˜๋„๋ก ํ•˜๋ ค๊ณ  ํ•œ๋‹ค.

<!--js-->
    on:{
         reachBeginning ๐Ÿ‘ˆ: function() {
                var swiperPrev = $('.swiper .prev-btn');
                swiperPrev.addClass('.swiper-button-disabled');
        },
        reachEnd ๐Ÿ‘ˆ: function() {
            var swiperNext = $('.swiper .next-btn');
            swiperNext.addClass('swiper-button-disabled');
        }
    }

์ฒ˜์Œ ์‹œ๋„ ํ•˜์˜€์„ ๋• swiper์˜ on ์†์„ฑ์œผ๋กœ ์ด๋ฒคํŠธ๋ฅผ ์ฃผ๋ ค๊ณ  ํ–ˆ๋‹ค.
reachBeginning ์ด๋ผ๋Š” ๋งจ์ฒ˜์Œ์— ๋‹ค๋‹ค๋ž์„ ๋•Œ ์ด๋ฒคํŠธ ๋ฐœํ˜„,
reachEnd ๋งˆ์ง€๋ง‰์— ๋‹ค๋‹ค๋ž์„ ๋•Œ ์ด๋ฒคํŠธ ๋ฐœํ˜„์ด ๋˜๋Š” ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ง„ํ–‰ํ–ˆ๋Š”๋ฐ....

๊ตณ์ด ์ด๋ ‡๊ฒŒ ํ•  ํ•„์š”๊ฐ€ ์—†์—ˆ๋‹ค!!

<!--css-->
.sc-cont .swiper .control-area .swiper-button-disabled{
    opacity: 0.4;
}

.swiper-button-disabled์—์„œ -disabled๋ผ๋Š” ํด๋ž˜์Šค๋ช…์€ ์Šค์™€์ดํผ์— ์•Œ์•„์„œ ์ฒ˜์Œ์ด๋‚˜ ๋์— ๋‹ค๋‹ค๋ผ์„œ ์ ์šฉ์ด ๋˜์ง€ ์•Š๋Š” ๊ตฌ๊ฐ„์— ์ ์šฉ์ด ๋˜์–ด, ๊ทธ๋ƒฅ .swiper-button-disabled์— css๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด js๋ฅผ ์“ธ ํ•„์š”๋„ ์—†์ด ์ ์šฉ์ด ๊ฐ€๋Šฅํ–ˆ๋‹ค!!



select์—์„œ ๊ธฐ๋ณธ์œผ๋กœ ๋ณด์—ฌ์ง€๋Š” ํ…์ŠคํŠธ ์„ ํƒ

<option value="" disabled selected>๋ฒ•์ธ์„ ํƒ</option>

'disabled selected' ๋ฌธ๊ตฌ๋ฅผ option๋ž€ ์•ˆ์— ์ž‘์„ฑํ•˜๋ฉด placeholder์ฒ˜๋Ÿผ ํ…์ŠคํŠธ๊ฐ€ ๊ธฐ๋ณธ์œผ๋กœ ๋ณด์—ฌ์ง„๋‹ค.

disabled๋Š” ๋Š” ์„ ํƒํ•  ์ˆ˜ ์—†๋„๋ก ํ•˜๋Š” ์†์„ฑ
selected๋Š” placeholder์ฒ˜๋Ÿผ ํ…์ŠคํŠธ๊ฐ€ ๊ธฐ๋ณธ์œผ๋กœ ๋ณด์—ฌ์ง

.sc-search .select-flex select option:disabled { display: none; }

CSS๋กœ disabled์ธ select option์€ display: none; ์ฒ˜๋ฆฌํ•˜๋ฉด ์„ ํƒ ๋ฆฌ์ŠคํŠธ์— ๋ณด์—ฌ์ง€์ง€ ์•Š๋Š”๋‹ค.


placeholder๋Š” css์—์„œ ์ปค์Šคํ…€ ๊ฐ€๋Šฅ

input::placeholder{
    font-weight: bold;
    color: #d0d0d0;
}

์œ„์™€ ๊ฐ™์ด placeholder๋„ ์„ ํƒํ•ด css์ˆ˜์ •์ด ๊ฐ€๋Šฅํ•˜๋‹ค.


option์€ ์Šคํฌ๋ฆฝํŠธ๋กœ ์ปค์Šคํ…€ ๊ฐ€๋Šฅ

$('select').change(function(){
	$(this).css('color','#000');
});

์•„๋ฌด๊ฒƒ๋„ ์„ ํƒํ•˜์ง€ ์•Š์€ ์ฒ˜์Œ ํ…์Šค๋Š” ํšŒ์ƒ‰์ด ๋งž์œผ๋‚˜ ์„ ํƒํ–ˆ์„ ๋•Œ๋Š” ๊ฒ€์ •์ƒ‰์ด์–ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ!

select๋Š” click ์ด๋ฒคํŠธ๊ฐ€ ์•„๋‹ˆ๋ผ,
๊ฐ’์„ ์„ ํƒํ–ˆ์„ ๋•Œ ์ด๋ฒคํŠธ๋กœ change ๋ผ๋Š” ์ด๋ฒคํŠธ๋ฅผ ์‚ฌ์šฉ!!



๋ฐ˜์‘ํ˜• ์›น ์‚ฌ์ดํŠธ

๋ฐ˜์‘ํ˜• ์›น์‚ฌ์ดํŠธ ์ฒ˜๋ฆฌ ๋ฐฉ๋ฒ• ์ข…๋ฅ˜

  1. cssํŒŒ์ผ์„ ๋ถ„ํ• ํ•จ tablet.css , mobile.css
  2. response.css ๋ผ๋Š”ํ•˜๋‚˜์˜ ํŒŒ์ผ์— ๋ชฝ๋•… ๋ฐ˜์‘ํ˜• ์†Œ์Šค ์ง‘์–ด๋„ฃ์Œ
  3. ๊ฐ๊ฐ์˜ ํŒŒ์ผ ํ•˜๋‹จ์— ์“ฐ๋Š”๊ฒฝ์šฐ
  4. ์†Œ์Šค๋ฐ‘์—๋‹ค๊ฐ€ ๊ณ„์† ์ถ”๊ฐ€

์‚ฌ์ดํŠธ ์ž‘์—…์„ ํ•  ๋•Œ ๋ชจ๋ฐ”์ผ์„ ๋จผ์ € ์ž‘์—… ํ›„ pc๋ฅผ ์ž‘์—…ํ•˜๋Š” ๊ฒƒ์ด ๋” ์šฉ์ดํ•˜๋‹ค๊ณ  ํ•œ๋‹ค. ๋ชจ๋ฐ”์ผ์—์„œ ์ž‘์—… ํ›„์— pc๋Š” ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ๋งŒ ํ•˜๋ฉด ๋˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.


๋ฏธ๋””์–ด์ฟผ๋ฆฌ(Media Query)

๋‹ค์–‘ํ•œ ํ™”๋ฉด ํ•ด์ƒ๋„์— ๋”ฐ๋ผ HTML์— ์ ์šฉํ•˜๋Š” ์Šคํƒ€์ผ์„ ์ „ํ™˜ํ•  ์ˆ˜ ์žˆ๋Š” CSS3์˜ ์†์„ฑ์œผ๋กœ ์œ ์—ฐํ•˜๊ฒŒ ์ปจํ…์ธ ๋ฅผ ๋ฐฐ์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค.

๊ธฐ๋ณธ ๋ฌธ๋ฒ•!

@media (screen) {
	content;
}

์ž‘์„ฑ ์œ„์น˜!
1. ๊ฐ css ํŒŒ์ผ ํ•˜๋‹จ์— ํ•˜๊ธฐ๋„ ํ•˜๊ณ ~
2. response.css ํŒŒ์ผ์„ ์ƒ์„ฑ ํ•˜๊ธฐ๋„ ํ•˜๊ณ ~
3. ์†Œ์Šค ๋ฐ”๋กœ ๋ฐ‘์— ์ž‘์„ฑ (scss) ํ•˜๊ธฐ๋„ ํ•˜๊ณ ~


์ž‘์„ฑ ๋ฐฉ๋ฒ•!

//๋Œ€๋žต ๊ตฌํ˜„์ด ์•ˆ๋  ๊ฒƒ ๊ฐ™์€ ๋„“์ด์—์„œ ์ž‘์—…. ๋ณดํ†ต 1200 ์ด์ƒ

/* ์ž‘์€pc [1025px]๊นŒ์ง€๋งŒ์žกํžˆ๋ฉด๋. */
@media (max-width:1229px) {}

/* ๋ชจ๋ฐ”์ผ๋ฒ„์ „ [768px]๊นŒ์ง€๋งŒ์žกํžˆ๋ฉด๋. */
@media (max-width:1024px) {}

/* ๋ชจ๋ฐ”์ผ๋ฒ„์ „ [320]๊นŒ์ง€๋งŒ์žกํžˆ๋ฉด๋. */
@media (max-width:767px) {}

๊ผญ ์ด ์ˆ˜์น˜๋กœ ํ•ด์•ผํ•ด! ๋ผ๋Š” ์ •๋‹ต์€ ์—†๋‹ค.
๊ฐ€์žฅ ๋งŽ์ด ์“ฐ์ด๋Š” ๋ถ„๊ธฐ์ ์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

  • ๋ชจ๋ฐ”์ผ : 320px ~ 767 ๋˜๋Š” 768px
  • ํƒœ๋ธ”๋ฆฟ : 768px ~ 1024px
  • ๋…ธํŠธ๋ถ : 1025px ~ 1200 ๋˜๋Š” 1280px
  • ๋ฐ์Šคํฌํƒ‘ : 1200, 1280px ...๋“ฑ๋“ฑ (1200 ์ด์ƒ)


swiper breakpoints

swiper๋Š” breakpoints๋กœ ๋ฐ˜์‘ํ˜•์„ ์ง€์›ํ•œ๋‹ค.

const swiper = new Swiper('.swiper-container', {
  slidesPerView: 1 โœ…,
  spaceBetween: 10,
  
  breakpoints: {
        
        768: {
        	slidesPerView: 2,  //๋ธŒ๋ผ์šฐ์ €๊ฐ€ 768๋ณด๋‹ค ํด ๋•Œ
        	spaceBetween: 40,
        },
        1024: {
        	slidesPerView: 3,  //๋ธŒ๋ผ์šฐ์ €๊ฐ€ 1024๋ณด๋‹ค ํด ๋•Œ
        	spaceBetween: 50,
        },
});

โœ… ํ‘œ์‹œ๊ฐ€ ๋œ ๊ณณ์„ ๋ณด๋ฉด slidesPerView: 1๋กœ ์ˆ˜์ •์ด ๋˜์–ด์žˆ๋Š”๋ฐ, ์ด ๋ถ€๋ถ„์€ ๋ชจ๋ฐ”์ผ ๊ธฐ๋ฐ˜์„ ๊ธฐ์ค€์œผ๋กœ ์žก๊ณ  ์ฐจ์ธฐ ์‚ฌ์ด์ฆˆ๋ฅผ ๋Š˜๋ ค๊ฐ€๋ฉฐ ์กฐ์ ˆ์„ ํ•ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— 1๋กœ ์ˆ˜์ •์„ ํ•˜์˜€๋‹ค.

์œ„๋Š” ๋ชจ๋ฐ”์ผ ๋•Œ๋Š” ์Šฌ๋ผ์ด๋“œ๊ฐ€ ํ•œ ๊ฐœ 768 ์‚ฌ์ด์ฆˆ ์ด์ƒ์ผ ๋•Œ๋Š” 2๊ฐœ 1024์‚ฌ์ด์ฆˆ ์ด์ƒ ์ผ ๋•Œ๋Š” 3๊ฐœ๋ผ๋Š” ์˜ˆ์‹œ ์ฝ”๋“œ์ด๋‹ค.



checkbox

  • label ํƒœ๊ทธ๋กœ ์ฒดํฌ๋ฐ•์Šค ๋ณ€ํ˜•
  • ์ „์ฒด์„ ํƒ ๋ฐ ์ „์ฒดํ•ด์ œ ๋ฐฉ๋ฒ•
<div class="group-search2">
	<button class="search-box">Search Jobs</button>
	<div class="pop-search">
	<div class="search-wrap"><input type="text" class="btn-search" placeholder="Search Jobs"></input></div>
	<ul class="list">
		<span class="pop-tilte">์ง๊ตฐ/์ง๋ฌด</span>
		<li class="item">
			<a href="" class="depth1">Tech</a>
			<div class="sub">
				<div class="chk-wrap depth-title">
					<input type="checkbox" id="tech">๐Ÿ”—
					<label for="tech">์ „์ฒด</label>๐Ÿ”—
				</div>
				<ul class="depth2" data-parent="tech">๐Ÿ”—
					<li>
						<a href="">Software Development</a>
						<ul class="depth3">
							<li>
                            	<div class="chk-wrap">
									<input type="checkbox" id="soft1">โœจ
									<label for="soft1">Frontend</label>โœจ
								</div>
							</li>
							<li>
								<div class="chk-wrap">
									<input type="checkbox" id="soft2">โœจ
									<label for="soft2">Android</label>โœจ
								</div>
							</li>
						</ul>
					</li>
      (...์ƒ๋žต)

id๋กœ label๊ณผ input ์—ฐ๊ฒฐ : input id์™€ label for ๊ฐ’์„ ๊ฐ™๊ฒŒ (tech)

//์ „์ฒด ๋ถ€๋ถ„
<input type="checkbox" id="tech">๐Ÿ”—
<label for="tech">์ „์ฒด</label>๐Ÿ”—

//ํ•˜์œ„ ๋ฆฌ์ŠคํŠธ ๋ถ€๋ถ„
<input type="checkbox" id="soft1">โœจ
<label for="soft1">Frontend</label>โœจ

์ฒดํฌ๋ฐ•์Šค ์˜์—ญ์€ ๋””์ž์ธ ์ˆ˜์ •์ด ๋ถˆ๊ฐ€ํ•˜์—ฌ ์ˆจ๊น€ ์ฒ˜๋ฆฌ ํ›„
๊พธ๋ฐˆ ์š”์†Œ์ธ ์ฒดํฌ๋ฐ•์Šค๋ฅผ ๋งŒ๋“ค์–ด์•ผ ํ•œ๋‹ค.

// blind์™€ ๋™์ผํ•˜๊ฒŒ ์„ค์ •, ์ฒดํฌ๋ฐ•์Šค ์˜์—ญ ์ˆจ๊ธฐ๊ธฐ!
.chk-wrap input {
	position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    margin: -1px;
}

์ฒดํฌ๋ฐ•์Šค๋ฅผ ๊พธ๋ฐ€์ˆ˜ ์žˆ๋„๋ก before๋กœ ์Šคํƒ€์ผ๋งํ•˜๊ธฐ
.chk-wrap label::before {
	content: '';
    width: 8px;
    height: 8px;
    border: 1px solid #d0d0d0;
    border-radius: 50%;
}

์ฒดํฌ๋ฐ•์Šค ์„ ํƒ ์‹œ ์Šคํƒ€์ผ๋ง (์ฒดํฌ ๋˜์—ˆ์„ ๋•Œ)
 .chk-wrap input:checked+label::before {
        background: #000;
    }

์ „์ฒด์„ ํƒ

click ์ด๋ฒคํŠธ๋กœ ๋ชจ๋“  input์ด ์ฒดํฌ ๋˜์–ด์žˆ์œผ๋ฉด ํ•ด์ œ
๊ทธ๋ ‡์ง€ ์•Š๋‹ค๋ฉด ๋ชจ๋“  input์„ ์ฒดํฌ ํ™œ์„ฑํ™”

$('.depth-title label').click(function(){

    idVal=$(this).siblings('input').attr('id');
    
    if($(this).siblings('input').prop('checked') === true){
        $(`[data-parent="${idVal}"]`).find('input').prop('checked',false)
    }else{
        $(`[data-parent="${idVal}"]`).find('input').prop('checked',true)
    }
});

์ฒดํฌ๋ฐ•์Šค ์„ ํƒ, ์ „์ฒด ํ•ด์ œ์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ•
$('.btn-clear').click(function () {
    $("input[type='checkbox']").prop("checked", false);
});

โ—โ— ์ฒดํฌ๋ฐ•์Šค ํ•ด์ œ์‹œ ์ „์ฒด์„ ํƒ ํ•ด์ œ

<div class="sub">
	<div class="chk-wrap depth-title">
		<input type="checkbox" id<="tech">
		<label class="all-chk" for="tech">์ „์ฒด</label>
	</div>
	<ul class="depth2" data-parent="tech">๐Ÿ‘ˆ
		<li>
			<a href="">Software Development</a>
			<ul class="depth3">
				<li>
					<div class="chk-wrap">
						<input type="checkbox" id="soft1">
						<label for="soft1">Frontend</label>
					</div>
				</li>
            </ul>    
		<li>
        (...์ƒ๋žต)
$('.depth3 .chk-wrap label').click(function(){
    parentName = $(this).parents('.depth2').data('parent');

    // ์ฒดํฌ์™€๋™์‹œ์— ๊ฐœ์ˆ˜๋ฅผํŒŒ์•… 0,1,2,
    // ์ฒดํฌ์™€๋™์‹œ์— ๊ฐœ์ˆ˜๋ฅผํŒŒ์•… 1,2,3,
    
    if($(this).siblings('input').is(':checked')){
        if($(`[data-parent="${parentName}"] input:checked`).length === 1){
          ๐Ÿ‘‰ $(`#${parentName}`).prop('checked',false)
        }
    }
})

depth3์˜ chk-wrap์˜ label์˜ parents(๋ถ€๋ชจ์ค‘์—์„œ~)
depth2์ธ ํด๋ž˜์Šค์˜ data-parent๊ฐ’์„ parentName ์œผ๋กœ ๋ช…๋ช…ํ•˜๊ณ ,

depth3์˜ chk-wrap์˜ labelํƒœ๊ทธ๋ฅผ ํด๋ฆญ์‹œ์— ํ•ด๋‹น ๋ผ๋ฒจ์˜ ํ˜•์ œ์ธ
inputํƒœ๊ทธ๊ฐ€ .is(':checked') (์˜ต์…˜์ด checked ์ƒํƒœ)๊ฐ€ 1์ด๋  ๋•Œ!

[data-parent="${parentName}"]์˜ ์†์„ฑ์„ checked๋ฅผ false(ํ•ด์ œ) ์‹œํ‚จ๋‹ค.

profile
์›น ํผ๋ธ”๋ฆฌ์…”์˜ ์ฝ”๋”ฉ ์ผ๊ธฐ

0๊ฐœ์˜ ๋Œ“๊ธ€