Forum Index

No notifications
Notifications

Favorites

No favorites found
Ask the community Need help to achieve something? - Ask the Community
Join the Conversation > Ask the community > What happen in the background after a button click? View modes: 
User avatar
Advanced member
Advanced member
Arun Murthy - 18/11/2016 09:26:55
   
RE:What happen in the background after a button click?

I notice that on the button click, it will submit the form.

I can detect the form submission event by the jquery .submit function.

Then after that, I not sure, as the page is not refresh (i try using .ready and .load) but my css value is reset to default.


User avatar
Advanced member
Advanced member
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);
}

 


1 2
RSS Feed