I'm using mootools-core-1.3.2.js to hide/show a div tag.
Now what I want to do is :
* slide the div tag away (done and works);
* get the value from the "horizontal_status" and put in in PHP var to toggle something else

Here's the javascript code:

<script type="text/javascript">
  window.addEvent('domready', function() {

  var status = {
    'true': 'open',
    'false': 'close'
  };

  // -- horizontal
  var myHorizontalSlide = new Fx.Slide('site_layout_sidebar', {mode: 'horizontal'});

  $('h_slidein').addEvent('click', function(event){
    event.stop();
    myHorizontalSlide.slideIn();
  });

  $('h_slideout').addEvent('click', function(event){
    event.stop();
    myHorizontalSlide.slideOut();
  });

  $('h_toggle').addEvent('click', function(event){
    event.stop();
    myHorizontalSlide.toggle();
  });

  $('h_hide').addEvent('click', function(event){
    event.stop();
    myHorizontalSlide.hide();
    $('horizontal_status').set('text', status[myHorizontalSlide.open]);
  });

  $('h_show').addEvent('click', function(event){
    event.stop();
    myHorizontalSlide.show();
    $('horizontal_status').set('text', status[myHorizontalSlide.open]);
  });

  // When Horizontal Slide ends its transition, we check for its status
  // note that complete will not affect 'hide' and 'show' methods
  myHorizontalSlide.addEvent('complete', function() {
    $('horizontal_status').set('text', status[myHorizontalSlide.open]);
  });
 
});
  </script>

How do I get the $('horizontal_status') into a PHP var so that I can do something with that?

Thanks in advance

u can skip the post above. I just want to change the page layout based on a checkbox (toggle)switch.

When the checkbox is ON (checked) it should display 2 div tags :
#site_content
#site_sidebar

When the checkbox is OFF (unchecked) it should only display 1 div :
#site_fullcontent

How do I do this without posting the form? with AJAX?

thanks in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.