jquery - Two different modals checking with one function -


i looking have multiple modals on site follows:

  1. the first modal have general information them login/register , need display if user anonymous (not logged in) or not have active subscription (even if they're logged in). have flag/check this.

  2. the other modals house youtube videos...

when user clicks on play buttons in grid, call 1 function check flag speaking of. if flag true, appropriate modal popup particular video. if flag false, login/register modal popup.

how can go doing , can please help?

thank in advance!

try thing this. said if flag true trigger second function it's pretty simple need use if else statement.

$(document).ready(function(){    $("#btn").on("click",function(){        //your first module code goes here.        alert('i first.');        secondmodule();    });  });  function secondmodule(){    //your second module code goes here.    alert('i second');  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <button id="btn">click</button>


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -