I am looking to achieve something like facebook post text box as shown in the gif link.
https://media.giphy.com/media/3oz8xCPR8uJyqZv7Gw/source.gif
When the user clicks on the text input, the dialog style emphasis is given on the textbox with options enabled below the textbox.
Best Way to achieve this is,
1) Create a listener on the text box.
2) Listener fires on focus event and creates an overlay box.
3) The overlay focus get the calc height of previous one.
4) Place it with absolute position
Done.
Looks eazy. On click there is some extra class added to this box, which is changing position to fixed or absolute + some div with black overlay is displayed under it.
Very simple example:
$('textarea').on('focus', function(){
$('#textarea-holder').addClass('on-top');
$('#black-background').fadeIn(100);
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.