문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 여기에는 다른 사용자의 개인 설정이 포함되어 있기 때문에 이 자바스크립트 문서를 편집할 수 없습니다. 문서의 원본을 보거나 복사할 수 있습니다. mw.loader.load('//librewiki.net/index.php?title=사용자:Utolee90/status.js&action=raw&ctype=text/javascript'); $(function () { // generate n random integers from 0 to max - 1 function randomArray(n, max) { var arr = []; if (n > max) n = max; while (arr.length < n) { var r = Math.floor(Math.random() * max); if (arr.indexOf(r) === -1) arr.push(r); } return arr; } $('.libre-random').each(function () { var limit = parseInt($(this).data('limit')); var $items = $(this).find('.libre-tab-item'); var activeIds = randomArray(limit, $items.length); console.log(activeIds); $items.each(function (index) { if (activeIds.indexOf(index) !== -1) { $(this).addClass('libre-random-item-active'); } }); }); }); 사용자:Nessun/common.js 문서로 돌아갑니다.