BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

center.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. $.noty.layouts.center = {
  2. name : 'center',
  3. options : { // overrides options
  4. },
  5. container: {
  6. object : '<ul id="noty_center_layout_container" />',
  7. selector: 'ul#noty_center_layout_container',
  8. style : function() {
  9. $(this).css({
  10. position : 'fixed',
  11. width : '310px',
  12. height : 'auto',
  13. margin : 0,
  14. padding : 0,
  15. listStyleType: 'none',
  16. zIndex : 10000000
  17. });
  18. // getting hidden height
  19. var dupe = $(this).clone().css({visibility: "hidden", display: "block", position: "absolute", top: 0, left: 0}).attr('id', 'dupe');
  20. $("body").append(dupe);
  21. dupe.find('.i-am-closing-now').remove();
  22. dupe.find('li').css('display', 'block');
  23. var actual_height = dupe.height();
  24. dupe.remove();
  25. if($(this).hasClass('i-am-new')) {
  26. $(this).css({
  27. left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
  28. top : ($(window).height() - actual_height) / 2 + 'px'
  29. });
  30. }
  31. else {
  32. $(this).animate({
  33. left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
  34. top : ($(window).height() - actual_height) / 2 + 'px'
  35. }, 500);
  36. }
  37. }
  38. },
  39. parent : {
  40. object : '<li />',
  41. selector: 'li',
  42. css : {}
  43. },
  44. css : {
  45. display: 'none',
  46. width : '310px'
  47. },
  48. addClass : ''
  49. };