Jump to content

How do you make something grow up?


612wharfavenue

Recommended Posts

You have to move the image upwards as many pixels as it has grown on each time interval. It's probably best to give it a relative position from the top equal to the image's height, then you go decreasing the distance from the top as the image expands.

Link to comment
Share on other sites

Would it not work if you positioned it from the bottom instead? If you specify bottom: 0px; and change it's height will it not expand upwards? I haven't tried it so I could be wrong...EDIT:Turns out it doesn't work like I though it would. The element needs to be positioned absolutely which may or may not be acceptable in your situation.

Link to comment
Share on other sites

Ive ran into another problem, how do i make an element scale in all directions, like it would naturally do?
Hmm... Once the image has loaded you can get the ratio between width and height and store it somewhere, maybe in a property of the image element.As Javascript goes increasing the height, set the width to the height multiplied by the ratio.Something kind of like this:
myImage.onload = function() {  this.ratio = this.width / this.height;}// Each time you increase the height of the image, run this line of code to make the width increase as well:imgObject.style.width = newHeight * imageObject.ratio;

Of course, the whole system requires a bit more work than that, but I hope this is helpful.

Link to comment
Share on other sites

That would alleviate having to define the width as well as the height, but then i would also have to move it top and left to make it appear as if it is expanding from its center. I guess ill have to jump through more hoops because of w3c's bad design.
impressive. not only will you re-write modern programming conventions/paradigms, but perhaps the w3c standards for HTML/CSS? I'm impressed...can't wait to see what you come up with.edit: in hindsight, the topic title is kind of ironic...
Link to comment
Share on other sites

It sounds like the programmers' fault, not the language structure.But getting back to the bad design of this specific feature: Images are sized from the top and left, you wish it was from the bottom and center. Due to the complication of implementing it, it would be highly inconvenient. People read from left to right and from top to bottom, the whole graphic system of computers was designed to work best for this type of distribution because it's the way that most people are expecting it to be.If images expanded from bottom and center, this would imply reserving a space larger than the image currently is and placing the image at the bottom of this space. This also implies internally calculating a center of the width of the previously reserved space on the screen. How would a machine know how large to make the reserved space for your image?

Link to comment
Share on other sites

I'm not saying this should be done differently, im saying the fact that we arent given the option of specifying the behavior of animation when such features wouldnt be beyond that of the existing ones shows how inept the w3c designers are at enabling designers to work intuitively. Maybe you all dont understand what its like to design in actual design programs, but if anything about web design we half as intuitive as it could be it would only take a fraction of the time to do the work as it does now. The fact that anyone would defend the current state of software engineering is baffling, and as for the list of failed software projects, all the bad managment, engineering, and luck couldn't make a dent on the fact that if it werent for software being so unbelievably cumbersome to write, read and maintain that there would never be millions of dollars on the line in the first place. Whatever, go back to making sure there arent any stray .'s in your million lines of code.

Link to comment
Share on other sites

did it ever cross your mind that you are the one coming across as inept? No offense, but whatever argument you are trying to make, you're not making the case well, nor are you giving yourself much reason for people to take you seriously when you make sweeping generalizations, offer criticism that's not constructive, and throw out random facts and figures that you probably don't understand yourself. Do you have extensive experience in the industry? Do you or have you held a (serious) management/engineering/development position within a company? I'm just curious to see what insight you actually bring to the conversation.anyway, good luck with whatever crusade you're on, but I wouldn't expect to get too far with your attitude (unless you like talking to yourself).

Link to comment
Share on other sites

Seriously? How exactly do you think you are supposed to write any program, then? Is the computer supposed to read your mind and know exactly how an application interface should look and behave? Those "million lines of code" define exactly how your app should look and behave. It defines every menu, menu option, toolbar, button, text box, checkbox, and dropdown and what actions happen when the user clicks, hovers, or changes those controls.

Link to comment
Share on other sites

Seriously? How exactly do you think you are supposed to write any program, then? Is the computer supposed to read your mind and know exactly how an application interface should look and behave? Those \"million lines of code\" define exactly how your app should look and behave. It defines every menu, menu option, toolbar, button, text box, checkbox, and dropdown and what actions happen when the user clicks, hovers, or changes those controls.
did it ever cross your mind that you are the one coming across as inept? No offense, but whatever argument you are trying to make, you\'re not making the case well, nor are you giving yourself much reason for people to take you seriously when you make sweeping generalizations, offer criticism that\'s not constructive, and throw out random facts and figures that you probably don\'t understand yourself. Do you have extensive experience in the industry? Do you or have you held a (serious) management/engineering/development position within a company? I\'m just curious to see what insight you actually bring to the conversation.
Who said this was a conversation. I just wanted to see how you, as programmers, would react, and i got it. G\'day :)
Link to comment
Share on other sites

  • 2 weeks later...

It may be a bit late for me to try and answer the original question, but how is the image being positioned in the first place?The default is to be inline with text, in which case expanding up/left wouldn't make any kind of sense.I would think that, in general, setting the text-align of the parent element to center, the line-height to whatever the maximum height of the image might be, and the vertical-align of the image to middle, would achieve what you describe.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...