Difference between revisions of "Template:TUDelft/js/script"

Line 12: Line 12:
 
     $("#email").text(sall);
 
     $("#email").text(sall);
 
   });
 
   });
 +
 +
  // removing empty p tages
 +
  $("p").filter( function() {
 +
    return $.trim($(this).html()) == '';
 +
  }).remove()
 +
 +
  // Pop up boxes on menu
 
   $(function () {
 
   $(function () {
 
     $("#contact span").hide();
 
     $("#contact span").hide();
Line 20: Line 27:
 
     });
 
     });
 
   });
 
   });
 +
 
}());
 
}());
 +
 +
// function for copying text to clipboard (used for phone number)
 
function copyToClipboard(element) {
 
function copyToClipboard(element) {
 
   var $temp = $("<input>");
 
   var $temp = $("<input>");

Revision as of 20:00, 26 April 2017

(function () {

 var first = "igem";
 var secon = "tudelft";
 var third = "gmail";
 var forth = "com";
 var all = first + "." + secon + "@" + third + "." + forth;
 var sall = " " + " " + all;
 var ma = "ma" + "il";
 var mm = ma + "to" + ":";
 $(function () {
   $("#mail-button").attr("href", mm + all);
   $("#email").text(sall);
 });
 // removing empty p tages
 $("p").filter( function() {
   return $.trim($(this).html()) == ;
 }).remove()
 // Pop up boxes on menu
 $(function () {
   $("#contact span").hide();
   $("#contact li").hover(function () {
     $(this).find("span").animate({width: 'show'});
   }, function () {
     $(this).find("span").animate({width: 'hide'});
   });
 });

}());

// function for copying text to clipboard (used for phone number) function copyToClipboard(element) {

 var $temp = $("<input>");
 $("body").append($temp);
 $temp.val(element).select();
 document.execCommand("copy");
 $temp.remove();

}