Ask Your Question By Comment We Will Give You Better Solution Soon

Thursday 4 September 2014

Display different div click in php

####################### Just Copy And Past #######################


<div id="nav">
    <a href="#content1">Show 1</a>
    <a href="#content2">Show  2</a>
    </div>

<div id="content1" class="toggle" style="display:none">Show 1</div>
<div id="content2" class="toggle" style="display:none">Show  2</div>

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script>
<script type="text/javascript">
$("#nav a").click(function(e){
    e.preventDefault();
    $(".toggle").hide();
    var toShow = $(this).attr('href');
    $(toShow).show();
});
</script>

No comments:

Post a Comment