Skip to content

Instantly share code, notes, and snippets.

View lizardking8610's full-sized avatar

Robert lizardking8610

View GitHub Profile
@lizardking8610
lizardking8610 / mobile_hide_show.css
Created June 3, 2017 03:32
Mobile Hide and Mobile Show
.mobile-hide {
visibility: hidden;
clip: rect(0px, 0px, 0px, 0px);
position: absolute;
display: none;
}
@media only screen and (min-width: 800px) {
.mobile-hide {
visibility: visible;
@lizardking8610
lizardking8610 / stitched-border.css
Last active May 31, 2017 03:16
stitched border
.stitched {
padding: 20px;
margin: 10px;
background: #67bbab;
color: #fff;
font-size: 21px;
font-weight: bold;
line-height: 1.3em;
border: 2px dashed #fff;
@lizardking8610
lizardking8610 / media-queries.css
Created May 26, 2017 01:00 — forked from hemantajax/media-queries.css
Very useful media queries snippets
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@lizardking8610
lizardking8610 / DynamicQuiz.css
Created May 19, 2017 07:29
JavaScript: Dynamic Quiz
body {
font-family: Open Sans;
}
h1 {
text-align: center;
}
#title {
text-decoration: underline;
@lizardking8610
lizardking8610 / accordion.js
Created May 18, 2017 18:04
jQuery: multiple accordions on 1 wordpress page
jQuery( function($) {
$( "#accordion:nth-child(1n)" ).accordion({
collapsible: true,
active: false,
heightStyle: "content"
});
} );
@lizardking8610
lizardking8610 / partialpagerefresh.js
Created May 18, 2017 17:27
jQuery: partial page refresh
$('#button1').click(function() {
var url = "http:www.your-url.com?ID=" + Math.random(); //create random number
setTimeout(function() {
$("#elementName").load(url+" #elementName>*","");
}, 1000); //wait one second to run function
});
@lizardking8610
lizardking8610 / notpresentLoad.js
Created May 18, 2017 17:09
jQuery: if not present then load jQuery
//using async loading
// Only do anything if jQuery isn't defined
if (typeof jQuery == 'undefined') {
if (typeof $ == 'function') {
// warning, global var
thisPageUsingOtherJSLibrary = true;
}
function getScript(url, success) {
@lizardking8610
lizardking8610 / konami.js
Created May 18, 2017 17:07
jQuery: Konami code easter egg
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ) {
$(document).unbind('keydown',arguments.callee);
@lizardking8610
lizardking8610 / addremovehover.js
Created May 18, 2017 16:50
jQuery Add/Remove Class on Hover
$('#elm').hover(
function(){ $(this).addClass('hover') },
function(){ $(this).removeClass('hover') }
)
@lizardking8610
lizardking8610 / roundedButton.css
Created May 18, 2017 16:45
Rounded Buttons with CSS effects
.hvr-grow-shadow {
box-shadow: 0px 0px 1px transparent;
display: inline-block;
transform: perspective(1px) translateZ(0px);
transition-duration: 0.3s;
transition-property: box-shadow, transform;
vertical-align: middle;
}
.hvr-grow-shadow:hover,