Mình muốn hiện comment facebook dưới bài viết đầu tiên (#1) nhưng không dùng iframe mà dùng thẻ div để tùy biến height theo số comment hiện ra. Mình có dùng đoạn code sau
Nhưng nếu dùng đoạn này thì lúc nó hiện lúc thì ko. Ai giúp phần này giúp mình với :D
- Code:
<script type="text/javascript">$(function () {$.ajax({url: "/feed/?f=92",type: "GET",dataType: "html",success: function (a) {$(".post:first").after('<div class="cmtblog4 fb-comments fb_iframe_widget" data-href="http://www.congdongotakuviet.com/t17034-topic" data-numposts="20" data-width="100%" data-colorscheme="light" style="display: block;" fb-xfbml-state="rendered"></div><div class="cugchuyenmuc"><div class="cungchuyenmucname"><i class="fa fa-star-o" aria-hidden="true"></i>Topic cùng chuyên mục:</div><ul id="cungchuyenmuc" style="overflow: hidden; max-height: 225px; margin-top: -3px;"><div style="height:1px;border-bottom: 0px dashed #ababab;margin:0px 0px 5px -30px;display:none; width: 120%;"></div></ul></div>');$(a).find("item:lt(21)").each(function () {$("#cungchuyenmuc div").before('<li><span><a href="' + $(this).find("guid").html() + '">' + $(this).find("title").html() + "</a></span></li>")})},error: function (a) {console.error(a)}});$('.pun div[style="background-color:#ffffff;"] .post-entry').before('')});</script>
Nhưng nếu dùng đoạn này thì lúc nó hiện lúc thì ko. Ai giúp phần này giúp mình với :D