Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="insta" class="mainBlock">
<ul id="instafeed" class="slider"></ul>
</div>
              
            
!

CSS

              
                .slick-slide{
	height:auto;
}

.slider{
    width: 100%;
	margin: 0 auto;
}

ul.slider {
margin:0 0 80px;
	padding:0;
	list-style:none;
}


.slider img{
    height: auto;
    width: 100%;
}
/*slick setting*/
.slick-prev:before,
.slick-next:before {
    color: #000;
}

.slider li{
text-align:center;
position:relative;
margin:5px;
}

.square-content {
    display: block;
    height: 0;
    width: 100%;
    padding-bottom: 100%;
}

#insta ul li span.comment{
	width:			100%;
	height:			100%;
	margin:auto;
	position:		absolute;	/* 絶対位置指定 */
	top:			0;
	bottom:0;
	right:0;
	left:			0;
	opacity:		0;	/* マスクを表示しない */
	background-color:	rgba(0,0,0,0.4);	/* マスクは半透明 */
	-webkit-transition:	all 0.2s ease;
	transition:		all 0.2s ease;
	display:table;
	color:#fff;
	font-size:11px;
	text-align: left;
	box-sizing:border-box;
	padding:15px;
}

#insta ul li:hover span.comment{
	opacity:		1;	/* マスクを表示する */
}

#insta ul li span.comment span{
display: table-cell; /* IE8から使用可能 */	
    vertical-align: middle;	
}
              
            
!

JS

              
                $(function(){
	$.ajax({
		type: 'GET',
		url: '★取得したURL',
		dataType: 'json',
		success: function(json) {
		    	
		    var html = '';
		    var insta = json.media.data;
		    for (var i = 0; i < insta.length; i++) {
		    	html += '<li><a href="' + insta[i].permalink + '" target="_blank"><span class="square-content"><img src="' + insta[i].media_url + '"></span><span class="comment"><span>' + insta[i].caption + '</span></span></a></li>';
		    }
		      $("#instafeed").append(html);
		      
$('.slider').slick({
slidesToShow: 3,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 2000,
centerMode: true,
centerPadding: '10%',


  responsive: [
    {
      breakpoint: 768,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 3
      }
    },
    {
      breakpoint: 480,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 1
      }
    }
  ]


});		           
		},
		error: function() {
		//エラー時の処理
		}
	});	
});	

              
            
!
999px

Console