Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Sometimes lunch is the answer

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #171368
    shaneisme
    Participant

    I’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 on resize

    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?

    #171370
    Paulie_D
    Member

    Well 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’.

    #171371
    nixnerd
    Participant

    True dat homie. Sometimes all you need is a little blood sugar boost. That… and some fresh air.

    #171379
    __
    Participant

    power napping is always good. that and walking in the grass in bare feet.

    …and, hell yes, inline-block is awesome.

    #171380
    nixnerd
    Participant

    power napping is always good.

    I can’t nap. I think there’s something biologically wrong with me.

    #171405
    __
    Participant

    try meditation.

    #171406
    nixnerd
    Participant

    try meditation.

    Something tells me your blood pressure is a lot lower than mine.

    #171416
    __
    Participant

    Something tells me your blood pressure is a lot lower than mine.

    probably used to be.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Other’ is closed to new topics and replies.