0

I have 2 div section one div containing video & other has tabular data. I would like to toggle them in horizontal direction i.e from right to left or vice verse. If video display table div is hide, and if table then video div will hide.

This is working fine in vertical direction.

<div class="option_list">
  <p class="video_head">Video</p>
  <div class="divVideo"> Video frame...</div>
  <p class="table_head">table</p>
  <div class="divtable"> table frame...</div>
</div>

script--

 <script type="text/javascript">
    $(document).ready(function () {
      $(".table_head").click(function () {
      $(".divtable").slideToggle();
      $(".divVideo").hide();
     });
   $(".video_head").click(function () {
    $(".divVideo").slideToggle();
    $(".divtable").hide();
   });
});
</script>

How to toggle this horizontally?

Filburt
  • 17,626
  • 12
  • 64
  • 115
riya
  • 115
  • 2
  • 3
  • 6

1 Answers1

0

You can write it like this

$(document).ready(function () {
      $(".table_head").click(function () {
      $(".divtable").animate({width: 'toggle'});
      $(".divVideo").hide();
     });
   $(".video_head").click(function () {
    $(".divVideo").animate({width: 'toggle'});;
    $(".divtable").hide();
   });
});
Miqdad Ali
  • 6,129
  • 7
  • 31
  • 50
  • tag is horizontally align I want

    tag vertically then on click of p div slides horizontally.

    – riya Jun 12 '12 at 06:35