Skip to content

Instantly share code, notes, and snippets.

View nanna-dk's full-sized avatar

Nanna nanna-dk

View GitHub Profile
@nanna-dk
nanna-dk / 23video-events.js
Created October 29, 2020 13:19 — forked from steffentchr/23video-events.js
A sample script for GlueFrame, illustrating how to implement a generic analytics tag, which listens to events from 23 Video player.
(function(){
var identifiedFrames = [];
// Method to run any reporting
var report = function(Player, event, playing, duration) {
Player.get('currentTime', function(currentTime){
Player.get('duration', function(duration){
console.log(event, playing, currentTime, duration);
});
});
@nanna-dk
nanna-dk / gist:6155e15dcf736414f88b37e96890ac59
Created August 23, 2016 18:32 — forked from salcode/gist:6912619
jQuery function to remove all "data-" attributes from a given element
// removes all data attributes from a target element
// example: removeDataAttributes('#user-list');
function removeDataAttributes(target) {
var i,
$target = $(target),
attrName,
dataAttrsToDelete = [],
dataAttrs = $target.get(0).attributes,
dataAttrsLen = dataAttrs.length;