Last active
October 15, 2016 08:15
-
-
Save tiagodealmeida/d27816b95295ba940a58dcc5cbfbb91a to your computer and use it in GitHub Desktop.
.js for task 2.6
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(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'); | |
(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_GB/sdk.js#xfbml=1&version=v2.8"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk')); | |
$(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 | |
$.stellar(); | |
//tooltips | |
$(function () { | |
$('#item1').tooltip(); | |
}); | |
$(function () { | |
$('[data-toggle="tooltip"]').tooltip(); | |
}); | |
//contact form | |
$("#submitButton").on("click", function () { | |
console.log("clicked"); | |
return false; | |
}); | |
$("#submitButton").on("click", function () { | |
var comment = $("#message-box").val(); | |
$("visible-comment").html(comment); | |
console.log("comment"); | |
$("message-box").hide(); | |
return false; | |
}); | |
//email red background | |
$("#email").css("background", "red"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment