This file contains hidden or 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
// Slider script | |
var brandSlider = { | |
sliderContainer: document.getElementById("sliderContainer"), | |
totPagesNum: document.getElementsByClassName("pages").length, | |
pagesStripe: document.getElementById("pagesStripe"), | |
respStripe: function() { | |
this.pagesStripe.style.width = this.totPagesNum * 100 + "%"; | |
}, | |
index: 0, |
This file contains hidden or 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
var payTab = { | |
onlineMethod: document.getElementById("online-method"), | |
offlineMethod: document.getElementById("offline-method"), | |
onlineOption: document.getElementsByClassName("online-option"), | |
offlineOption: document.getElementsByClassName("offline-option"), | |
onlineBtn: document.getElementById("online-radio-btn").getElementsByTagName("ins")[0], | |
toggleOnlineOption: function() { | |
// toggle online options | |
for (var i = 0; i < this.onlineOption.length; i++) { | |
if (this.onlineOption[i].style.display === "") { |
This file contains hidden or 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
// VERSION 1 - Arrays | |
// 1 It should have a place to store todos | |
// 2 It should have a way to display todos | |
// 3 It should have a way to add new todos | |
// 4 It should have a way to change a todo | |
// 5 It should have a way to delete a todo | |
/*-------------------------------------*/ |
This file contains hidden or 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
function openExpTable(evt, tableName){ | |
var tabContent, tabLinks; | |
// get all elements with class="tab-content" and hide them | |
tabContent = document.getElementsByClassName("tab-content-exp"); | |
for (var i = 0; i < tabContent.length; i++) { | |
tabContent[i].style.display = "none"; | |
} | |
// get all elements with class="tab-links" and remove the class "active" |
This file contains hidden or 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
Access the folder through terminal and type: | |
browser-sync start --server --index mysite.html --files="*.html,css/*.css" | |
/usr/bin/env: node: No such file or directory | |
Posted on 2015.12.22 by Tim Habersack | |
If you are getting this error, odds are you are trying to run something nodejs related on a Ubuntu/Debian Linux distro and having problems. | |
I was having this problem, then found this excellent help from StackOverflow: | |
sudo ln -s "$(which nodejs)" /usr/bin/node |
This file contains hidden or 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
// DRY code = don't repeat yourself | |
// WHILE LOOPS | |
// Repeat the code while the condition is true | |
while(someCondition) { | |
// run the code | |
} | |
// Printing n. from 1-5 |
This file contains hidden or 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
// Toggle panel-title arrow script | |
arrowToggle(); | |
function arrowToggle() { | |
var panelTitle = document.getElementsByClassName("panel-title"); | |
var arrowDown = "arrow_drop_down"; | |
var arrowUp = "arrow_drop_up"; | |
for(var i = 0; i < panelTitle.length; i++) { | |
panelTitle[i].addEventListener("click", function() { |
This file contains hidden or 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
<!-- Payment options --> | |
<div id="payment-methods"> | |
<!-- Payment Form --> | |
<form id="paytment-form" action="index.html" method="post"> | |
<!-- Online Payments --> | |
<div id="online-payments" class="payments" > | |
<input type="radio" id="onlinePayInput" name="payment-method" value="bank-A" onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false"> <span class="option">線上付款</span> <br> | |
</div> | |
<!-- Online Payment Methods --> | |
<div id="online-options" style="display: none;"> |
NewerOlder