Skip to content

Instantly share code, notes, and snippets.

@gitaeks
Created February 16, 2016 03:04
Show Gist options
  • Select an option

  • Save gitaeks/48d1c9517920c5dffc3c to your computer and use it in GitHub Desktop.

Select an option

Save gitaeks/48d1c9517920c5dffc3c to your computer and use it in GitHub Desktop.
rb1 sociallogin 모듈 - 로그인 버튼 수동 출력
<button type="button" class="btn btn-sns btn-facebook" onclick="window.open('<?php echo $slogin['facebook']['callapi']?>','','width=1000px,height=650px,status=no,scrollbars=no,resizeable=no');">
페이스북으로 로그인
</button>
<button type="button" class="btn btn-sns btn-twitter" onclick="window.open('<?php echo $slogin['twitter']['callapi']?>','','width=700px,height=650px,status=no,scrollbars=no,resizeable=no');">
트위터로 로그인
</button>
<button type="button" class="btn btn-sns btn-kakaotalk" onclick="window.open('<?php echo $slogin['kakao']['callapi']?>','','width=400px,height=450px,status=no,scrollbars=no,resizeable=no');">
카카오톡으로 로그인
</button>
<button type="button" class="btn btn-sns btn-naver" onclick="window.open('<?php echo $slogin['naver']['callapi']?>','','width=400px,height=450px,status=no,scrollbars=no,resizeable=no');">
네이버로 로그인
</button>
<button type="button" class="btn-sns btn btn-google" onclick="window.open('<?php echo $slogin['google']['callapi']?>','','width=450px,height=450px,status=no,scrollbars=no,resizeable=no');">
구글 계정으로 로그인
</button>
<button type="button" class="btn-sns btn btn-instagram" onclick="window.open('<?php echo $slogin['instagram']['callapi']?>','','width=500px,height=350px,status=no,scrollbars=no,resizeable=no');">
인스타그램으로 로그인
</button>
@gitaeks
Copy link
Copy Markdown
Author

gitaeks commented Feb 16, 2016

button 에 onclick 이벤트 대신 data-href 와 같은 커스텀 attr 을 지정해서 jquery로 다음과 같이 접근

$(".btn-facebook").on("click",function() {
    window.open($(this).data("href"),'','창옵션');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment