w2ui
Home
Get started
Demos
Docs
Blog
Support
Layout
Grid
Toolbar
Sidebar
Tabs
Form
Popup
Utilities
ver 1.3
ver 1.4
ver 1.5
ver 2.0
Utilities
Overview
Properties
Methods
Other
Events
Extending
w2utils.getStrWidth
Returns width of the string in px.
getStrWidth(str, styles)
str
string
, string to calculate width
styles
string
, styles for the string
Calculates and returns width of the string in pixels.
var width = w2utils.getStrWidth('Some text', 'font-size: 40px; font-weight: bold;'); console.log(width);
User Comments
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus