Skip to content Skip to sidebar Skip to footer

Link In The Message Of JQnotice

How can I make a link that works in the following script. I use it as a pop-up, with the purchase of goods in a shop: $(document).ready(function() { $('a.buy').click(function()

Solution 1:

In JQnotice plugin this line

$('<div></div>').attr('id', 'notice').css('left', (50-left)+'%').css('top', (0+top)+'px').appendTo('body').text(message);

should be like this

$('<div></div>').attr('id', 'notice').css('left', (50-left)+'%').css('top', (0+top)+'px').appendTo('body').html(message);

Here is the link

http://jsbin.com/iwedah


Solution 2:

The link should be:

  <a class='buy'>click me</a>

Since you are selectin links with class = buy.


Solution 3:

HTML:

<a href="http://example.com" class="buy">Link</a>

JS:

$(document).ready(function() {
    $('a.buy').click(function() {
        jQnotice('Message..!<a href="' + $(this).attr('href') + '">Go to shop</a>');
        return false;
    });
});

Post a Comment for "Link In The Message Of JQnotice"