{"id":14202,"date":"2011-09-06T20:06:33","date_gmt":"2011-09-07T03:06:33","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=14202"},"modified":"2011-09-06T20:06:33","modified_gmt":"2011-09-07T03:06:33","slug":"i","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/selectors\/i\/","title":{"rendered":"I"},"content":{"rendered":"","protected":false},"excerpt":{"rendered":"","protected":false},"author":1036,"featured_media":0,"parent":13708,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"page-almanac-group.php","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":""},"tags":[],"acf":[],"jetpack-related-posts":[{"id":193131,"url":"https:\/\/css-tricks.com\/video-screencasts\/136-moving-things-cms-needed\/","url_meta":{"origin":14202,"position":0},"title":"#136: Moving Things to a CMS as Needed","date":"January 19, 2015","format":false,"excerpt":"In this video, I prattle on about a particular \"real world\" situation I was in involving how I handle the CodePen Meetups page. At the very beginning days of CodePen Meetups, we just had a single one planned. It was to be the first ever CodePen Meetup in Austin, Texas.\u2026","rel":"","context":"With 12 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5088,"url":"https:\/\/css-tricks.com\/snippets\/javascript\/format-currency\/","url_meta":{"origin":14202,"position":1},"title":"Format Currency","date":"December 19, 2009","format":false,"excerpt":"This function will round numbers to two decimal places, and ensure that the returned value has two decimal places. For example 12.006 will return 12.01, .3 will return 0.30, and 5 will return 5.00 function CurrencyFormatted(amount) { var i = parseFloat(amount); if(isNaN(i)) { i = 0.00; } var minus =\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":305227,"url":"https:\/\/css-tricks.com\/snippets\/javascript\/getting-first-and-last-items-in-array-and-splitting-all-the-rest\/","url_meta":{"origin":14202,"position":2},"title":"Getting First and Last Items in Array (and splitting all the rest)","date":"October 30, 2018","format":false,"excerpt":"I\u00a0needed\u00a0to get the first item from an array lately in JavaScript.\u00a0Hmmmm \u2026 lemme think here.\u00a0I remember that\u00a0.pop()\u00a0is for snagging the\u00a0last\u00a0item from the array, like this: const arr = [\"This\", \"Little\", \"Piggy\"]; const first = arr.pop(); console.log(first); \/\/ \"Piggy\" So what\u2019s the opposite of .pop()?\u00a0(Please pause for light web searching\u2026)\u00a0Ah ha!\u2026","rel":"","context":"In \"JavaScript\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4422,"url":"https:\/\/css-tricks.com\/snippets\/jquery\/fit-iframe-to-content\/","url_meta":{"origin":14202,"position":3},"title":"Resize Iframe to Fit Content (Same Domain Only)","date":"January 1, 2010","format":false,"excerpt":"Normally you set and width and height for iframes. If the content inside is bigger, scrollbars have to suffice. The script below attempts to fix that by dynamically resizing the iframe to fit the content it loads. Will resize an iframe like this: \u00a0 View Demo Still problematic... The source\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6581,"url":"https:\/\/css-tricks.com\/snippets\/javascript\/shuffle-array\/","url_meta":{"origin":14202,"position":4},"title":"Shuffle Array","date":"June 13, 2010","format":false,"excerpt":"Technique #1 function Shuffle(o) { for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o; }; Usage var testArray = [1,2,3,4,5]; Shuffle(testArray); \/\/ jQuery to dump out new values to element with ID of 'dump' $(function() {\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":175418,"url":"https:\/\/css-tricks.com\/snippets\/javascript\/loop-queryselectorall-matches\/","url_meta":{"origin":14202,"position":5},"title":"Loop Over querySelectorAll Matches","date":"July 14, 2014","format":false,"excerpt":"Let's look at some options for iterating over a NodeList, as you get back from running a document.querySelectorAll. We've written an updated article about this: A Bunch of Options for Looping Over querySelectorAll NodeLists. Not all browsers support forEach on NodeLists, but for those that do: buttons.forEach((button) => { button.addEventListener('click',\u2026","rel":"","context":"In \"forEach\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/14202"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/1036"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=14202"}],"version-history":[{"count":1,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/14202\/revisions"}],"predecessor-version":[{"id":14203,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/14202\/revisions\/14203"}],"up":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/13708"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=14202"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=14202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}