Height of the div no load

6

How to leave the field 2 divs with the same height as #result4 I gave load ?

<script>
$(document).ready(function() {   
    $( ".buscascript<?php echo "$row[id]"; ?>" ).click(function() {
        $( "#fechargame" ).show();
        $( "#result4" ).show();
        $( "#result5" ).show();
        $( "#result4" ).load( "busca.php?game=<?php echo "$row[id]"; ?>" );
        var altura = $("#result4").height();
        $( "#publicidade1a" ).height(altura);
        $( "#publicidade" ).height(altura);
    });    
});
</script>
    
asked by anonymous 10.04.2014 / 02:23

1 answer

5

Try this:

    <script>
    $(document).ready(function() {
        $( ".buscascript<?php echo "$row[id]"; ?>" ).click(function() {
            $( "#fechargame" ).show();
            $( "#result4" ).show();
            $( "#result5" ).show();
            $( "#result4" ).load( "busca.php?game=<?php echo "$row[id]"; ?>", function(){
                var altura = $("#result4").height();
                $( "#publicidade1a" ).height(altura);
                $( "#publicidade" ).height(altura);
            });
        });
    });
</script>

The function() that is in load is the function that indicates the end of the load executed by load . At this point, you already have the correct height to place in the publicidade1a and publicidade tags.

    
10.04.2014 / 02:30