1 i f 2 <--- 해석가능하시죠 ?

Posted
Filed under dog발;/javascript
$(document).ready(function(){
    // This button will increment the value
    $('.qtyplus').click(function(e){
        // Stop acting like a button
        e.preventDefault();
        // Get the field name
        fieldName = $(this).attr('field');
        // Get its current value
        var currentVal = parseInt($('input[name='+fieldName+']').val());
        // If is not undefined
        if (!isNaN(currentVal)) {
            // Increment
            $('input[name='+fieldName+']').val(currentVal + 1);
        } else {
            // Otherwise put a 0 there
            $('input[name='+fieldName+']').val(0);
        }
    });
    // This button will decrement the value till 0
    $(".qtyminus").click(function(e) {
        // Stop acting like a button
        e.preventDefault();
        // Get the field name
        fieldName = $(this).attr('field');
        // Get its current value
        var currentVal = parseInt($('input[name='+fieldName+']').val());
        // If it isn't undefined or its greater than 0
        if (!isNaN(currentVal) && currentVal > 0) {
            // Decrement one
            $('input[name='+fieldName+']').val(currentVal - 1);
        } else {
            // Otherwise put a 0 there
            $('input[name='+fieldName+']').val(0);
        }
    });
});
출처 : http://ememomo.tistory.com/159
2016/11/17 19:14 2016/11/17 19:14
Posted
Filed under dog발;/php
function cal_diff_date($date1, $date2)
{
	if(version_compare("5.3", phpversion(), "<="))
	{
		$date_1 = new DateTime($date1);
		$date_2 = new DateTime($date2);
		$date_diff = $date_1->diff($date_2);

		return array(
			"year" => $date_diff->y,
			"month" => $date_diff->m,
			"day" => $date_diff->d,
			"hour" => $date_diff->h,
			"minute" => $date_diff->i,
			"second" => $date_diff->s
		);
	}
	else
	{
		$date_1 = strtotime($date1);
		$date_2 = strtotime($date2);
		$sec = $date_1 - $date_2;
		$sec = intval(abs($sec));

		$ret = array(
			"year" => 0,
			"month" => 0,
			"day" => 0,
			"hour" => 0,
			"minute" => 0,
			"second" => 0
        );
		
		if(0 == $sec)
			return $ret;

		$units = array(
			"year" => 365*24*60*60,
			"month" => 30*24*60*60,
			"day" => 24*60*60,
			"hour" => 60*60,
			"minute" => 60,
			"second" => 1
		);

		foreach($units as $unit => $val)
		{
			$value = floor($sec / $val);
			$ret[$unit] = $value;
			$sec -= $value * $val;
		}

		return $ret;
	}
}

echo cal_diff_date(날짜1, 날짜2);
2016/07/07 10:23 2016/07/07 10:23
Posted
Filed under dog발;/javascript
var regExp = /([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;

if (!regExp.test('Email@Address.com')) 
     return false;
else
     return true;
2016/07/05 15:32 2016/07/05 15:32
Posted
Filed under dog발;/javascript
var oImg = new Image();

jQuery(oImg).load(function(){
     var nW = oImg.width;
     var nH = oImg.height;
     alert(nW + "x" + nH);
});

oImg.src = "이미지url";
2016/07/05 15:32 2016/07/05 15:32
Posted
Filed under dog발;/javascript
$(function(){
     $.extend($.fn.disableTextSelect = function(){
          return this.each(function(){
               if($.browser.mozilla){     //Firefox
                    $(this).css('MozUserSelect','none');
               }else if($.browser.msie){     //IE
                    $(this).bind('selectstart',function(){ return false; });
               }else{     //Opera, etc.
                    $(this).mousedown(function(){ return false; });
               }
          });
     });     //No text selection on elements with a class of 'noSelect'
    
     $('.noSelect').disableTextSelect();
});
2016/07/05 15:30 2016/07/05 15:30