Last active
May 26, 2018 22:23
-
-
Save hamed-farag/56c547a06548cca223385e4479ae50b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var StyleToString = function (styleString, styleObj) { | |
var style = ''; | |
if (typeof styleString === 'string') { | |
style = style + styleString; | |
} | |
if (typeof styleString === 'object') { | |
for (var styleStringProperty in styleString) { | |
if (styleString[styleStringProperty]) { | |
style = style + ' ' + styleStringProperty; | |
} | |
} | |
} | |
if (typeof styleObj === 'object') { | |
for (var styleProperty in styleObj) { | |
if (styleObj[styleProperty]) { | |
style = style + ' ' + styleProperty; | |
} | |
} | |
} | |
return style.trim(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment