Latest news
Home » javaScript » copy to clipboard using jQuery

copy to clipboard using jQuery

<a href=”javascript:void(0);” id=”userlinkId” style=”display: inline;”>http://localhost/profile/sijo</a>
<script type=”text/javascript”>
jQuery(document).ready(function(){
  jQuery(“a#userlinkId”).zclip({
      path:’js/ZeroClipboard.swf’,
      copy:jQuery(‘#userlinkId’).text(),
      beforeCopy:function(){
          jQuery(‘#userlinkId’).hide();
          jQuery(‘#copymessage’).css(‘color’,’red’);
          jQuery(‘#copymessage’).html(‘Copied to clipboard’);
          jQuery(‘#copymessage’).delay(2000).fadeOut(400);
      },
      afterCopy:function(){
          jQuery(‘#userlinkId’).delay(2500).fadeIn();
          jQuery(‘#ZeroClipboardMovie_1’).hide();
          //jQuery(“a#userlinkId”).zclip(‘remove’);
      }
  });
});
</script>

Leave a Reply

x

Check Also

How to Check Expired Sessions using jQuery Ajax and PHP

We can achieve using the php and ajax.The following ajax call execute in every 10 ...