javascript - Angular Jquery slideToggle/Up popup -
when the green popup open , when click blue 1 closes green , opens blue popup.

the links
<li><a id="contactbtn" class="active" href="javascript: void(0)" ng-click="showform()">kontakt</a></li> <li><a id="facebtn" class="active" href="javascript: void(0)" ng-click="showface()">facebook</a></li> and angularapp
$scope.showform = function () { $('.contactrow').slidetoggle(); }; $scope.closeform = function () { $('.contactrow').slideup(); }; $scope.showface = function () { $('.facebook').slidetoggle(); }; $scope.closeface = function () { $('.facebook').slideup(); }; i have added little bit jquery make lightbox effect
$("#contactbtn, #facebtn").click(function(){ $('#overlay').animate({'opacity':'0.7'}, 300, 'linear'); $('#overlay').css('display','block'); }); $('#closeform, #closeface').click(function(){ $('#overlay').animate({'opacity':'0'}, 300, 'linear', function(){ $('#overlay').css('display','none'); }); }); now there way bind these together, lets open green(lightbox effect animation) decide click on blue removes green window , lightbox effect stays , blue opens , when click blue link again closes+(lightbox).
or i'm making things complicated.
edit : new angularapp
// onclick event handlers $scope.showform = function () { $('.contactrow').slidetoggle(); if($(".facebook").is(":visible")) { $('.facebook').hide(); } }; $scope.closeform = function () { $('.contactrow').slideup(); }; //facebook $scope.showface = function () { $('.facebook').slidetoggle(); if($(".contactrow").is(":visible")) { $('.contactrow').hide(); } }; $scope.closeface = function () { $('.facebook').slideup(); }; when press facebook link once popup opens , when press again lightbox effect made jquery wont go away until press x.
this method other slide toogle.check if form visible or not try this
if($(".contactrow").is(":visible")) { $('.contactrow').hide(); } else { $('.facebook').hide(); $('.contactrow').show(); } you can same facebook class also.check if visible or invisible , act accordingly ..
Comments
Post a Comment