Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6781491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:37:49+00:00 2026-05-26T16:37:49+00:00

all my problem is as follows: I have a page containing an addthis-button. Normally,

  • 0

all

my problem is as follows:

I have a page containing an addthis-button. Normally, a click opens a small menu.

At some point, parts of this page – including the addthis-button – get cloned (via jQuery) and reused on the same page.

If I click on the cloned button, the menu doesn’t open, and an addthis page is loaded.

So, apparently the eventhandler gets lost, and the button (which is really an <a>) reverts to being a link and displays the linked page.

So how can I re-register the events of the cloned button?

ETA: To clarify: I want to clone addthis_button complete with everything addthis_widget.js did to it.
mylittlebutton and its clickhandler clickedhim() are irrelevant for the problem, they only trigger the cloning of addthis_button.

I’d be grateful if some could point me in the right direction
Also, I have a 20-line snippet that illustrates this, if that helps.

Thank you

ETA:
the code snippet:

<script src='../../js/lib/jquery-1.6.2.js' type="text/javascript"></script>

<!-- up to here, the original button is initialized -->
<a class="addthis_button addthis_button" href="http://www.addthis.com/bookmark.php?v=250">
  <img src="../../resources/img/button_share.gif" width="59" height="17" alt="Bookmark and Share" style="border:0"/>
</a>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>


<br />

<!-- button to trigger the cloning -->
<input type="button" id="mylittlebutton" onclick="clickedhim(this);" value="CLICK ME" />

<script type="text/javascript" >
function clickedhim(eventtarget) {
  var nearest_addthis = $(eventtarget).siblings("a.addthis_button");
  // clone button, and insert it after the original
  nearest_addthis.after(nearest_addthis.clone());
}
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:37:49+00:00Added an answer on May 26, 2026 at 4:37 pm

    Okay, I solved it.

    According to the Addthis Client API, any unsuspecting element can be turned into an addthis.button with

    <script type="text/javascript">
    addthis.button("#atbutton");
    </script>
    

    So, after I clone my elements, I call

    addthis.button(".addthis_button");
    

    and everything works like a charm.

    Thank you all for your help.

    Addendum: The above works to initialize the individual do-everything AddThis button. If you have individual button controls such as Email, Facebook, etc…, you will need to use

    addthis.toolbox('<parent element>');

    to initialize those controls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day everyone. I have been having the same problem all day at work
Hi all I have problem with my div's in html. I have set them
Problem Hello all! I have this code which takes my jpg image loops through
I am having a huge problem in all browsers. I have a site where
I have a (big) problem that all of you that work with Webforms might
I have no problem finding all tags for an object and getting the count
I have a page (mypage.html) which sets a cookie as follows: setcookie (sessionid, md5
I am writing a small application in Classic ASP. I have a page which
I have created a Page class and all the pages on my website are
I have a script embedded in a page, which is as follows: <script type=text/javascript>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.