This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// EasingEquations.swift | |
// DrawingGroup | |
// | |
// Created by Lee Brimelow on 6/15/19. | |
// Copyright © 2019 Lee Brimelow. All rights reserved. | |
// | |
import SwiftUI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// DrawingGroup | |
// | |
// Created by Lee Brimelow on 6/12/19. | |
// Copyright © 2019 Lee Brimelow. All rights reserved. | |
// | |
import SwiftUI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.soft-context-menu-glass-pane { | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
z-index: 20000; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----Append some HTML elements---- | |
// jQuery | |
$(document.body).append("<div id='myDiv'><img src='im.gif'/></div>"); | |
// native equivalent (BAD WAY) | |
document.body.innerHTML += "<div id='myDiv'><img src='im.gif'/></div>"; | |
// native equivalent (BEST WAY) | |
var frag = document.createDocumentFragment(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----Get all divs----------------- | |
// jQuery | |
$("div") | |
// native equivalent | |
document.getElementsByTagName("div") | |
//----Get all by CSS class--------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get reference to DOM element | |
var el = document.querySelector(".main-content"); | |
//----Adding a class------ | |
// jQuery addClass | |
$(el).addClass("someClass"); | |
// native equivalent | |
el.classList.add("someClass"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get reference to a DOM element | |
var el = document.querySelector(".main-content"); | |
// set some styles using jQuery.css() | |
$(el).css({ | |
background: "#FF0000", | |
"box-shadow": "1px 1px 5px 5px red", | |
width: "100px", | |
height: "100px", | |
display: "block" |