2018년 1월 31일 수요일
자바스크립트에서 오브젝트의 위치와 사이즈 구하기 (input object etc)
자바스크립트에서 오브젝트의 위치와 사이즈 구하기 (input object etc)
object
input
textarea etc
소스 )
//object의 위치와 사이즈 구하기
function getThisAbsPosition(object){
var position = new Object;
position.x = 0;
position.y = 0;
if( object ) {
position.x = object.offsetLeft;
position.y = object.offsetTop;
if( object.offsetParent ) {
var parentpos = getThisAbsPosition(object.offsetParent);
position.x += parentpos.x;
position.y += parentpos.y;
}
}
position.cx = object.offsetWidth;
position.cy = object.offsetHeight;
return position;
}
이용 )
//new version 위치
var object = document.all.jm_keyword;
var position = getThisAbsPosition(object);
//alert("width : " + position.cx);
//alert("height : " + position.cy);
document.all.ID_POP_JIDO_MENU_WRAP.style.left = (position.x-290)+"px";
document.all.ID_POP_JIDO_MENU_WRAP.style.top = (position.y+10)+"px";
2018년 1월 5일 금요일
c# RichTextBox password *****
c# RichTextBox password *****
class )
using System;
using System.Windows.Forms;
class RichPassword : RichTextBox
{
protected override CreateParams CreateParams
{
get
{
// Turn on ES_PASSWORD
var cp = base.CreateParams;
cp.Style |= 0x20;
return cp;
}
}
}
-------------------------------------------------------------------
//this.rtPw = new System.Windows.Forms.RichTextBox();
this.rtPw = new RichPassword();
...
this.rtPw.Location = new Point(650, 178);
this.rtPw.Width = 180;
this.rtPw.Height = 31;
2018년 1월 4일 목요일
시샵에서 폼(다이알로그) Form을 중앙에 위치시키고 싶을 경우 CenterScreen
시샵에서 폼(다이알로그) Form을 중앙에 위치시키고 싶을 경우 CenterScreen
ex )
private void FormLogin_Load(object sender, EventArgs e)
{
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
}
2017년 12월 28일 목요일
php indexof -> strpos, 문자열이 있는지 체크해준다
php indexof -> strpos, 문자열이 있는지 체크해준다
ex)
$deviceInfo = "android";
$u_agent = $_SERVER['HTTP_USER_AGENT'];
//echo $u_agent."<br>";
$pos1 = strpos($u_agent, "Android");
$pos2 = strpos($u_agent, "android");
if($pos1==true || $pos2==true) {
//ANDROID
//echo "android";
$deviceInfo = "android";
} else {
//IOS
//echo "ios";
$deviceInfo = "ios";
}
접속 브라우저가 안드로이드인지, 애플의 IOS인지를 분별해줘요
have a nice day~
2017년 12월 19일 화요일
자바스크립트 float 처리 소스, parseFloat
자바스크립트 float 처리 소스
예제)
var percent_company = parseFloat(form.percent_company.value);
var percent_seller = parseFloat(form.percent_seller.value);
var percent_callcenter = parseFloat(form.percent_callcenter.value);
var percent_adv = parseFloat(form.percent_adv.value);
var percent_opt = parseFloat(form.percent_opt.value);
var percent_total = percent_company + percent_seller + percent_callcenter + percent_adv + percent_opt;
if(percent_total<100 || percent_total>100){
alert("수익분배의 총 합계가 100.0이 되어야 등록하실 수 있어요");
return;
}
2017년 11월 30일 목요일
구글애드워즈, 구글광고, 어플광고에서 다음내용이 나오는 경우 승인됨(제한적): 법적 요건: 러시아
구글애드워즈, 구글광고, 어플광고에서 다음내용이 나오는 경우 승인됨(제한적): 법적 요건: 러시아
현지 러시아법에 의해서 구글애드워즈에서 나타내는 메세지이다
광고 타겟팅하실 때 제한적인 국가외에 광고를 하시면 돼요,
구글의 내용에 의하면, 수정 후 1일 정도 후에 확인하라고 공지하고 있어요
즐거운 시간 보내세요
구글 애드워즈
https://adwords.google.com
현지 러시아법에 의해서 구글애드워즈에서 나타내는 메세지이다
광고 타겟팅하실 때 제한적인 국가외에 광고를 하시면 돼요,
구글의 내용에 의하면, 수정 후 1일 정도 후에 확인하라고 공지하고 있어요
즐거운 시간 보내세요
구글 애드워즈
https://adwords.google.com
2017년 11월 27일 월요일
자바스크립트 new Date month+1
자바스크립트 new Date month+1
//new Data 0=1월, 11=12월
var startDate = new Date(dtStartYear, dtStartMonth-1, dtStartDay, dtStartHour, dtStartMinute, 00);
var endDate = new Date(dtEndYear, dtEndMonth-1, dtEndDay, dtEndHour, dtEndMinute, 00);
have a nice day~
피드 구독하기:
글 (Atom)