Created
March 16, 2018 04:46
-
-
Save ashsaraga/317fea32c8d8d6c066cd359a172d4b08 to your computer and use it in GitHub Desktop.
Toggle focus on target element, get value from input.
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
$(document).ready(function() { | |
whiteRabbit(); | |
madHatter(); | |
marchHare(); | |
function whiteRabbit() { | |
var stopwatch; | |
drinkMe(); | |
} | |
function drinkMe() { | |
stopwatch = setTimeout(function() { $('#Alice').addClass('gardenPath'); }, 500); | |
} | |
function eatMe() { | |
clearTimeout(stopwatch); | |
$('#Alice').removeClass('gardenPath'); | |
} | |
function madHatter() { | |
$('.links__fastlane').hover( eatMe, drinkMe ); | |
$('.links__fastlane').focus( eatMe ); | |
$('.links__fastlane').blur( drinkMe ); | |
$('.links__custom').hover( eatMe, drinkMe ); | |
$('.links__custom').focus( eatMe ); | |
$('.links__custom').blur( drinkMe ); | |
} | |
function marchHare() { | |
var mirror = $('#Haiga'); | |
var teacup = $('.progress__percentage'); | |
var disposition = $(mirror).val(); | |
var earlGrey = disposition / 10000 * 100; | |
$(teacup).text(earlGrey+'%'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment