Skip to content

Instantly share code, notes, and snippets.

@dudelis
Last active March 4, 2019 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dudelis/c63eda77fb72e07b7eaa92bcfc4ff328 to your computer and use it in GitHub Desktop.
Save dudelis/c63eda77fb72e07b7eaa92bcfc4ff328 to your computer and use it in GitHub Desktop.
K2 Smartforms: How to make Textarea resizable
$(document).ready(function(){
$('textarea').each(function(index, obj){
$wrapper = $(obj).closest('.input-control.text-input');
var width = $wrapper.width();
$wrapper.css('width', '');
$(obj).css('width', width + 'px');
$(obj).resizable();
});
});
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-handle {
position: absolute;
z-index: 99999;
display: block;
}
.ui-icon-gripsmall-diagonal-se {
background-position: -64px -224px;
}
.ui-icon {
background-color: lightgray;
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
.ui-icon:before {
content: '';
position: absolute;
top: 0;
left: 0;
border-top: 12px solid white;
border-right: 12px solid lightgrey;
width: 0;
}
@dudelis
Copy link
Author

dudelis commented Nov 28, 2017

capture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment