Skip to content

Instantly share code, notes, and snippets.

@Suzangithub
Suzangithub / Sass: Use @if and @else to Add Logic To Your Styles
Created October 10, 2018 06:41
Sass: Use @if and @else to Add Logic To Your Styles
<style type='text/sass'>
@mixin border-stroke($val) {
@if $val == light {
border: 1px solid black;
}
@else if $val == medium {
border: 3px solid black;
}
@else if $val == heavy {
@Suzangithub
Suzangithub / Sass: Create Reusable CSS with Mixins
Created October 10, 2018 06:21
Sass: Create Reusable CSS with Mixins
<style type='text/sass'>
@mixin border-radius($radius){
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
@Suzangithub
Suzangithub / jQuery: Use jQuery to Modify the Entire Page
Created October 9, 2018 15:20
jQuery: Use jQuery to Modify the Entire Page
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "orange");
$("#left-well").children().css("color", "green");
@Suzangithub
Suzangithub / jQuery: Target the Children of an Element Using jQuery
Created October 9, 2018 15:16
jQuery: Target the Children of an Element Using jQuery
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "orange")
});
@Suzangithub
Suzangithub / jQuery: Clone an Element Using jQuery
Created October 9, 2018 14:59
jQuery: Clone an Element Using jQuery
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
});
</script>
@Suzangithub
Suzangithub / jQuery: Target Elements by id Using jQuery
Created October 9, 2018 14:25
jQuery: Target Elements by id Using jQuery
<script>
$(document).ready(function() {
$("button").addClass("animated bounce");
$(".well").addClass("animated shake");
$("#target3").addClass("animated fadeOut")
});
</script>
<!-- Only change code above this line. -->
@Suzangithub
Suzangithub / Bootstrap: Jquery Playground
Created October 9, 2018 13:58
Bootstrap: Jquery Playground
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
@Suzangithub
Suzangithub / Bootstrap: Use the Bootstrap Grid to Put Elements Side By Side
Created October 9, 2018 10:02
Bootstrap: Use the Bootstrap Grid to Put Elements Side By Side
<div class ="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary">Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info">Info</button>
</div>
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty(checkProp) === true) {
return myObj[checkProp];
<style>
:root {
--penguin-size: 300px;
--penguin-skin: gray;
--penguin-belly: white;
--penguin-beak: orange;
}
@media (max-width: 350px) {
:root {