var getval = $('#ifrm',opener.document).contents().find("body").html();
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
// 파일명으로 정렬
$("#sort").click(function() {
	var ul = $("#attach_item");
	var li = ul.children("li").get();
	li.sort(function(a,b) {
		return $(a).find("div > div > small").text().toUpperCase().localeCompare($(b).find("div > div > small").text().toUpperCase());
	});
	$.each(li,function(idx, item) {
		ul.append(item); 
	});
	var i = 0;
	$("#attach_item [name=sort\\[\\]]").each(function() {
		$(this).val(i);
		i++;
	});
});
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
var reg = new RegExp($(this).val() + "/","gi");
order = order.replace(reg,"");
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,

Korean.json
다운로드

 $("#list").DataTable({
	"bFilter": false, // search 필터
	"bLengthChange": false, // 목록갯수 on/off
	"iDisplayLength": 5, // 목록갯수
	"aLengthMenu": [ [1, 2, 3, 4, 5 ], [1, 2, 3, 4, 5] ] // 갯수선택
	"searching": false, // 서치박스
	"paging": false, // 페이징
	"ordering": false, // 정렬
	"info": false // 정보
	"columnDefs": [{
		"targets": [ 0 ],
		"visible": false,
		"searchable": false,
		"orderable": false
		},
		"sDom": '<lf<t>ip>'
		"language": { // 언어팩
		"url": "//cdn.datatables.net/plug-ins/1.10.9/i18n/Korean.json"
		}]
 });

table.column(1).search($(this).val()).draw();
언어 - https://www.datatables.net/plug-ins/i18n/

 

날짜검색 - http://i5on9i.blogspot.kr/2014/09/datatables-date-filter-add-on.html
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
window.open('about:blank','_self').self.close();

'javascript, jquery' 카테고리의 다른 글

str.replace 문자열 정규식 변경  (0) 2015.11.19
datatable 플러그인 사용법  (0) 2015.11.05
마우스 따라다니는 메뉴  (0) 2015.10.01
창 크기에 맞게 리사이징  (0) 2015.09.25
jquery - ajax 파일 업로드  (0) 2015.09.19
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
<style type="text/css">
	#scroll {position:fixed; width:60px; height:20px; right:50px; bottom:50px; display:none; } 
</style>

<script>
$(document).scroll(function() {
	var top = $("#scroll");
	var position = $(window).scrollTop();
  	var height = $(document).height();
	var bottom = height - position;
    
	if(bottom < 1500) {
		top.fadeOut(500);
	} else if(position > 250) {
		top.fadeIn(500);
	} else if(position < 250) {
		top.fadeOut(500);
	}
 });

$("#scroll").click(function() {
	$("html,body").animate({ scrollTop: 0 }, 500);
});
</script>

<span id="scroll">처음으로</span>
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,