2017-09-03 14 views
0

내가 CTRL 포토샵에서 + T 같은 DIV 모양에서 (크기 조정 JQuery와 UI) 글꼴의 크기를 조정할 수 있습니까?크기 조정 글꼴 포토샵에서 Ctrl + t과 같이

see this image

나는 JQuery와 UI에 DIV의 크기를 조정하고 내가 글꼴이 이미지처럼 크기를 의미 반응하지 해요 DIV 자동 글꼴 크기를 조정합니다.

답변

0

나는 "나는 방금 만든이 코드는 안녕 내 답변에 대한 TNX하지만 난 포토샵에서 CTRL + T처럼 말이 내 질문에 대답하지 않는 당신에게

function createResizable(selector,relativeFontSize) 
 
     {  
 
      \t $(selector).css('font-size',parseInt(($(selector).width() * relativeFontSize)/100)+'px');  \t 
 
\t   $(function() { 
 
\t    $(selector).resizable({ 
 
\t    resize: function (event, ui) { 
 
\t     \t var newFontSize = parseInt((ui.size.width * relativeFontSize)/100); 
 
\t     $(this).css('font-size',newFontSize+'px'); 
 
\t    } 
 
\t    }); 
 
\t   }); 
 
\t   $(selector).resizable({ alsoResize: selector}); 
 
     } 
 

 
     $(document).ready(function(){ 
 
      \t createResizable('#resizable',45); 
 
     });
  #resizable{ 
 
      \t width: 150px; height: 75px; 
 
      \t padding: 0.5em;text-align: center; margin: 0; 
 
     }
<link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet"> 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> 
 
<div id = "resizable" class = "ui-widget-content"> 
 
     Hello 
 
     </div>

+1

도움이 될 수 있습니다 생각 stretch " – Sushiant

+0

미안하지만이 코드만으로도 원하는 것을 얻을 수 있습니다. –