jquery click opens a new page and reveals text (like vouchercodes.co.uk)
I am trying to get the click reveal affect like here http://www.vouchercodes.co.uk/tesco.com
so 开发者_运维技巧when the button is clicked, it opens site in another tab/browser page then revels the code or text
Any ideas please?
Working Example - just as a first hint for further development...
HTML:
Code:
<span id="code1" style="background-color: #000;">XXXXXXXX</span>
<a id="link1" href='http://www.google.com'>Reveal Code</a>
Javascript:
$('#link1').click(function() {
var newtab = window.open($(this).attr('href'), 'title');
$('#code1').html("SUPERCODE1").css({
"background-color": "transparent"
});
return false;
});
Example: http://jsfiddle.net/FbASg/1/
精彩评论