- This topic is empty.
-
AuthorPosts
-
May 29, 2014 at 1:39 pm #171368
shaneisme
ParticipantI’m a firm believer of taking breaks regularly, but something just happened today that I thought was funny.
In building a responsive website, I was tasked with creating an overlay to play a really short video showing off a feature of one of our new products (sorry for being vague, but it’s not released yet).
Because the image is going to adjust size based on width, as well as height, of the viewport, the overlay had to also react to these changes right away. I started with some really simple JS to force the image’s parent
div
to remain the same size as the image itself so I had a relative container to place the absolutely positioned responsive overlay. I even set the script to run onresize
…I kept thinking to myself, if only I could use a float so the browser would do all this work for me… but damnit, I need to keep this element centered… so off to lunch I go…
In the middle of eating my tostada it comes to me: use
inline-block
you newb!Problem solved, no more JS, no more jankiness… sigh… removed about 15 lines of really badly performing JS with a high overhead all for
display: inline-block
.What problems have you solved recently after a good break?
May 29, 2014 at 1:54 pm #171370Paulie_D
MemberWell there was that World Peace thing…but I had to debug a mess of CSS and by the time I finished…I’d forgotten the answer. :)
A break (actually, I prefer a nap but the boss frowns on me sleeping at my desk..something about ‘client confidence’!) is an ideal way to let your subconcious work on the problem ‘behind the scenes’.
May 29, 2014 at 1:59 pm #171371nixnerd
ParticipantTrue dat homie. Sometimes all you need is a little blood sugar boost. That… and some fresh air.
May 29, 2014 at 6:35 pm #171379__
Participantpower napping is always good. that and walking in the grass in bare feet.
…and, hell yes,
inline-block
is awesome.May 29, 2014 at 6:56 pm #171380nixnerd
Participantpower napping is always good.
I can’t nap. I think there’s something biologically wrong with me.
May 29, 2014 at 11:24 pm #171405__
Participanttry meditation.
May 29, 2014 at 11:31 pm #171406nixnerd
Participanttry meditation.
Something tells me your blood pressure is a lot lower than mine.
May 30, 2014 at 12:40 am #171416__
ParticipantSomething tells me your blood pressure is a lot lower than mine.
probably used to be.
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.