TenPixelsLeft TenPixelsLeft
Toggle navigation
  • Magento
  • Code Snippets
    • WordPress Snippets
    • Magento Snippets
    • PHP Snippets
    • HTML Snippets
    • CSS Snippets
    • Javascript Snippets
  • WordPress
  • PHP & MySQL
  • HTML & CSS
  • Javascript
  • Magento
  • Code Snippets
  • WordPress
  • PHP & MySQL
  • HTML & CSS
  • Javascript
TenPixelsLeft ×

Tutorial

Build a Cookie Consent Popup Using JavaScript and a Bootstrap Modal

Published: November 18, 2018 8 Comments

Javascript

Cookie consent plugins are plentiful, a quick google search and you’ll find some JavaScript to pull in via a CDN, a node package to install or a random third party plugin for the platform you’re working within. However I sometimes get rather frustrated when I use an…

Read More
Tutorial

Get the Distance from the Top of an Element to the Top of the Window with Javascript

Published: September 8, 2018 0 Comments

Javascript

Sometimes it can be useful to know what the distance is in pixels, from the top of an element to the top of the window. For example I recently had to integrate an SVG animation into a page, the main feature being the initial animated entrances of the various elements…

Read More
Tutorial

Scale WordPress Images by Adding a CSS Class to All Post Thumbnail and Editor Images

Published: July 16, 2017 0 Comments

Wordpress

With the launch of WordPress 4.4 responsive images were added to the core, enabling developers to introduce responsive image functionality into their themes with greater ease. However, you still need to apply the appropriate CSS rules to those images so that they can…

Read More
Tutorial

Add an ‘active’ Class to the Contacts or a CMS page link in a Magento Custom Navigation Menu

Published: July 13, 2017 0 Comments

Magento

In Magento the only native navigation menu available is the product categories menu renderer, so if you need any other form of navigation you’ll need to build your own.

Read More
Tutorial

Recent

  • Include a CSS Media Query Responsive Breakpoint Debugger in Your Project
  • Build a Cookie Consent Popup Using JavaScript and a Bootstrap Modal
  • Get the Distance from the Top of an Element to the Top of the Window with Javascript
  • Check If a String Is a Valid MySQL Date in PHP
  • Generate Random String for a Given Length in PHP

Most Viewed

  • Build a Cookie Consent Popup Using JavaScript and a Bootstrap Modal 11,526 views
  • Prevent Body Scroll When Positioning a Fixed Element in IOS 11,323 views
  • How to Remove the Yellow Input Background Colour for Chrome Autocomplete 7,443 views
  • Target IE10 or IE11 Using Javascript 3,259 views
  • Set Posts per Page for a Custom Post Type and It’s Taxonomy in WordPress 2,862 views

Tags

  • Snippet15
  • jQuery05
  • Magento 105
  • CSS304
  • Bootstrap04
  • Article04
  • Tutorial04
  • HTML03
  • IE Bugs03
  • Mobile Devices03
  • PHP Helpers03
  • LESS02
  • Media Queries02
  • Mobile First02
  • SEO02
  • SASS02
  • SQL02
  • SVG02
  • Date02
  • Time02
  • Debugging01
  • Breakpoints01
  • Tools & Utilities01
  • Navigation01
  • WP Query01
  • Responsive Images01
  • Responsive01

Sponsored

TenPixelsLeft is designed, developed and written by Dan De Luca | TenPixelsLeft ©2017