Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to allow the client to re-size the Label"Text-size" at runtime, the JQuery resizable isn't working, it only worked on textbox's/ dropdownlists and so on, but for the Label it did not work; Any suggestions?
Posted
Comments
ridoy 4-Jun-14 4:57am    
I think you found a good answer there: http://stackoverflow.com/questions/24031659/resize-asplabel-at-runtime

 
Share this answer
 
Comments
Member 10863144 4-Jun-14 4:53am    
Thats for win forms, i am looking for a webform
Thanks to stackoverflow;

CSS
.lbl {display:block}



...
ASP.NET
<asp:Label ID="Label1" ClientIDMode="Static" runat="server" 
    Text="Label" CssClass="lbl"></asp:Label>


...

JavaScript
$(function() {
      $( "#label" ).resizable({
         resize: function( event, ui ) {
             var height = ui.element.height();
             ui.element.css({'font-size':height+'%'});
         }
      });
  });
 
Share this answer
 
v2

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