Reports IDs that are being used by multiple elements within a page, including the number of occurrences of each one
A Pen by Craig Patik on CodePen.
Reports IDs that are being used by multiple elements within a page, including the number of occurrences of each one
A Pen by Craig Patik on CodePen.
Some of these articles may be old but their arguments hold true. In particular, with more and more people relying on flaky, high-latency cellular networks to deliver sites there is possibly even more concern that JS may not work, even in an otherwise capable browser.
| @mixin breakpoint($size: "", $maxWidth: false) { | |
| @if $size == "" { | |
| $size: 20em; // Put your "main" or most-used breakpoint here to use it as a default | |
| } | |
| // Default, `min-width` media query | |
| @if $maxWidth == false { | |
| @media (min-width: $size) { @content; } | |
| } | |
| // Alternative `max-width` media query |
| // Source data (JSON) from the server | |
| data = { | |
| abc: { | |
| def: { | |
| ghi: 'jkl' | |
| } | |
| } | |
| }; | |
| // The path you're looking for (you want the value of `ghi`) |
The popover plugin displays HTML in a container that overlays the page. It is triggered by clicking on a button or other UI element and the container is positioned near the element. The popover can be displayed and hidden at will.
The plugin must be provided with an options object and a jQuery collection of elements.
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>BB6 Collapsible</title> | |
| <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css"> | |
| <script src="http://code.jquery.com/jquery-1.5.min.js"></script> | |
| <script> | |
| $(document).ready(function() { | |
| if (/blackberry/i.test(navigator.platform)) { |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <style> .hidden { display: none; } </style> | |
| <script src="zepto.custom.js"></script> | |
| <script> | |
| $(document).ready(function(e) { | |
| // This should print 2 results: #div3 and #div4 | |
| console.log("visible:", $("div:visible")); |
| // ==UserScript== | |
| // @name Scroll To Heading From Hash | |
| // @author Craig Patik | |
| // @namespace http://github.com/cpatik | |
| // @version 1.0 | |
| // @description Enable jumping to any heading without adding IDs to the heading elements | |
| // @include http://* | |
| // ==/UserScript== | |
| // Site owners can drop the code below into their pages, |
| // @name Enhanced Alpha.App.Net | |
| // @description Image previews, Repost links, and Twitter character count on Alpha.App.Net | |
| // @namespace http://patik.com/code/user-scripts/ | |
| // @include https://alpha.app.net/* | |
| // @version v20120903.1 | |
| // ==/UserScript== | |
| (function _adnenhance_init(win) { | |
| var adnenh = {}; |