0

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() {
        jQnotice('Message..! - here i want to ad a url ex. "link go to shop" ');
    });
});
bezmax
  • 25,562
  • 10
  • 53
  • 84
Pete
  • 5
  • 3

3 Answers3

0

The link should be:

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

Since you are selectin links with class = buy.

Nicola Peluchetti
  • 76,206
  • 31
  • 145
  • 192
0

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;
    });
});
Alex Pliutau
  • 21,392
  • 27
  • 113
  • 143
  • http://www.htmldrive.net/items/show/431/jQueryNotice-animated-notification-tooltip – Pete Jul 15 '11 at 09:27
  • Thank you, I still can not get it to work - the link does not seem to work - all code is there, does it makes more sense? http://www.htmldrive.net/items/show/431/jQueryNotice-animated-notification-tooltip – Pete Jul 15 '11 at 09:30
  • Thank you, I still can not get it to work - the link does not seem to work - all code is there, it makes more sense? http://www.htmldrive.net/items/show/431/jQueryNotice-animated-notification-tooltip – Pete Jul 15 '11 at 09:37
0

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

Ergec
  • 11,608
  • 7
  • 52
  • 62
  • I'd appreciate if you select my answer as correct answer by checking the tick on the left :) thanks – Ergec Jul 15 '11 at 09:53
  • Hey, I still have a little trouble getting it to work ... When you click the button, the message window pops up properly, but the product will not put in the basket .. Have you some ideas how to fix it? - The code for the butotn looks like this: $if(User.VisibleBuy)$ $if(it.IsBuyableQuick)$ $text.button_buy$ $endif$ – Pete Jul 15 '11 at 13:27