Javascript/jQuery

    Javascript/jQuery

    each 내 addClass 순차적으로 발생하기

    $("#ctt_ul li").each(function (index) { if (!$("#ctt_ul li").eq(index).hasClass("load")) { var row = $(this); setTimeout(function () { row.addClass("load"); }, 100*index); //delay 시간 } }

    Javascript/jQuery

    스크롤하여 객체가 화면에서 보일때 addClass 하기

    function addLoadClass() { var _windowW = $(window).outerWidth(); var _windowH = $(window).outerHeight(); var _getScrollObjY = function () { var scrollArray = []; var pHeight = 300; $("#ctt_ul img").each(function (index) { scrollArray.push(parseInt($("#ctt_ul img").eq(index).offset().top) + pHeight); }); return scrollArray; } // scrollMotion if ($("#ctt_ul li").length != 0) { $("#ctt_ul li").each..

    Javascript/jQuery

    [jQuery] 비디오 객체에 꽉차게 하기

    var $video = $('video'), $window = $('.video_box'); $(window).resize(function () { var height = $window.height(); $video.css('height', height); var videoWidth = $video.width(), windowWidth = $window.width(), marginLeftAdjust = (windowWidth - videoWidth) / 2; $video.css({ 'height': height, 'marginLeft': marginLeftAdjust }); }).resize(); stackoverflow.com/questions/20127763/video-100-width-and-hei..

    Javascript/jQuery

    [스마트에디터] 커서 맨위로 포커스 이동

    var oSelection = oEditors.getById["wr_content"].getEmptySelection(); oSelection.selectNodeContents(oEditors.getById["wr_content"].getWYSIWYGDocument().body); oSelection.collapseToStart(); // 시작위치(최상단)으로 이동 //oSelection.collapseToEnd(); // 끝(최하단)으로 이동 oSelection.select(); oEditors.getById["wr_content"].exec("FOCUS");

    Javascript/jQuery

    현재 주소 링크에 addClass하기/ 현재 주소 herf에서 찾기

    /* 세부페이지 좌측 메뉴 링크 on 시작*/ $(function() { $('.nav .panel').each(function(i) { $('.nav .panel').eq(i).find('a').each(function(e) { if ($(this).attr('href') == "") { $('.nav .panel').addClass('hidden'); $(this).parents('li').parents('.panel').removeClass('hidden'); }else{ ..

    Javascript/jQuery

    [jQuery] 유동적인 테이블 셀병합 - rowspan

    $(document).ready(function(e){ genRowspan("td 클래스명"); }); function genRowspan(className){ $("." + className).each(function() { var rows = $("." + className + ":contains('" + $(this).text() + "')"); if (rows.length > 1) { rows.eq(0).attr("rowspan", rows.length); rows.not(":eq(0)").remove(); } }); }

    Javascript/jQuery

    slick slider 로딩과 함께 이미지가 보이기

    I know it's an old question, but this worked for me in a similar situation, when the problem was that all slides were displayed at once and this looked horrible and jumpy. The solving is pure CSS. First, you add CSS to your slick slider wrapper: .your-slider-wrapper { opacity: 0; visibility: hidden; transition: opacity 1s ease; -webkit-transition: opacity 1s ease; } //After slider is initialized..

    Javascript/jQuery

    팝업 하루동안 안보기

    function setCookieMobile48 (name, value, expiredays) { var todayDate = new Date(); todayDate.setDate(todayDate.getDate() + expiredays); document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";" } function getCookieMobile48 () { var cookiedata = document.cookie; if (cookiedata.indexOf("todayCookie48=done") < 0) { $("#popup48").show(0); $("#pop_black_bg")...

    Javascript/jQuery

    FlexSlider 페이지 넘어가면 페이징 보이기

    2/2 하루동안 닫기 닫기 $(function () { var $status = $('.pop_paging'); var $sliderElement = $('.popup_slider'); var $slideElement = $('.popup_slider li'); $status.text("1/" + $slideElement.length); $sliderElement.flexslider({ animation: "slide", controlNav: false, animationLoop: false, //directionNav: false, slideshow: true, slideshowSpeed: 5000, start: function (slider) {}, after: function (slider) { $..

    Javascript/jQuery

    addClass시점에 이벤트 발생하게 하기

    $(this).addClass('someClass'); $(mySelector).trigger('cssClassChanged') .... $(otherSelector).bind('cssClassChanged', data, function(){ do stuff }); 그러나 그렇지 않으면 아닙니다. 수업이 바뀔 때 이벤트를 시작하는 구운 방법은 없습니다. change()초점이 입력이 변경된 입력을 떠난 후에 만 ​​발생합니다. $(function() { var button = $('.clickme') , box = $('.box') ; button.on('click', function() { box.removeClass('box'); $(document).trigger('buttonClick'); }); ..