728x90
๋ฐ˜์‘ํ˜•

jQeury 3

[jQuery] .siblings()

Syntax $("์„ ํƒ์ž").siblings(); // ์„ ํƒํ•œ ์š”์†Œ์˜ ํ˜•์ œ์š”์†Œ๋“ค์„ ์„ ํƒํ•œ๋‹ค. $("์„ ํƒ์ž").siblings("์„ ํƒ์ž"); // ์„ ํƒํ•œ ์š”์†Œ์˜ ํ˜•์ œ ์ค‘์— ์„ ํƒ์ž๋ฅผ ์ด์šฉํ•ด ์„ ํƒํ•œ๋‹ค. Ex $('.btn-outline-primary').click(function(){ $(this).siblings().removeClass("active"); $(this).addClass("active"); }); โžก ํด๋ฆญํ•œ ์š”์†Œ์˜ ํ˜•์ œ๋“ค์„ ์„ ํƒํ•ด์„œ activeํด๋ž˜์Šค๋ฅผ ์ œ๊ฑฐํ•ด์ฃผ๊ณ  ํด๋ฆญํ•œ ์š”์†Œ์— activeํด๋ž˜์Šค๋ฅผ ์ถ”๊ฐ€ํ•ด์ค€๋‹ค.

Front/JS & jQuery 2022.06.06

[jQuery][datatables] columnDefs . width

Ex $('#table').DataTable({ columnDefs : [ ,{ "width": "10%", "targets": [2,3,4] } ,{ "width": "15%", "targets": [1] } ] โžก targets๋กœ ์„ค์ •๋œ ์—ด์˜ ๋„ˆ๋น„๋ฅผ ์„ค์ •ํ•ด์ค€๋‹ค. https://datatables.net/reference/option/columns.width columns.width columns.width Since: DataTables 1.10 Column width assignment. Description This parameter can be used to define the width of a column, and may take any CSS value (3em, 20px etc). Ple..

Front/JS & jQuery 2022.06.05
728x90
๋ฐ˜์‘ํ˜•