티스토리 뷰
인스타그램 api ajax로 가져오기
<script type="text/javascript"> jQuery(function($) { var tocken = ""; /* Access Tocken 입력 */ var count = "30"; $.ajax({ type: "GET", dataType: "jsonp", cache: false, url: "https://api.instagram.com/v1/users/self/media/recent/?access_token=" + tocken + "&count=" + count, success: function(response) { if ( response.data.length > 0 ) { for(var i = 0; i < response.data.length; i++) { var insta = '<div class="insta-box">'; insta += "<a target='_blank' href='" + response.data[i].link + "'>"; insta += "<div class'image-layer'>"; //insta += "<img src='" + response.data[i].images.thumbnail.url + "'>"; insta += '<img src="' + response.data[i].images.thumbnail.url + '">'; insta += "</div>"; //console.log(response.data[i].caption.text); if ( response.data[i].caption !== null ) { insta += "<div class='caption-layer'>"; if ( response.data[i].caption.text.length > 0 ) { insta += "<p class='insta-caption'>" + response.data[i].caption.text + "</p>" } insta += "<span class='insta-likes'>" + response.data[i].likes.count + " Likes</span>"; insta += "</div>"; } insta += "</a>"; insta += "</div>"; $("#instaPics").append(insta); } } $(".insta-box").hover(function(){ $(this).find(".caption-layer").css({"backbround" : "rgba(255,255,255,0.7)", "display":"block"}); }, function(){ $(this).find(".caption-layer").css({"display":"none"}); }); } }); }); </script>
'Javascript Tip' 카테고리의 다른 글
naver smarteditor 한글 깨짐 (0) | 2019.07.10 |
---|---|
naver smarteditor display:none 문제 focus 안됨 (1) | 2019.04.08 |
다음 우편번호 API(daum postcode api) (0) | 2018.07.11 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- python anaconda
- mongodb 명령어
- php pdf convert
- jstl list
- mongo 명령어
- AWS
- php encryption
- ubuntu
- conda lib
- php 암호화
- mongo 설치
- s3
- ubuntu nginx
- pypi 배포
- aws s3
- ubuntu setting
- ubuntu docker
- hls 연동
- 우분투 세팅
- ubuntu error
- vscode anaconda
- php
- vscode python
- php pdf
- live drawin
- ubuntu ffmpeg
- MySQL
- flask 시작
- flask 세팅
- aws s3 delete
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함