add features to jquery easily
features requires the following to run:
- jQuery 1.0+
to put element in the center of page:
$('#elm').center();
to put element in the center of a box element:
$('#elm').center('#box');
convert english digit to persian digit:
toPersianNum(1); //output: ۱
convert persian digit to english digit:
toEnglishNum(۱); //output: 1
get url parameter:
//url: http://www.example.com/?id=51&name=test
getUrlParameter('id'); //output: 51
getUrlParameter('name'); //output: test
get file size format:
formatBytes(51250000, 2); //output: 51.25 MB
formatBytes(51250000, 1); //output: 51.2 MB
mobile detect:
isMobile(); //output: if has True then open page in mobile
mobile and tablet detect:
isMobileAndTablet(); //output: if has True then open page in mobile or tablet
search value in json:
example:
keyInput = title
valueInput = test2
json = [{id:1,title:'test'}, {id:2,title:'test2'}]
result = {id:2,title:'test2'}
searchInJson(keyInput,valueInput,json); //output: result json
call function and count up element class .count
:
countUp();
persian str validation
justPersian(str); //output: true or false
GolabiJs is licensed under the MIT license.
Copyright © 2018, Amirhossein Hashemi