public marks

PUBLIC MARKS from decembre with tag example

2018

CSS - PRO TIPS - CSS element() function - [: -moz-element()]Vincent De Oliveira

element() brings CSS design to a new level, in an easily way. Few ideas that comes to my mind (some that I've already used since the last 4 years): - when you have to deal with duplicated content in advanced effects - live thumbnails of previous/next slides in a slideshow - live zoom over an image, for example in an e-commerce product page - animated background, using CSS Animations or by referencing a video, canvas or SVG - faking backdrop-filter or filter() - watermark with multiples backgrounds from Lea Verou idea - and anything you’re currently thinking of ;) Few things we can note: - prefixed for now in Firefox: -moz-element() - impact on rendering performance when using multiple reference. Not as bad as CSS filters, but still something you have to consider - there’s a CanIUse support page - Issue Chromium - Issue WebKit - No mention from IE Platform Status

CSS - CODEPEN - COLLECTION - A Look At Pseudo-Elements - a Collection by Franz on CodePen

A Look At Pseudo-Elements This collection contains many examples for different pseudo-elements. All examples were used in episode 15 of !important a show that explores web development through live websites and elegant designs. https://xotv.me/channels/22-important/vod_videos/767-important-slash-slash-episode-fifteen

JAVASCRIPT - IMAGE - LAZY LOAD - Lazy Loading Images? Don’t Rely On JavaScript! | Robin Osborne

(via)
One popular method to deal with this is to “Lazy Load” the images; that is, to only load the images just before the user will need to see them. If this technique is applied to the “above the fold” content – i.e., the first average viewport-sized section of the page – then the user can get a significantly faster first view experience. So everyone should always do this, right? Given the potential limitations, let’s work on a solution that can handle all my concerns: a. works without JavaScript (i.e., lazy loading is an enhancement) b. vanilla js – no dependencies on jquery or angularjs c. works with broken JavaScript (i.e., the browser supports JavaScript, but there’s a js error somewhere which causes your script to break; might not even be your fault!)

CSS - TRICK - :not([class]) - - :not(s) | CSS-Tricks

(via)
Another useful one (especially when setting up defaults that you expect to be overridden by classes) is :not([class]). It only styles the element if it has no classes assigned to it at all. :)

2017

USERSTYLES - EXAMPLE - ss16 a Fresh attempt at (user)styling 4chan.... (2017)

ss16 - a self-centered, fresh attempt at (user)styling 4chan * * created on: February 11th, 2016 * last modified: May 16th, 2017 * 4chan X version: ccd0 1.13.89.3 / https://github.com/ccd0/4chan-x * created by: @saxamaphone69 * (loose) coding style: https://github.com/necolas/idiomatic-css * * in an attempt to make the style as user-friendly as possible, i will * comment most of the css to explain what it all does * * please leave any comments, suggestions, or feedback on github: * https://github.com/saxamaphone69/ss16 * */ /** * this userstyle utilises a lot of best practices * and sensible defaults inspired from a variety of * stylish and modern web frameworks and resources, mainly: * https://github.com/twbs/bootstrap */ /** * first thing we do, is we use web fonts from google! * this is so users aren't required to download fonts prior. * and of course, if you don't want to or don't like it, * delete or change it accordingly. we use roboto, roboto mono, * karla, and material icons. circular has been removed in the production * version of ss16 to not only keep the file size down, but also * to not have a font that i don't own the license for :^) */

JQUERY - CHECK/UNCHEK - Demo in JSFiddle

As per the jQuery documentation there are following ways to check if a checkbox is checked or not. Lets consider a checkbox for example (Check Working jsfiddle with all examples)

JAVASCRIPT - syntax - What does "use strict" do in JavaScript, and what is the reasoning behind it? - Stack Overflow

The statement "use strict"; instructs the browser to use the Strict mode, which is a reduced and safer feature set of JavaScript. List of features (non-exhaustive) Disallows global variables. (Catches missing var declarations and typos in variable names) Silent failing assignments will throw error in strict mode (assigning NaN = 5;) Attempts to delete undeletable properties will throw (delete Object.prototype) Requires all property names in an object literal to be unique (var x = {x1: "1", x1: "2"}) Function parameter names must be unique (function sum (x, x) {...}) Forbids octal syntax (var x = 023; some devs assume wrongly that a preceding zero does nothing to change the number.) Forbids the with keyword eval in strict mode does not introduce new variables Forbids deleting plain names (delete x;) Forbids binding or assignment of the names eval and arguments in any form Strict mode does not alias properties of the arguments object with the formal parameters. (i.e. in function sum (a,b) { return arguments[0] + b;} This works because arguments[0] is bound to a and so on. ) arguments.callee is not supported [Ref: Strict mode, Mozilla Developer Network]

FIR - ADDON - Example extensions - Mozilla | MDN

To help illustrate how to develop extensions, we maintain a repository of simple example extensions at https://github.com/mdn/webextensions-examples. This article describes the WebExtension APIs used in that repository.

jQUERY - JAVASCRIPT - jQuery udraggable Plugin

jquery.udraggable.js This plugin provides an API similar to jQueryUI's draggable but with support for unified mouse and touch events. It builds on Michael S. Mikowski's jquery.event.ue unified event plugin.

html - Draggable div without jQuery UI - Stack Overflow

(via)
Here's another updated code: $(document).ready(function() { var $dragging = null; $('body').on("mousedown", "div", function(e) { $(this).attr('unselectable', 'on').addClass('draggable'); var el_w = $('.draggable').outerWidth(), el_h = $('.draggable').outerHeight(); $('body').on("mousemove", function(e) { if ($dragging) { $dragging.offset({ top: e.pageY - el_h / 2, left: e.pageX - el_w / 2 }); } }); $dragging = $(e.target); }).on("mouseup", ".draggable", function(e) { $dragging = null; $(this).removeAttr('unselectable').removeClass('draggable'); }); });​

jQUERY -JqueryUI - DRAG - JqueryUI Draggable

(via)
$ (selector, context).draggable (options) Method The draggable (options) method declares that an HTML element can be moved in the HTML page. The options parameter is an object that specifies the behavior of the elements involved. Syntax $(selector, context).draggable(options); You can provide one or more options at a time using Javascript object. If there are more than one options to be provided then you will separate them using a comma as follows − $(selector, context).draggable({option1: value1, option2: value2..... });

CSS - CODE EXAMPLE - "Progress bar horizontal" qui varie suivant le scroll

In AlsaCreation : CODE EXAMPLE -" Progress bar horizonta"l qui varie suivant le scroll body { -moz-box-direction: normal; -moz-box-orient: vertical; background: #f3f3f3 none repeat scroll 0 0; color: #000; display: flex; flex-direction: column; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; font-size: 1.6rem; min-height: 100vh; }

jQuery - javascript - JS scrollbar recommendations? - Stack Overflow

by 1 other
I like to use: - Tiny Scrollbar for the minimalist design - JQuery Custom Content Scroller

jQuery - LIBRARY - SCROLL - jQuery custom content scroller – malihu | web design

by 1 other (via)
(Last updated on Jul 11, 2016 ) Highly customizable custom scrollbar jQuery plugin. Features include: - vertical and/or horizontal scrollbar(s) - adjustable scrolling momentum - mouse-wheel (via jQuery mousewheel plugin) - keyboard and touch support - ready-to-use themes and customization via CSS - RTL direction support - option parameters for full control of scrollbar functionality - methods for triggering actions like scroll-to - update, destroy etc - user-defined callbacks and more.....

2016

2015

JQuery - DEMO - arrays - JQuery .each() backwards - Stack Overflow

Here are different options for this: You can use this: $($("ul > li").get().reverse()).each(function (i) { $(this).text( 'Item ' + (++i)); }); ===or==== $($(".block-item").get().reverse()).each(function (i) { $(this).text(++i); });

JAVASCRIPT - DEMO - Maximum Characters for Text and Textarea Form Fields

Enforcing a maximum character length for text and textarea form fields is fairly easy to do.

SCRIPT - Floating Layer At Cursor Position

This post shows how to implement layers that will display content over existing content just below and to the right of the cursor position

GM - firefox - How to alter this javascript with Greasemonkey? - Stack Overflow

On Firefox Greasemonkey, you can do that with the stupefyingly brilliant (^_^) checkForBadJavascripts utility

2014

JAVASCRIPT - TUTO - DEMEO - Web Developer Introduction To Features of JavaScript "Function" Objects

by 1 other (via)
There are several ways to declare a function. All valid, but there are differences on how they're handled in the background.

javascript - Use Greasemonkey to replace links, to images, with images? - Stack Overflow

Replacing links to images is not too hard to do. However, I recommend that you keep the link but display the picture inside it. This is so you can click through if something goes wrong. For example, that sample page you gave has most of the linked images on a dead site. Other linked images only look like they point to images or might be blocked for "hot linking". To make the code robust and easy, we use jQuery and waitForKeyElements. Here is a complete working script that delinks the payload image-links on that sample site:

Userstyle - ICON FONT@FACE - Example - Iconset:defaulticon icons | 1 | Iconfinder

(via)
DefaultIcon ver 0.11 by Interactivemania : .h_icn_previous{ background: url(http://cdn1.iconfinder.com/data/icons/defaulticon/icons/png/32x32/media-fast-forward.png) !important; background-size: 27px 17px !important; transform: rotate(180deg) !important; }

Userstyles - font@face EXEMPLE : Stylish pour Deezer | Sans Pseudo Fix

@namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain("deezer.com") { @font-face { font-family: 'Boogaloo'; font-style: normal; font-weight: 400; src: local('Boogaloo'), local('Boogaloo-Regular'), url(https://themes.googleusercontent.com/static/fonts/boogaloo/v3/1x_XysQB9ZwoSzu9a0nb7PesZW2xOQ-xsNqO47m55DA.woff) format('woff'); }