/* Add custom Js code below */ // create TikTok button element var tiktokBtn = document.createElement("a"); tiktokBtn.id = "tiktok-btn"; tiktokBtn.href = "https://www.tiktok.com/@ecom_sara"; tiktokBtn.textContent = "TikTok"; // add TikTok button to site header document.querySelector(".site-header").appendChild(tiktokBtn); // Show a message bar at the top of the screen to tell the user that something is going on. // hideAfterMS - Optional argument. When supplied it hides the bar after a set number of milliseconds. function AdvancedMessageBar(hideAfterMS) { // Add an element to the top of the page to hold all of these bars. if ($('#barNotificationContainer').length == 0) { var barContainer = $('
'); barContainer.prependTo('body'); var barContainerFixed = $('
'); barContainerFixed.prependTo('body'); } this.barTopOfPage = $('
'); this.barTopOfScreen = this.barTopOfPage.clone(); this.barTopOfPage.css("background", "transparent"); this.barTopOfPage.css("border-bottom-color", "transparent"); this.barTopOfPage.css("color", "transparent"); this.barTopOfPage.prependTo('#barNotificationContainer'); this.barTopOfScreen.appendTo('#barNotificationContainerFixed'); this.setBarColor = function (backgroundColor, borderColor) { this.barTopOfScreen.css("background", backgroundColor); this.barTopOfScreen.css("border-bottom-color", borderColor); }; // Sets the message in the center of the screen. // leftMesage - optional // rightMessage - optional this.setMessage = function (message, leftMessage, rightMessage) { this.barTopOfPage.find('.messageCell').html(message); this.barTopOfPage.find('.leftMessage').html(leftMessage); this.barTopOfPage.find('.rightMessage').html(rightMessage); this.barTopOfScreen.find('.messageCell').html(message); this.barTopOfScreen.find('.leftMessage').html(leftMessage); this.barTopOfScreen.find('.rightMessage').html(rightMessage); }; this.show = function() { this.barTopOfPage.slideDown(1000); this.barTopOfScreen.slideDown(1000); }; this.hide = function () { this.barTopOfPage.slideUp(1000); this.barTopOfScreen.slideUp(1000); }; var self = this; if (hideAfterMS != undefined) { setTimeout(function () { self.hide(); }, hideAfterMS); } } var mBar = new AdvancedMessageBar(10000); mBar.setMessage('يفوتك عرض يوم التاسيس | SA كود خصم', '', ''); mBar.show();