javascript - Show popups only once when user logged in -
i working mvc4. in layout page , have popup shows when user logged in.
@if (user.identity.isauthenticated) { <div class="pop-suggest popup_window"> <div class="invite-add"> <a id="popupboxclosead" class="close-popup">x</a> <h4 class="invite-tit">"earn more points, more products!!!"</h4> <div> invite friends</div> </div> </div> }
for close popup use following jquery,
$('.close-popup').click(function () { close_popup(); }); function close_popup() { $('.popup_window').fadeout(500); }
my problem that, after login, popup arrive in every page refresh. how can change code popup div shows when user login , after close not come.
in opionion can create cookie when user log in kind of flag , destroy cookie on log out. doing similar in apps , works great.
Comments
Post a Comment