Advertisement
Guest User

StackExchange comments tooltip

a guest
Sep 17th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(".answer").on('focus', "div.comment-form textarea[name=comment]", function(evt){
  2.     $(this).parent("div.js-comment-text-input-container").prepend(
  3.         $("<div class='comment-tooltip-ext'><strong>**Bold**</strong><i>_italic_</i><code>`code`</code>[link to foo](https://foo.com)</div>")
  4.         .css({
  5.             "padding": "3px",
  6.             "text-align": "center",
  7.             "background-color": "#FFF8DC",
  8.             "box-shadow": "0 2px 8px rgba(59,64,69,0.1)",
  9.             "border": "1px solid #d6d9dc",
  10.             "border-top-left-radius": "3px",
  11.             "border-top-right-radius": "3px",
  12.             "border-bottom": "none"
  13.         }
  14.         )
  15.     );
  16. });
  17. $(".answer").on('blur', "div.comment-form textarea[name=comment]", function(evt){
  18.     $(".comment-tooltip-ext").remove();
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement