Advertisement
NecromancerCoding

Añadir botones header a editor

Dec 28th, 2022
2,409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.24 KB | None | 0 0
  1. $(function(){
  2. $(function(){
  3. $('<a class="sceditor-button sceditor-button-h2" unselectable="on" title="H2"><div unselectable="on" style="background-image:url(https://static-00.iconduck.com/assets.00/heading-h2-icon-512x284-fwpqhotv.png);background-size:80%;background-position:Center;"></div></a>').insertAfter('.sceditor-button-strike').click(function(){
  4. $('#text_editor_textarea').sceditor("instance").insert("[h2]", "[/h2]");
  5. });
  6. $('<a class="sceditor-button sceditor-button-h3" unselectable="on" title="H3"><div unselectable="on" style="background-image:url(https://static-00.iconduck.com/assets.00/heading-h3-icon-256x143-j6tmiuey.png);background-size:80%;background-position:Center;"></div></a>').insertAfter('.sceditor-button-h2').click(function(){
  7. $('#text_editor_textarea').sceditor("instance").insert("[h3]", "[/h3]");
  8. });
  9. $('<a class="sceditor-button sceditor-button-h4" unselectable="on" title="H4"><div unselectable="on" style="font-size:1em;background-image:url(https://static-00.iconduck.com/assets.00/heading-h4-icon-256x143-7z31mk6z.png);background-size:80%;background-position:Center;"></div></a>').insertAfter('.sceditor-button-h3').click(function(){
  10. $('#text_editor_textarea').sceditor("instance").insert("[h4]", "[/h4]");
  11. });
  12. });
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement