Skip to content

Code Snippets

Useful code to copy and paste
  • ALL
  • Drupal 8
  • HTML
  • JavaScript
  • PHP
  • Unity
  • WordPress

Styling a Drupal 8 events “View” page to have thumbnails (CSS)

April 8, 2019 admin Leave a comment

Example:https://cms.staging.uccs.edu/business/business-research-index Configuring the View page: FORMAT: Unformatted listSettings: SHOW: FieldsSettings: FIELDS:Add and organize the following fields as shown in the…

Continue Reading →

Posted in: CSS, Drupal 8 Filed under: CSS, drupal 8

Resize all elements from a class with the tallest one (HTML + JavaScript)

April 1, 2019 admin Leave a comment

Example: CodePen Code: <div class=”myDivClass” style=”border: 5px solid red;”> <h1>DIV 1</h1> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit,…

Continue Reading →

Posted in: Drupal 8, HTML, JavaScript Filed under: Drupal8, html, javascript

Button Styles (HTML + CSS)

March 26, 2019 admin Leave a comment

These are the button styles that our team uses at work, I save them here for an easy copy and…

Continue Reading →

Posted in: Drupal 8, HTML, WordPress Filed under: CSS, drupal 8, html, wordpress

Accordion with effect (HTML + JavaScript)

admin Leave a comment

Example: https://codepen.io/astralmemories/pen/drEypr Code: <style> .ui-accordion-content a:link, .ui-accordion-content a:hover, .ui-accordion-content a:active, .ui-accordion-content a:visited {   color: #428bca; } </style> <link href=”https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css” rel=”stylesheet”>…

Continue Reading →

Posted in: Drupal 8, HTML, JavaScript Filed under: drupal 8, html, javascript

Tabs with fade effect (HTML + Javascript)

admin Leave a comment

Example https://codepen.io/astralmemories/pen/Mxdgoy This code doesn’t work properly in CODEPEN but it will work if you paste it directly to Drupal…

Continue Reading →

Posted in: Drupal 8, HTML, JavaScript Filed under: html, javascript, Tabs

Load another page’s item into a div using jQuery.

December 18, 2018 admin Leave a comment

Load another page’s item into a div using jQuery: <script src=”https://code.jquery.com/jquery-1.10.2.js”> </script> <div id=”PlaceToPutTable”>&nbsp; </div> <script> $(“#PlaceToPutTable”).load(“https://www.uccs.edu/admissions/request #block-uccsbase-home-content”); </script> More…

Continue Reading →

Posted in: Drupal 8, HTML, jQuery Filed under: drupal 8, html, jQuery

Add more height to an Input element using Javascript

July 16, 2018 admin Leave a comment

Add more height to an Input element using Javascript: <input type=”text” id=”charAndSymbolsInput” style=”height: 60px; font-size: 20px; line-height: 60px;”> <button type=”button”…

Continue Reading →

Posted in: HTML, JavaScript Filed under: html, javascript

Insert HTML before element in JavaScript

admin Leave a comment

With this method (supported by all major browsers, including IE 4), you can take an arbitrary HTML string, and insert…

Continue Reading →

Posted in: Drupal 8, HTML, JavaScript, WordPress Filed under: drupal 8, html, javascript, wordpress

Replace the contents of an HTML element (HTML + JavaScript)

June 15, 2018 admin Leave a comment

Setting the value of innerHTML lets you easily replace the existing contents of an element with new content. For example,…

Continue Reading →

Posted in: Drupal 8, HTML, JavaScript, WordPress Filed under: drupal 8, html, javascript, wordpress

Replace all occurrences of a string (HTML + JavaScript)

May 23, 2018 admin Leave a comment

<script type=”text/javascript”> /* Define function for escaping user input to be treated as a literal string within a regular expression…

Continue Reading →

Posted in: HTML, JavaScript Filed under: html, javascript

Post navigation

Page 2 of 3
← Previous 1 2 3 Next →

Categories

  • Bash
  • C#
  • CSS
  • Drupal 8
  • Drush
  • HTML
  • JavaScript
  • jQuery
  • PHP
  • Raspbian
  • Terminal
  • Uncategorized
  • Unity
  • WordPress
  • ALL
  • Drupal 8
  • HTML
  • JavaScript
  • PHP
  • Unity
  • WordPress
Copyright © 2021 Code Snippets — Escapade WordPress theme by GoDaddy