[JQUREY] 특수문자 입력 or 드래그 레이어 - 고객문의



고객문의

[JQUREY] 특수문자 입력 or 드래그 레이어

페이지 정보

작성자 최고관리자 작성일17-12-04 15:13 조회58회 댓글0건

본문

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>

<div style="position:relative;">
<div id="draggable" style="position:absolute;left:670px;top:0px;z-index:20;border:2px solid #003471;cursor:move;display:none;">
<? include "../../sp_char_new.html" ?>
</div>

 

<script language="Javascript">
<!--
function insert_chars(code) {

 var fm = document.suform;
 var target_fm = eval("opener.document.green_form." + code);
 var sutxt = fm.sustr.value;
 var suval = fm.su.value;

 if(!sutxt) {
  alert("입력할 문자를 넣어주세요");
  fm.sustr.focus();
  return false;
 }

 switch (suval)
 {
  case "sup":
   target_fm.value = target_fm.value+"<sup>"+sutxt+"</sup>";
   target_fm.focus();
  break;
  case "sub":
   target_fm.value = target_fm.value+"<sub>"+sutxt+"</sub>";
   target_fm.focus();
  break;
  case "strong":
   target_fm.value = target_fm.value+"<strong>"+sutxt+"</strong>";
   target_fm.focus();
  break;
 }

 window.close();
}
function insert_Character(SC,num_val)
{
 var fm = document.suform;
 var suval = fm.su.value;
 if(num_val == 4){
  switch (suval)
  {
   case "sup":
    SC = "<sup>"+suval+"</sup>";  
   break;
   case "sub":
    SC = "<sub>"+suval+"</sub>";
   break;
   case "strong":
    SC = "<strong>"+suval+"</strong>";  
   break;
   default :
    SC = SC;
   break;   
  }
 }
 window.insertText(SC);
 //window.close();
}

 

var currentArea = '';

function insertText(sCode)
{
 if (currentArea == "") {
  alert('특수문자를 입력할곳을 선택해주세요.');
  return;
 } else {
  insertAtCursor(currentArea, sCode);
 }
}

function checkArea(current) {
 if (current.name) {
  currentArea = current;
 }
}

function insertAtCursor(myField, myValue) {
 if (document.selection) {
  myField.focus();
  sel = document.selection.createRange();
  sel.text = myValue;
 } else if (myField.selectionStart || myField.selectionStart == 0) {
  var startPos = myField.selectionStart;
  var endPos = myField.selectionEnd;
  var add_txt = myField.value.substring(endPos, myField.value.length);
  myField.value = myField.value.substring(0, startPos) + myValue;  
  var pos = myField.value.length;
  myField.value = myField.value + add_txt
  myField.setSelectionRange(pos,pos); 
 } else {
  myField.value += myValue;
 }
}
-->
</script>

<img src="/abstract/icon/sp_char.gif" border="0" onClick="ch_insert2('title');" class="hand" align="absmiddle"><br>

   <textarea name="title" id="title" rows="3" class="form_line" cols="77" onKeyUp="Byte_check('0','200')" onfocus="javascript:checkArea(this)" /></textarea>

<?

$query = "select * from sp_char";
$result = mysql_query($query);
$total = mysql_affected_rows();

?>
<html>
<head>
<title>Special Character</title>
<link rel="stylesheet" href="/abstract/style.css" type="text/css">
<style>
<!--
.ch_form {background: #ffffff; border=1 solid #ffffff font-size: 20px; width:20; color:black;}
//-->
</style>

<script language="javascript" src="drag.js"></script>

</head>
<body leftmargin="0" topmargin="0" onload="window.self.focus();">
<table width="350" border=0 cellpadding=0 cellspacing=3 style="background-color:#ffffff" >
  <tr>
    <td bgcolor="#003471">
      <table width="340" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="/abstract/img/sp_char_title.gif"></td>
          <td width="30" align="center"><img src="/abstract/icon/sp_close_icon.gif" onclick="ch_insert2('close');" class="hand"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td height="1" bgcolor="#E9E9E9"></td>
  </tr>
  <tr>
    <td background="/abstract/img/sp_char_dotbg.gif" height="1"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center">
      <table width="320" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="/abstract/img/superscript.gif"></td>
        </tr>
      </table>
      <table width="320" border="0" cellspacing="1" cellpadding="5" bgcolor="#AAAAAA">
        <tr>
          <td bgcolor="#FFFFFF">
<?
for ($i; $i < 18; $i++)
{
 mysql_data_seek($result,$i);
 $row=mysql_fetch_array($result);
?>
 <!--input type="button" value="<?=$row[sp_char]?>" class="ch_form" onclick="insert_char('<?=$row[sp_char]?>')" style="cursor:hand"-->
 <input type="button" value="<?=$row[sp_char]?>" class="ch_form" onclick="insert_Character('<?=$row[sp_char]?>','1')" style="cursor:hand">
<?
}
?>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center">
      <table width="320" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="/abstract/img/subscript.gif"></td>
        </tr>
      </table>
      <table width="320" border="0" cellspacing="1" cellpadding="5" bgcolor="#AAAAAA">
        <tr>
          <td bgcolor="#FFFFFF">
<?
for ($i; $i < 22; $i++)
{
 mysql_data_seek($result,$i);
 $row=mysql_fetch_array($result);
?>
 <input type="button" value="<?=$row[sp_char]?>" class="ch_form" onclick="insert_Character('<?=$row[sp_char]?>','2')" style="cursor:hand">
<?
}
?>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center">
      <table width="320" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="/abstract/img/sp_char_etc.gif"></td>
        </tr>
      </table>
      <table width="320" border="0" cellspacing="1" cellpadding="5" bgcolor="#AAAAAA">
        <tr>
          <td bgcolor="#FFFFFF">
<?
for ($i; $i < $total ; $i++)
{
 mysql_data_seek($result,$i);
 $row=mysql_fetch_array($result);
?>
 <input type="button" value="<?=$row[sp_char]?>" class="ch_form" onclick="insert_Character('<?=$row[sp_char]?>','3')" style="cursor:hand">
<?
}
?>
          </td>
        </tr>
      </table>
    </td>
  </tr>


<tr>
 <td>&nbsp;</td>
</tr>
<tr>
 <td align="center">
 <table width="320" border="0" cellspacing="0" cellpadding="0">
 <tr>
  <td><img src="/abstract/img/sp_char_add.gif"></td>
 </tr>
 </table>

 <table width="320" border="0" cellspacing="1" cellpadding="5" bgcolor="#AAAAAA">
 <form name="suform">
 <tr>
  <td bgcolor="#FFFFFF">
   <select name='su'>
    <option value='sup'>위첨자</option>
    <option value='sub'>아래첨자</option>
    <option value='strong'>진하게</option>
   </select>

   <input type='text' name='sustr' class='form_line' />
   <img src='/abstract/img/add_icon.gif' title='입력' onclick="insert_Character('<?=$code?>','4');" align="absmiddle" class="hand" />
  </td>
 </tr>
 </form>
 </table>
 </td>
</tr>
<tr>
 <td>&nbsp;</td>
</tr>
</table>


</body>
</html>

 

댓글목록

등록된 댓글이 없습니다.


아웅-_-
회사소개 개인정보취급방침 서비스이용약관 관리자
모바일 버전으로 보기