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
/* <![CDATA[ */ | |
$(function() { | |
var input = document.createElement("input"); | |
if(('placeholder' in input)==false) { | |
$('[placeholder]').focus(function() { | |
var i = $(this); | |
if(i.val() == i.attr('placeholder')) { | |
i.val('').removeClass('placeholder'); | |
if(i.hasClass('password')) { | |
i.removeClass('password'); |
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
function convertPersianNumbersToEnglish($number) | |
{ | |
$persian = array('۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'); | |
$num = range(0, 9); | |
return (int)str_replace($persian, $num, $number); | |
} |
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
<script> | |
function removeElement(child, parent) | |
{ | |
var parent = document.getElementById(parent); | |
var child = document.getElementById(child); | |
parent.removeChild(child); | |
return false; | |
} |
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
function preload() { | |
while(arguments.length) { | |
new Image().src = [].shift.call(arguments); | |
} | |
} | |
#usage | |
#preload('img1.jpg', 'path/to/img2.jpg', 'img3.jpg'); |