开发者

Customize fb:comments box css with jQuery or equivalent

开发者 https://www.devze.com 2023-02-13 22:37 出处:网络
I am trying to customize the looks of the FB comments box with jQuery. What i need is every 2nd comment to have another background color to fit the style of the page i am trying to implement the comme

I am trying to customize the looks of the FB comments box with jQuery. What i need is every 2nd comment to have another background color to fit the style of the page i am trying to implement the comments.

This is what it should look like: http://i.stack.imgur.com/OQ2Q9.png

This is my code:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=dummyID&amp;xfbml=1"></script>
<fb:comments xid="XID1" numposts="10" width="640" publish_feed="false" simple="true" css="http://link.to.webserver/misc/facebook.css?3"></fb:comments>
<script src="http://jquery.com/src/jquery-latest.js"></script>
<script type="text/javascript">
    $().ready(function () {
        $(window).bind("load", function () {
            $('div.wallkit_post:odd').addClass('odd');
            $('div.wallkit_post:even').addClass('even');
      开发者_运维百科  });
    });
</script>

Problem: the class "wallkit_post" does not change.

alert ($("div.wallkit_post").val()); 

gives me an "undefined" error.

I am out of options here...

If you have any idea please help me


I have the same pro The Comments plugin loads in iframe. That's why you cannot reach div.wallkit_post selector. But I don't know how to make it work yet.

0

精彩评论

暂无评论...
验证码 换一张
取 消