Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,

i want to ask something about jquery changing height of my textbox when i've image in the container mode,

here is the example,

http://imageshack.com/a/img853/719/t7l4.png[^]

this is what i want, when the image is filled in the container, the textbox height is 90,
and when i typed at the textbox it started at 90 too.

i've tried, and when i typed at the textbox, the height become 30,
here is the error
http://imageshack.com/a/img834/1714/j9kb.png[^]

somebody please help. ~_~
Posted
Comments
How did you exactly created it? Can you make a fiddle at www.jsfiddle.net?

1 solution

this is my css :
CSS
#chartPreview
        {
            position:fixed;
        }.imgPreview
        {
            display:none;   
        }


and here is my jquery
JavaScript
$j(document).ready(function ($) {
                $j('#delete').hide();
                $j('#upload').click(function ($) {
                    $j('#<%= fuFiles.ClientID%>').click();
                });
                $j('#delete').click(function ($) {
                    $j('#imgPreview').hide();
                    $j('#upload').show();
                    $j('#<%= fuFiles.ClientID%>').attr('value', '');
                    $j('#delete').hide();
                    $j('#<%= btnImageSend.ClientID %>').hide();                    
                    $j('#btnSave').show();
                    $j('#<%= txtShout.ClientID %>').css('height','30');

                });
            });

            function readURL(input) {
                if (input.files && input.files[0]) {
                    var reader = new FileReader();
                    reader.onload = function (e) {
                        $j('#imgPreview').show();
                        $j('#upload').hide();
                        $j('#chartPreview').attr('src', e.target.result);
                        $j('#delete').show();
                        $j('#<%= txtShout.ClientID %>').css('height', '90');
                        $j('#<%= btnImageSend.ClientID %>').show();
                        $j('#btnSave').hide();
                    }
                    reader.readAsDataURL(input.files[0]);
                }
            }

            $j(document).ready(function ($) {
                $j("#<%= fuFiles.ClientID %>").change(function ($) {
                    readURL(this);
                    document.getElementById("<%= hdnFile.ClientID %>").value = "N";
                    $j('#<%= txtShout.ClientID %>').css('height', '90');
                });
            });


and here is my txt box :
HTML
<div id="imgPreview" class="imgPreview">
                                          <%--<table style="width:100%; text-align:center;">
                                              <tr>
                                                  <td align="center" style="width:100%">
                                                      <div class="chartPreview1" id="chartPreview1">--%>
                                                          <img class="chartPreview" id="chartPreview" alt="chartYours" src="#" height="80" width="80" />
                                                          <a href="#"><img id="delete" alt="deleteImage" src="../images/deletestockpick.png" height="20" width="20" style="position:absolute; margin-top:0px;margin-left:60px;"></img></a>
                                                      <%--</div>
                                                  </td>
                                              </tr>
                                          </table>
                                      </div>--%>



somebody that can please help me, i'm stuck at this. trims.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900