2012-04-05 4 views
0

に私はこのようになりますダイアログボックスウィンドウを持ってチャットがあります。

enter image description hereはどのようにはめ込みテキストボックスにボタンダイアログエリア


することは基本的に私はボタンエリアにテキストボックスを移動したいです。

divnodecopy = document.getElementById(div_node); 
      $(divnodecopy).dialogr({ 
        autoOpen:true, 
        maximized: true, 
        minimized: true, 
        buttons: { 
        "Send": { 
         text: 'Send', 
         click: function() { 
             alert("here"); 
             // do stuff 
            } 
         } 
        }, 
         }); 
    document.getElementById(div_node).appendChild(element1); 
// element1 - input text i want to move in dialogr 

私は解決策が、何のためにどこでも検索しましたが、事前にthere.Thanksを私を助けるために!

編集:追加のdivを作成

var div = document.createElement("div"); 
        div.setAttribute("id", "1"); 

        var element = document.createElement("input"); 
        element.setAttribute("type", "text"); 
        element.setAttribute("value", ""); 
        element.setAttribute("id", "textReceived"); 
        div.appendChild(element); 

        var element1 = document.createElement("input"); 
        element1.setAttribute("type", "text"); 
        element1.setAttribute("value", ""); 
        element1.setAttribute("id", "textSend:"); 
        document.body.appendChild(div); 
        divnodecopy = document.getElementById(div_node); 
+0

]ダイアログボックスのためのあなたのHTMLマークアップがありますか? div_node –

+0

私はcreate要素(div)でdiv_nodeを動的に作成し、2つの要素(求心性スタイルを持つ)を属性として追加します –

+0

投稿するには、htmlを投稿してください。 –

答えて

0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title></title> 
    <link href="css/ui-lightness/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" /> 
    <link href="css/jquery.dialogr.css" rel="stylesheet" type="text/css" /> 
    <script src="../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script> 
    <script type="text/javascript" src="js/jquery-ui-1.8.6.custom.min.js"></script> 
    <script type="text/javascript" src="js/ui.dialogr.js"></script> 
    <script type="text/javascript"> 
     $(document).ready(function() { 

      createChatDialogerBox(1, 'Thulasi Ram.S'); 

      function createChatDialogerBox(fromUserId, fromUserName) { 
       if ($('#chatDialogerBox' + fromUserId).length === 0) { 

        var divnodecopy = $('<div id="chatDialogerBox' + fromUserId + '" class="chatDialogerBox"></div>').append('<input />', { 'type': 'text', 'value': '', 'id': 'textReceived', 'class': 'messageReceived' }); 

        $(divnodecopy).dialogr({ 
         autoOpen: true, maximized: true, minimized: true, 
         title: fromUserName, 
         buttons: { 
          "Send": { 
           text: 'Send', 
           click: function() { 
            alert("here"); 
            // do stuff 
           } 
          } 
         } 
        }); 

        //$('#chatDialogerBox' + fromUserId).parents('.ui-dialog').find('.ui-dialog-buttonpane') 
        //.append('<input />', { 'type': 'text', 'value': '', 'id': 'textSend' }); 

        //Or 

        $('#chatDialogerBox' + fromUserId).parents('.ui-dialog').find('.ui-dialog-buttonpane') 
        .prepend('<input />', { 'type': 'text', 'value': '', 'id': 'textSend', 'class': 'messageSend' }); 
       } 
      }; 
     }); 
    </script> 
    <style type="text/css"> 
     .messageSend 
     { 
      margin-right: 20px; 
     } 
    </style> 
</head> 
<body> 
</body> 
</html> 
+0

でrのコードを投稿することができますそれはうまくいきます。 – Thulasiram

+0

jquery uiのようなファイルcssとjsのリンクです。私はhttp://jsfiddle.net/(http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui)でlileのデモを見ることができます。 CSS) – Thulasiram

関連する問題