开发者

jquery click opens a new page and reveals text (like vouchercodes.co.uk)

开发者 https://www.devze.com 2023-02-03 10:11 出处:网络
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 co

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消