Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<title>SimpleModal</title>
<style>
.simplemodal-overlay {background:#000;}
.simplemodal-container {background:#fff; border:3px solid #ccc; padding:8px; height:300px; width:400px;}
.modal {display:none;}
</style>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src='https://simplemodal.googlecode.com/files/jquery.simplemodal.1.4.4.min.js'></script>
</head>
<body>
  
<a href='#' id='first'>Open</a>
  
<div id='first-modal' class='modal fade'>
  <h1>First</h1>
  <p>
    <a href='#' id='second' class='link'>Open Second</a>
  </p>
  <p>
    <a href='#' class='simplemodal-close'>Close</a>
  </p>
</div>
  
<div id='second-modal' class='modal fade'>    
  <h1>Second</h1>
  <p>
    <a href='#' id='first' class='link'>Open First</a>
  </p>
  <p>
    <a href='#' class='simplemodal-close'>Close</a>
  </p>
</div>
  
</body>
</html>
  
 
jQuery(function ($) {
  // callback function
  function modalOnShow(dialog) {
    var s = this; // refers to the simplemodal object
    $('.link', dialog.data[0]).click(function () { // use the modal data context
      
      var id = '#' + this.id + '-modal'; // dynamically determine the modal content id based on the link id
      console.log(id);
      s.close(); // close the current dialog
      
        $(id).load('http://test.monde.com.pl/bh/sprzedaz/').modal({
          overlayClose: true,
          onShow: modalOnShow
  
        });
      
      //return false;
    });
  }
  
  $('#first').click(function () {
    // open the initial dialog
    $('#first-modal').modal({
      overlayClose: true,
      onShow: modalOnShow
    });
    return false;
  });
  
});
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers