开发者

Editing Facebook Like-Box Css on The FLy?

开发者 https://www.devze.com 2023-02-13 11:00 出处:网络
I am not a coder but, i am able to get my way around code most of the time. However, i found that this is the best place to ask questions relating to code stuff.

I am not a coder but, i am able to get my way around code most of the time. However, i found that this is the best place to ask questions relating to code stuff.

I have been working on a website 开发者_如何转开发for a client and i am at 95% - the only problem i have is facebook like-box. i have found several tutorials on the web to modify the like box css, and i have implemented most of the recommendations but, i have no favorable results.

Please - stackoverflow help!

I know jquery/javascript is a very powerful language. And facebook like uses javascript iframe/xfbml.

what code would you use, if you were to modify the like box css elements before loading them .

I say load cos i am loading my like box via ".load" ajax. So, when a user clicks the facebook button jquery loads it.

In short: how would i edit a css file on the fly, and then load the edited version afterwards.

thanks


The key problem that you'll have here is that FB's Like button is loaded inside an iframe - a self-contained HTML document within your page (if you use firebug or webkit inspector to inspect the like button, you'll see it's within <body>, <html>, then <iframe>).

The thing about these self-contained pages is that you can't access or manipulate them from the surrounding document (your page). You can change the 'src' attribute (telling the iframe to load a new page), but you can't apply or change styles on the elements inside the page. This is a security limitation that browsers have.

I know that it is possible to have a custom-styled like button, but I don't think it's done with the iframe method.

0

精彩评论

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