<script type="text/javascript" src="{$site_url}/Public/js/ZeroClipboard.js"></script> <script language="JavaScript">$(function(){ $(".my_clip_button").each(function(i){ var id = $(this).attr('data');var clip=null;clip = new ZeroClipboard.Client();ZeroClipboard.setMoviePath("{$site_url}/Public/js/ZeroClipboard.swf"); //設定 不然要放在網站根目錄下才顯示clip.setHandCursor( true );clip.setText( $("#txtInvite_"+id).val() ); clip.addEventListener('complete', function (client, text) { ui.success( "恭喜複製成功" ); }); clip.glue( 'd_clip_button_'+id ,'d_clip_container_'+id ); });});</script><style>.my_clip_button { width:62px; text-align:center; height:20px;border:1px solid black; background-color:#ccc; margin:2px; padding:2px; cursor:default; font-size:9pt; }.my_clip_button.hover { background-color:#eee; }.my_clip_button.active { background-color:#aaa; }</style>
<div style="width:90%;margin:0 auto; height:50px;line-height:20px;"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="19%" height="45" align="right">預設邀請連結:</td> <td width="52%"><input type="text" name="txtInvite_default" id="txtInvite_default" value="{$defaultInviteLink}" style="width:350px;" /></td> <td width="31%"> <div id="d_clip_container_default" style="position:relative;"> <div id="d_clip_button_default" class="my_clip_button" data="default">複製</div> </div> </td> </tr> </table> </div> <volist name="invitelists" id="vo"> <div style="width:90%;margin:0 auto; height:50px;line-height:20px;"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="19%" height="45" align="right">{$vo.group_name}專用邀請連結:</td> <td width="52%"><input type="text" name="txtInvite_{$vo.id}" id="txtInvite_{$vo.id}" value="{$vo.invitelink}" style="width:350px;" /></td> <td width="31%"> <div id="d_clip_container_{$vo.id}" style="position:relative;"> <div id="d_clip_button_{$vo.id}" class="my_clip_button" data="{$vo.id}">複製</div> </div> </td> </tr> </table> </div> </volist>