1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
</head>
<body>
<table id="myTable" style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; width: 40%;">
<a href="" onclick="afficheTexte3('Affiche Texte3','text3')" >Texte 3</a><br>
</td>
<td style="vertical-align: top; width: 60%;" id="tableau">
<span class="spanTwitter" data-LinkedTo="text3" style="display:none">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://localhost" data-text="BONJOUR" data-related="twitter,twitfond" data-count="horizontal" data-lang="fr">Tweeter</a>
</span>
<span id="spanText"></span>
</td>
</tr>
</tbody>
</table>
</body>
</html>
<script type="text/javascript">
function afficheTexte3(text,id)
{
$('#tableau #spanText').html(text);
$('#tableau span.spanTwitter').hide();
$('#tableau span.spanTwitter[data-LinkedTo=' + id + ']').show();
}
</script> |
Partager