html icons for all
just make a span with the "icon
" class. if you want a custom height/width other than the default 16px square size, define it using the internal "style
" property.
example:
<body>
<p><span class="icon" style="width:40px;height:40px;">https://this-is-the-url-to-the-icon</span>wow that was an icon</p>
</body>
- the iconify script and some iconify api...
Iconify.Start();
this may be unneccessary, as there are not a lot of commands.
- parameters: none
- returns: Iconify object
- use: restarts iconify if it was ended earlier, also calls
Iconify.Update()
immidiately after.
- parameters: none
- returns: Iconify object
- use: is the main part of the project. it takes all objects with class of
icon
, and sets their innerHTML to an image with itscalculatedProperty
width
andheight
, with an src attribute of the originalinnerHTML
.
- parameters: none
- returns: Iconify object
- use: sets
Iconify.IsDead
totrue
, which stopsIconify.Update()
from editing elements with classicon
.
the apis are chainable, meaning to only evalulate icons once on a page, you could do this:
Iconify.Start().End();