0

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

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by neocyb
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.