项目作者: undefinedusername

项目描述 :
A place to put my random code.
高级语言: JavaScript
项目地址: git://github.com/undefinedusername/functions.git
创建时间: 2017-05-09T17:22:23Z
项目社区:https://github.com/undefinedusername/functions

开源协议:GNU General Public License v3.0

下载


Useful Functions for websites

To add this to your website:

add this code to your html header

  1. <head>
  2. <script src="https://raw.githubusercontent.com/undefinedusername/functions/master/javascript/openurl.js"></script>
  3. <script src="https://raw.githubusercontent.com/undefinedusername/functions/master/javascript/CreateMenu.js"></script>
  4. <script src="https://raw.githubusercontent.com/undefinedusername/functions/master/javascript/audio.js"></script>
  5. <script src="https://raw.githubusercontent.com/undefinedusername/functions/master/javascript/refresh.js"></script>
  6. <script src="https://raw.githubusercontent.com/undefinedusername/functions/master/javascript/download.js"></script>
  7. </head>

use this to call the functions:

  1. /*openurl(url,urltype,name,toolbar,scrollbar,resizable,top,left,width,height)*/
  2. openurl('www.google.com',"external","Google",true,true,true,100,100,100,250); /*use 'external' to use the internet, not local files*/
  3. openurl('asset/index.html',"local","Home page",true,true,true,100,100,100,250); /*use 'local' normal filesystem to use local files*/
  4. /*CreateMenu(id)*/
  5. var MenuA = new CreateMenu("menuA"); /*use the "new" to use the actual functions of this*/
  6. MenuA.hide(); /* hides the menu */
  7. MenuA.show(); /* shows the menu */
  8. MenuA.sethtml("text"); /* sets the text of the innerHTML */
  9. MenuA.setonclick("code"); /* sets the onclick */
  10. MenuA.setstyle("style"); /* sets the style TODO */
  11. MenuA.getid(); /* gets the id of the menu */
  12. MenuA.gettype(); /* TODO */
  13. MenuA.isActive(); /* returns if active */
  14. refresh() /*reloads the page*/
  15. /* sound(src) */
  16. var music = new sound('music/example.mp3');
  17. music.play(); /* plays music */
  18. music.stop(); /* stops music */
  19. /* download(text, name, type) */
  20. download("sample text","readme.txt",'text/plain'); /* downloads a text doc with the contents "sample text" */

A place to put my random code.