1

I have added a Facebook comment box of width 288 to my website. It's working fine, the only problem is that when I try to delete comments posted by me, some part of delete button hides inside plugin width 288.

Is there any method so that I can decrease the width delete popup box, so that it could fit my specified width.

I also wants to know if there is any method to change its CSS with my custom styles.

I was unable to find comment box's any Dom element through CSS or jQuery.

ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
ajaykalyanynr
  • 35
  • 1
  • 8

1 Answers1

0

You can add CSS files to your iFrame using Javascript:

var cssLink = document.createElement("link") 
cssLink.href = "file://path/to/style.css"; 
cssLink .rel = "stylesheet"; 
cssLink .type = "text/css"; 
frames['iframe'].document.body.appendChild(cssLink);

You just have to implement your CSS file and use this code when appropriate.

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
  • Haven't tested this, though [these guys](http://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe) have voiced some concerns. I guess the only other option would be to implement your own comments box by using the facebook [api](http://developers.facebook.com/docs/reference/api/Comment/) (that's just a starting point + fb account required to open). – mtsvetkov Aug 31 '12 at 11:10
  • that solution only work fine to change background color of iframe.. because facebook comment box contents are still hidden – ajaykalyanynr Aug 31 '12 at 11:44
  • Can you tell me what is the rule which makes them hidden and what rule did you try to prevent that? – Lajos Arpad Aug 31 '12 at 13:08
  • i think facebook uses some php programming inside iframe , that prevent it to access from outside – ajaykalyanynr Sep 03 '12 at 06:53
  • Nope, I don't think so. Probably your styles don't apply to the given tags or they have a lower priority than the given tags. If you can't figure out how to raise the priority of your tags, define them as !important. Also, please answer my question from my previous comment, I can't help you further without additional information. – Lajos Arpad Sep 03 '12 at 11:19