DEV Community

Discussion on: CSS trick: resizing elements without using JS

Collapse
 
jstewart8053 profile image
jstewart8053 • Edited

The resize property is for the user though, not the developer, correct? So there wouldn't be any need to say you can create it without Javascript, right? Am I'm missing the point/helpfulness of this article?

Collapse
 
khuongduybui profile image
Duy K. Bui

Well, I guess before we have this CSS attribute implemented, we would have need to use a mouse event handler on a float control to mimic the native resize behavior.

Collapse
 
mosfa profile image
open

the idea behind that is how as a developer can make a something resizable to the user's by the easiest way.

There are a many ways to do that, but all of them are adding four extra spans as a reference (top left, top right, bottom right, bottom left), and calculate the dimensions... etc etc
but the css way doesn't use any extra elements.
let me tell you the story why i like it.. i'm trying to clone UbuntuDDE desktop as html and css and inside of it i'm also trying to clone the chromium browser (open source alternative of chrome).
and i set the elements resizable use both ways (js and css ) and by the css way it's so smoothly , i don't know if there is somthing about it but it's works just fine for me.

here the js code and compare it with the css ^_^

Collapse
 
jstewart8053 profile image
jstewart8053

Okay, I gotcha now. You were talking about the user. Thats where I was confused at. I probably should stop trying to read after 2am from now on... lol. The resize property is really nice, and a I wish more pages would use it. I'm on my ipad often, so being able to resize comes in handy. Thanks for the clarification 👌

Thread Thread
 
mosfa profile image
open

you're welcome... yep at 2 am you should be in a deep-sleep state 👌 not in dev reading weird things loooool. 🤣

Thread Thread
 
jstewart8053 profile image
jstewart8053

deep dream state... was that a coding pun? 😂😂😂 Very true, and funny!

Thread Thread
 
mosfa profile image
open

by the way i can't following advice, but instead i always insist on giving it to people and friends 🤣🤣, and the proof of that is it's 5am and i'm still awake loool