Implementing sharing buttons

We have four sharing buttons and each of these needs to be configured differently to share. When the user will click an icon, we will open a new window and based on the icon that was clicked, redirect the user to the appropriate page. Write the following code inside the initSharing method that will add the event handler for the click event of sharing links:

$('.shareBox a').on('click', function()
{
  var type = $(this).prop('type');
  dashboard.sharePage(type);
});

Content for the first portlet has the shareBox class assigned to it and it has sharing links inside it. In the above code, we added the click event handler for all the links inside the .shareBox div. The callback method for the event handler first gets the value ...

Get Mastering jQuery UI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.