Problem applying Pop up Jquery on e-commerce platform


I'm working with an e-commerce platform, in this case the integrated store. I have access to include html to customize, but the code is enabled for all pages on the site, is there anything I can do to make it just stay on the home page under the current conditions I'm in?

$(document).ready(function() {

    var maskHeight = $(document).height();
    var maskWidth = $(window).width();



    //Get the window height and width
    var winH = $(window).height();
    var winW = $(window).width();

    $('#dialog2').css('top',  winH/2-$('#dialog2').height()/2);
    $('#dialog2').css('left', winW/2-$('#dialog2').width()/2);


  $('.window .close').click(function (e) {


  $('#mask').click(function () {



Well, the problem was solved without the need to change anything, I managed to put this pop up only on the home via the platform.


Scroll to Top