Sharing Customization

Multiple Instances - Share Different Pages

Use the following code as a template for configuring multiple instances to share different links.

Using data attributes

<div>Share Page 1:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-url="http://www.example.com/page_1.html" data-a2a-title="Example Page 1">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<div>Share Page 2:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-url="http://www.example.com/page_2.html" data-a2a-title="Example Page 2">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<div>Share Page 3:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-url="http://www.example.com/page_3.html" data-a2a-title="Example Page 3">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<script type="text/javascript" src="//static.addtoany.com/menu/page.js"></script>

For details, see the full configuration example.

Share Page 1:

Share Page 2:

Share Page 3:

Using JavaScript

<div>Share Page 1:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<script type="text/javascript">
var a2a_config = a2a_config || {};
a2a_config.linkname = 'Example Page 1';
a2a_config.linkurl = 'http://www.example.com/page_1.html';
</script>

<script type="text/javascript" src="//static.addtoany.com/menu/page.js"></script>

<div>Share Page 2:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<script type="text/javascript">
a2a_config.linkname = 'Example Page 2';
a2a_config.linkurl = 'http://www.example.com/page_2.html';
a2a.init('page');
</script>

<div>Share Page 3:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<script type="text/javascript">
a2a_config.linkname = 'Example Page 3';
a2a_config.linkurl = 'http://www.example.com/page_3.html';
a2a.init('page');
</script>

For details, see the full configuration example.

Tip: As seen above, the external script (static.addtoany.com/menu/page.js) initiates an AddToAny instance on the preceding AddToAny instance. After the external script has been defined, calling a2a.init('page') for subsequent instances will also initiate AddToAny there. Either method can be used, but using a2a.init('page') instead of another external script reference can save extra HTTP requests.

Share Page 1:

Share Page 2:

Share Page 3: