[JS + jquery] ์ œ์ด์ฟผ๋ฆฌ UI ํ”Œ๋Ÿฌ๊ทธ์ธ draggable(), Datepicker()

2021. 11. 3. 09:38ใ†HTML + CSS + JS/JS ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ

728x90

1. ์ œ์ด์ฟผ๋ฆฌ UI ํ”Œ๋Ÿฌ๊ทธ์ธ 

https://jqueryui.com/

 

jQuery UI

jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQue

jqueryui.com

์—ฌ๊ธฐ์„œ Downloads ํŽ˜์ด์ง€์˜ ๋งจ ๋ฐ‘์— ๋‹ค์šด๋กœ๋“œ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๊ณ  ์••์ถ•์„ ํ’€๋ฉด ๋œ๋‹ค.

 

2. UI ํ”Œ๋Ÿฌ๊ทธ์ธ์œผ๋กœ ๋“œ๋ž˜๊ทธ ๋ ˆ์ด์–ด ๋งŒ๋“ค๊ธฐ 

ํ™ˆํŽ˜์ด์ง€์˜ ๋ฐ๋ชจ์— ๋“ค์–ด๊ฐ€๋ฉด ์—ฌ๋Ÿฌ๊ฐ€์ง€ UIํ”Œ๋Ÿฌ๊ทธ์ธ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. 

์ €๊ธฐ์— Draggable()์„ ํ™œ์šฉํ•˜์—ฌ ๋“œ๋ž˜๊ทธ ๋ ˆ์ด์–ด๋ฅผ ๋งŒ๋“ค๊ฒƒ์ด๋‹ค. 

 

์šฐ์„  ์ œ์ด์ฟผ๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฝ์ž…ํ•ด์ฃผ๊ณ , ๋‹ค์Œ์— ์ œ์ด์ฟผ๋ฆฌ ui ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ ์‚ฝ์ž…ํ•ด์ค€๋‹ค. 

๊ทธ๋ฆฌ๊ณ  ๋ฐ๋ชจ์—์„œ๋„ ๋ณผ ์ˆ˜ ์žˆ๋“ฏ์ด 

draggable() ํ•˜๊ณ  ์‹ถ์€ ์š”์†Œ์— ๋ฉ”์„œ๋“œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ๋ฉด 

๋“œ๋ž˜๊ทธํ•ด์„œ ์ด๋ฏธ์ง€์˜ ์œ„์น˜๋ฅผ ์˜ฎ๊ธธ ์ˆ˜ ์žˆ๋‹ค. 

 

 

3. UIํ”Œ๋Ÿฌ๊ทธ์ธ์œผ๋กœ ๋‚ ์งœ ์„ค์ • ๋‹ฌ๋ ฅ ๋งŒ๋“ค๊ธฐ 

 

์ด๋ฒˆ์—” ๋ฐ๋ชจ์˜ Datepicker๋ฅผ ์„ ํƒํ•ด์„œ view sources๋ฅผ ๋ณด๋ฉด ์†Œ์Šค๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. 

minDate : +1 ๊ณผ maxDate : "+1M"ํ•˜๋ฉด 

์˜ค๋Š˜์˜ ๋‹ค์Œ๋‚ ๋ถ€ํ„ฐ ๋‹ค์Œ๋‹ฌ๊นŒ์ง€๋งŒ ๋‚ ์งœ๋ฅผ ์„ ํƒ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋œ๋‹ค.

์ž‘์„ฑ ๋‚ ์งœ 2021-11-3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

728x90