循环通过Jquery函数

时间:2015-04-15 22:42:02

标签: jquery function loops

我有这个脚本:

<script>
$(function() {
// run the currently selected effect
function runEffect() {
  // get effect type from
  var selectedEffect = $( "#Puff" ).val();

  // most effect types need no options passed by default
  var options = {};
  // some effects have required parameters
  if ( selectedEffect === "scale" ) {
    options = { percent: 0 };
  } else if ( selectedEffect === "size" ) {
    options = { to: { width: 200, height: 60 } };
  }

  // run the effect
  $( "#myModal" ).toggle( selectedEffect, options, 500 );
  };

 // set effect from select menu value
 $( "div.notAMember a" ).click(function() {
  runEffect();
  });
  });

  $(function() {
  // run the currently selected effect
  function runEffect() {
  // get effect type from
  var selectedEffect = $( "#Puff" ).val();

  // most effect types need no options passed by default
  var options = {};
  // some effects have required parameters
  if ( selectedEffect === "scale" ) {
    options = { percent: 0 };
  } else if ( selectedEffect === "size" ) {
    options = { to: { width: 200, height: 60 } };
  }

  // run the effect
  $( "#myModalJoin" ).toggle( selectedEffect, options, 500 );
  };

   // set effect from select menu value
   $( "div.registeredMember a" ).click(function() {
  runEffect();
  });
  });

 </script>

它的目的是当一个模态打开并点击其中的一个链接时,模态关闭并显示一个新模态。我想在新模态中单击一个链接,当这样做时,关闭打开模态并再次打开第一个模态。 如何通过单击每个模态上的链接来循环浏览此模态?

0 个答案:

没有答案