$('.carousel[data-type="multi"] .item').each(function(){ var next = $(this).next(); if (!next.length) { next = $(this).siblings(':first'); } next.children(':first-child').clone().appendTo($(this)); for (var i=0;i<1;i++) { next=next.next(); if (!next.length) { next = $(this).siblings(':first'); } next.children(':first-child').clone().appendTo($(this)); } }); if ($('#back-to-top').length) { var scrollTrigger = 100, // px backToTop = function () { var scrollTop = $(window).scrollTop(); if (scrollTop > scrollTrigger) { $('#back-to-top').addClass('show'); } else { $('#back-to-top').removeClass('show'); } }; backToTop(); $(window).on('scroll', function () { backToTop(); }); $('#back-to-top').on('click', function (e) { e.preventDefault(); $('html,body').animate({ scrollTop: 0 }, 1200); }); } $("#ToHIW").click(function() { $('html, body').animate({ scrollTop: $("#HIW").offset().top-130},1200); event.preventDefault(); }); $("#ToLearn").click(function() { $('html, body').animate({ scrollTop: $("#LearnSection").offset().top-100},1200); event.preventDefault(); }); document.getElementById('MoreBTN').onclick = duplicate; var i = 0; var original = document.getElementById('uploadCert'); function duplicate() { var clone = original.cloneNode(true); // "deep" clone clone.id = "uploadCert" + ++i; // there can only be one element with an ID original.parentNode.appendChild(clone); } function newWindow(contentsURL, winName, winProps, width, height) { if (!winName) var winName = "CALCULATOR"; if (!winProps) var winProps = "menubar=0,toolbar=0,resizable=0,location=0,status=0,scrollbars=0"; if (!width) var w = 620; else w = width; if (!height) var h = 400; else h = height; var x = 100; y = 100; var args = "width=" + w + ",height=" + h + "," + winProps + ",screenx=" + x + ",screeny=" + y + ",left=" + x + ",top=" + y; window.open(contentsURL, winName, args); }