Forum Index

No notifications
Notifications

Favorites

No favorites found
Ask the community Need help to achieve something? - Ask the Community
Subscribe to post
User avatar
Arun Murthy - (18/11/2016 09:21:49)
What happen in the background after a button click?

Hi,

I am trying to create a pop up using placeholder by CSS. I already successfully made the show/hide function. When the webpage is scrolled the pop up will follow. Then problem is when I click a button inside a placeholder which does nothing, the whole CSS value is reset back to the one I set. Example is i scroll down at the end of the page, press a button, the pop up will go back to the top, but my view is still at the bottom of the page.

I already try using the $(window).scroll(function() {}); functions. This only help if the user scroll the wheel.

I also try the .ready, .load, but no success because I cannot detect an event on the button click.

the scripts i use is below:

$(function(){
    updatePopup();
});

$(window).resize(function(){
    updatePopup();
}).resize();

$(window).scroll(function() {
    updatePopup();
});

function updatePopup() {
    var windowHeight = $(window).height();
    $(".kk_Popup_Style1").css("height", windowHeight);
    
    var scrollPos = $(window).scrollTop();
    $(".kk_Popup_Style1").css("top", scrollPos);
}

 

RSS Feed