M
M
Maxim Timofeev2015-12-29 15:40:45
JavaScript
Maxim Timofeev, 2015-12-29 15:40:45

How to change attribute using jquery in widget for facebook api?

There is a facebook api widget:

<div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/ru_RU/sdk.js#xfbml=1&appId=663908593722127&version=v2.0";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
    </script>
    
    <div class="fb-like-box" data-href="https://www.facebook.com/webinarvolovik"  data-width="400" data-height="400" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false"></div>


How can I change the data-width attribute in it? It needs to be equal
var $swidth = $(".social").width()/2;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jaty4, 2015-12-29
@webinar

$('.fb-like-box').attr('data-width', $(".social").width()/2)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question