Created
May 1, 2016 20:12
-
-
Save khazelton77/2a08831d3d25cc78519fefe833dd0027 to your computer and use it in GitHub Desktop.
Object literal, this keyword
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
(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk')); | |
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs'); | |
$(document).ready(function() { | |
// Smooth Scrolling // | |
var $root = $('html, body'); | |
$('.navbar-nav a').click(function() { | |
var href = $.attr(this, 'href'); | |
$root.animate({ | |
scrollTop: $(href).offset().top | |
}, 500, function () { | |
window.location.hash = href; | |
}); | |
return false; | |
}); | |
// Stellar // | |
$("#about").stellar(); | |
$("#faq").stellar(); | |
$(function() { | |
$("#item1").tooltip(); | |
}); | |
//Tooltip | |
$(function () { | |
$('[data-toggle="tooltip"]').tooltip(); | |
}); | |
$("#message-box").on("keyup", function() { | |
console.log("It works!"); | |
var charCount=$("#message-box").val().length; | |
console.log(charCount); | |
$("#char-count").html(charCount); | |
if (charCount > 50) { | |
$("#char-count").css("color", "red"); | |
} else { | |
$("char-count").css("color", "black"); | |
}; | |
}); | |
//Works Section // | |
for(var i = 0; i < works.length; ++i) { | |
$("#work").append("\ | |
<div class='col-sm-3 col-md-3'>\ | |
<a href='#' class='work-img'>\ | |
<img class='img-responsive' src='" + works[i].pic + "'>\ | |
<span class='info'><p class='proj-title'>Title:</p> [Works] </span>\ | |
</a>\ | |
</div>\ | |
"); | |
}; | |
$(".work-img").mouseenter(function() { | |
$(".info", this).show(); | |
}); | |
$(".work-img").mouseleave(function() { | |
$(".info", this).hide(); | |
}) | |
//Textarea background color// | |
$("#message-box").css("background-color", "#b3ffb3"); | |
//Message Box Comment // | |
$("#contact-button").on("click", function() { | |
var comment=$("#message-box").val(); | |
console.log(comment); | |
$("#visible-comment").html("Thank you for commenting!"); | |
$("#message-box").hide(); | |
return false; | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment