Tech tedbits

Here are a few things I’ve struggled with this week.

Javascript addEventListener

I tried to implement a simple accordion using some code I found at w3schools but couldn’t get it to work (within WordPress)

I had to resort to using jQuery and finally got the desired result using the following code:

I suspect the issue was either a JS conflict OR the DOM not loading fully when trying to add the EventListener. Note the above script needs to be at the end of the file, after the HTML for the button and panel.

HTML table line-height

This is something I always struggle with – there are many suggestions on how to control the row height within an HTML table out there but many simply don’t work.

This will now be my ‘go-to’ method, calling this function which I customized based on code I found on github:

with following CSS for the table:

#tbl td {   padding:0; margin:0;}#tbl {   border-collapse: collapse;}';

A few small wins

  • An interesting post via Delicious Brains re tmux

    How I Use tmux For Local Development

  • Learned some new nano keystrokes to move a block of text, go to a particular line and search/replace.
    Still hopeless on VIM!

    1. Ctrl+\ Replace a string or a regular expression
    2. Ctrl+_ Go to line and column number
    3. Ctrl+^ Mark text starting from the cursor position (also toggles mark mode off)
  • Killed it when implementing some CSS to display ‘polaroid style’ pics in a recent blog post.

Thrilling, I know!

It’s Friday!

Enjoy your weekend folks. I know I will!

Leave a Reply

Be the First to Comment!

Notify of