Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If it were me I would use jquery and do something like this:</p> <ol> <li>give an id to div where you're appending ".aberto" like id="content" class="content aberto"</li> <li>Check if the class exists</li> <li>Load the php file you want</li> </ol> <blockquote> <pre><code>if ($('#content').hasClass('aberto')) { $("#some_div_id").load('column-right1.php'); $("#other_div_id").load('column-right2.php'); }else{ $("#else_div_id").load('column-right3.php'); } </code></pre> </blockquote> <p>Adapt it and try it ;)</p> <p>You should start by including a file in your index.php right before closing the tag ... something like:</p> <pre><code>&lt;script type="text/javascript" src="http://www.daterraweb.com/js/onload.js"&gt;&lt;/script&gt; </code></pre> <p>Then in file onload.js you place the code mentioned above... like</p> <pre><code>$(document).ready(function(){ if ($('#content').hasClass('aberto')) { $("#some_div_id").load('column-right1.php'); $("#other_div_id").load('column-right2.php'); }else{ $("#else_div_id").load('column-right3.php'); } } </code></pre> <ol> <li>You should be carefull with the paths for php files</li> <li>You should have all the important divs with the id desired and match it with the jquery code.</li> </ol> <p>NOTE: If you want to load the content right after you insert the .open class you should simply change to something like this:</p> <pre><code> &lt;script type="text/javascript"&gt; $(function() { $('.container h1').bind('click', function() { if ($(this).parent().hasClass('open')) { $(this).parent().find('.content').slideUp(); $(this).parent().removeClass('open'); $("#else_div_id").load('column-right3.php'); return 0; } $(this).parent().parent().find('.content').slideUp(); $(this).parent().find('.content').slideDown(); $(this).parent().addClass('open'); $("#some_div_id").load('column-right1.php'); $("#other_div_id").load('column-right2.php'); }) }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload