hakanersu / AmaranJS

Nice, sleek and stylish notifications.
http://amaranjs.com/
MIT License
213 stars 59 forks source link

Button or link #25

Closed lenamtl closed 8 years ago

lenamtl commented 9 years ago

Hi, is this possible to have a clickable link into the box?

hakanersu commented 9 years ago

Hi @lenamtl Do you want to use as an option ? Otherwise you can use links or button on messages like;

$.amaran({
    'message'   :'My positioning example. <a href="http://www.google.com" class="btn btn-success">Google</a>',
    'position'  :'top left'
});

You can use themeTemplate function too;

$.amaran({
  content:{
    themeName:'myTheme',
    href:'http://www.google.com',
    link:'Go Google',
    message:'My Message!'
  },
  themeTemplate:function(data){
    return '<div class="amaran-mytheme"> '+data.message+'<a href="'+data.href+'">'+data.link+'</a> </div>';
  },
  position:'top right'
});

And combine with default templates.Here is the amaran default template;

$.amaran({
  content:{
    themeName:'myTheme',
    href:'http://www.google.com',
    link:'Go Google',
    message:'My Message!'
  },
  themeTemplate:function(data){
    return '<div class="amaran default"><div class="default-spinner"><span style="background-color:#27ae60"></span></div><div class="default-message"><span>'+data.message+'</span> <a href="'+data.href+'">'+data.link+'</a></div></div>';
  },
  position:'top right'
});
lenamtl commented 9 years ago

Ok sound great I'll try that