Skip to content

Instantly share code, notes, and snippets.

@marekdano
Created November 19, 2015 22:43
Show Gist options
  • Save marekdano/b760f22ea67e745c637b to your computer and use it in GitHub Desktop.
Save marekdano/b760f22ea67e745c637b to your computer and use it in GitHub Desktop.
careerfoundry module 4 exercise 1
// twitter follow button
!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
}, 600, function () {
window.location.hash = href;
});
return false;
});
// bootstrap tooltips
$(function () {
$('#portfolio-tooltip, [data-toggle="tooltip"], [rel="tooltip"]').tooltip();
});
// textarea in the submit form
$('.message-box').css('background', 'rgba(255, 255, 255, 0.8)');
// alert message with the input of textarea
$("#button-submit-form").on("click", function() {
console.log("clicked");
var comment = $('.message-box').val();
$('.response-message').empty().append("We have received your message! \"" + comment.toUpperCase() + "\"");
$('.alert-success').show();
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment