Skip to content
  • home
  • portfolio
  • web design journal
  • blog
    • adventure
    • san diego
    • urbanity & architecture
    • projects
    • website design
Blog Web Dev Elegantly Run a Function on Window Load or Window Resize

Elegantly Run a Function on Window Load or Window Resize

By Forrest Smith - Drempd.com

Pretty straightforward, but I wanted to run a function on the window load event, or if the page was resized (like resizing page elements). I was originally doing this in two lines of code (one for loading, one for resizing), but wanted something more elegant:

$(window).on('load resize',functionToRun);
Posted on February 27, 2014August 26, 2022 in Web Dev
  • Adventure

    • adventure
    • gravelgrinding
    • hiking
    • running
  • The Built Environment

    • architecture
    • urbanity
  • Locations

    • san diego
    • portland
  • Freelance Life

    • freelancing
    • productivity
  • Web Dev

    • css
    • entrepreneurship
    • git
    • handlebars
    • html
    • inkscape
    • photoshop
    • php
    • sass
    • web design
    • web development
    • saphire

drempd | san diego, ca


home contact

adventures san diego urbanity and architecture projects stream website design

portfolio resume san diego web design freelance web designer

custom web design responsive web design website maintenance