Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- // tooltip
- $(function () {
- $ ('#ADtag').tooltip();
- });
- $(function () {
- $('[data-toggle="tooltip"]').tooltip();
- });
- //smooth-scrolling
- var $root = $('html, body');
- $('.navbar a').click(function() {
- var href = $.attr(this, 'href');
- if (href != undefined && href != '#') {
- $root.animate({
- scrollTop: $(href).offset().top
- }, 500, function () {
- window.location.hash = href;
- });
- }
- return false;
- });
- //message box
- $('#message-box').css('background-color','#d0e4e8');
- $('#message-box').on("keyup", function() {
- console.log("keyup happened")
- 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','blue')
- };
- });
- //contact submit button action
- $('#contact-submit-button').on('click', function() {
- console.log('clicked');
- return false;
- });
- $('#contact-submit-button').on('click', function() {
- var comment = $('#message-box').val();
- if (comment === ""){
- $('#message-box').css('border', '2px solid red');
- }
- else {
- console.log(comment);
- $('#visible-comment').html('The following comment has been submitted: ' + comment);
- $('#visible-comment').css('text-align', 'center');
- $('#visible-comment').css('text-transform','uppercase');
- $('#message-box').hide();
- $('#contact-name').hide();
- $('#contact-email').hide();
- return false;
- }
- });
- });
Add Comment
Please, Sign In to add comment