Skip to content

Instantly share code, notes, and snippets.

View jimfloss's full-sized avatar

Jim Floss jimfloss

View GitHub Profile
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District of Colombia
FL : Florida
@jimfloss
jimfloss / full-screen-responsive-background-video.html
Last active June 11, 2018 14:28
Full screen responsive background youtube/Vimeo video
<div class="video-wrapper">
<div class="video-foreground">
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php echo get_field('video_id'); ?>?autoplay=1&mute=1&loop=1&rel=0&controls=0&showinfo=0&playlist=<?php echo get_field('video_id'); ?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
</div>
<style>
.video-wrapper {
position: absolute;
width: 100%;
@jimfloss
jimfloss / track-clicks.js
Created June 11, 2018 17:03
Track Clicks
//On Click
var clicks = $(this).data('clicks');
if (clicks) {
$('.opprotunity .content-bottom').slideUp(800);
} else {
$('.opprotunity .content-bottom').slideDown(800);
}
$(this).data("clicks", !clicks);
@jimfloss
jimfloss / js-cookies.js
Created June 14, 2018 15:40
JS Cookies
//JS Cookie CRUD
function getCookie(c_name) {
var c_value = document.cookie;
var c_start = c_value.indexOf(" " + c_name + "=");
if (c_start == -1) {
c_start = c_value.indexOf(c_name + "=");
}
if (c_start == -1) {
c_value = null;
} else {
@jimfloss
jimfloss / responsive-square.html
Created October 8, 2018 17:51
Responsive Squares
<style>
.square {
position: relative;
width: 50%;
}
.square:after {
content: "";
display: block;
padding-bottom: 100%;