thumbnail-right

측 면에 텍스트가 있는 이미지리스트입니다.

Options
Name type default description
showChar number 300 글 표시 후 말 줄임을 할 텍스트의 길이를 설정 합니다.
moreText string read more 말 줄임 이후 나타낼 텍스트를 설정 합니다.
lessText string less 말 줄임을 펼친 후 나타날 텍스트를 설정합니다.
HTML
		
	
CSS
		.lst-type-right { overflow: hidden; width: 705px; padding: 0 10px 10px; border: 1px solid #c2c2c2; }
		.lst-type-right:after { content: ""; display: block; clear: both; height: 0; visibility: hidden; }
		.lst-type-right li { 
		  overflow: hidden; clear: both; margin: 10px 0 0; color: #2d2c2d; font-family: '돋움', Dotum; font-size: 12px; line-height: 16px; list-style: none; 
		}
		.lst-type-right li .thumb-title { clear: both; margin-left: 10px; font-size: 15px; font-weight: bold; }
		.lst-type-right li img { float: left; width: 90px; height: 90px; display: inline; }
		.lst-type-right li .more { margin-left: 100px; margin-top: 5px; }
	
Javascript
	/** =======================================================
	 * RFC readmore Plugin
	 * 
	 * @Author Choi Jae Hee
	 * @Copyright © 2012 RSUPPORT. CO, LTD. All rights Reserved.
	 * 
	 * @Required jQuery
	 * ======================================================== */
	;(function($) {
		$.fn.readmore = function(options) {
			console.log('readmore', arguments);
		  var opts = $.extend({}, $.fn.readmore.defaults, options);
		 		  	 
		  return this.each(function() {		  			  	
		    var $this = $(this)
		      , content = $this.html();
		      
		    if (content.length > opts.showChar) {
		      var c = content.substr(0, opts.showChar)
		        , h = content.substr(opts.showChar , content.length - opts.showChar)
		        , html = c + '' + opts.ellipsesText + '' +
		      		h + '  ' + opts.moreText + '';
		      $this.html(html);
		      $(".morecontent span").hide();
		    }
		    
		    $('.morelink').live('click', function() {
			    var $this = $(this);
			    if ($this.hasClass('less')) {
			      $this.removeClass('less');
			      $this.html(opts.moreText);
			    } else {
			      $this.addClass('less');
			      $this.html(opts.lessText);
			    }
			    $this.parent().prev().toggle();
			    $this.prev().toggle();
			    return false;
			  });
		  });
		}
		
		// Default Options
		$.fn.readmore.defaults = {
			showChar: 300,
			ellipsesText: '...',
			moreText: 'read more',
			lessText: 'less'
		};
		
		$('.more').readmore();
	})(jQuery);
	

플러그인 사용법 : $('DOM').readmore();

History