0
Welcome Guest! Login
0 items Join Now

Mootools+Slider+Cookie = td.right issue in FF - HELP!!

  • Mootools+Slider+Cookie = td.right issue in FF - HELP!!

    Posted 17 years 6 months ago
    • I wasn't sure where to post this.

      I am playing with mootools and I successfully achieved my goal of a collapseable td.right in IE6 and IE7 however Firefox is has an issue with the mootools slider and td's and tr's collapseing. (sorry for any spelling errors the spell isn't working)

      Firefox shows the td.right no matter what state the slider is in because of the mosCountModule rule.
      MooTools forum people say the answer is to wrap the table with a div. I have tried all sorts of table variations and a pure div'ed index - css variation with no luck with firefox.

      SO...
      Since Firefox is strictly following the mosCountModules rule...
      What I am thinking is to use a get.cookie if statement instead of the the mosCountModules 'right' rule.
      "That way the td.right will be dependent on the cookie value and not whether a module is published in that position."

      But HOW?
      I have tried many "if" get.cookie and isset(cookie variations to no avail. I DON'T KNOW THE PROPER SYNTAX to achieve this goal.
      HELP I NEED A COOKIE MONSTER!!!
      This is purely a test, so no grades on layout, messy index or bloated .js---Please.

      LINK:
      **IMPORTANT** "Slider control for the td.right is on the RT control panel up top"

      http://www.testsite01.mecleary.com/
      • look with IE and all is good the cookie holds it's value and the the td.right is either opened or closed. YEAAHH!
      • look with FF the toggle behaves strangly when the cookie value is closed, it shows the td.right with body-bg.png hogging the screen real estate. BOOO!!!

      Much thanks in advance to anybody that can help with ?php if get.cookie "value=XYZ" syntax,
      McMasters

      Area of body - index - I would like to change from mosCoutModules to "if cookie = somevaluehere" rule...
      (use "if" "cookie value= something" rule here instead of MosCountModules)
      <?php if(!$editmode and (mosCountModules('right') or ($sidenav and $menu_side == 'right'))) : ?> 
           <td class="right">
                                    
           <?php if($sidenav and $menu_side == 'right') : ?>
      &nbsp; &nbsp; <div id="vert-menu">
      <?php echo $sidenav; ?>
           </div>
            <?php endif; ?>
      <div id="toggle2" >
      </div>
      <div id="test2">
      <?php mosLoadModules('right', -2); ?>
      </div>
      </td>
      <?php endif; ?>



      Script used for mootools slider and cookie in header:
      <script type="text/javascript">
      window.addEvent('domready', function(){ 
           //just an habit, not necessary but i make less mistakes this way than when using $ or $$ each time... always end forgetting a ' somewhere :)
           var toggle2 = $('toggle2');
       
           var mySlide2 = new Fx.Slide('test2', {
                mode: 'horizontal', duration: 500, //transition: Fx.Transitions.Bounce.easeOut,&nbsp; //i let you add the other options, let's just concentrate on that cookie issue, don't need mode: vertical, it's the default mode
                onComplete: function(){
                     if(this.wrapper.offsetWidth != 0) {
                          Cookie.set('toggleState', 'opened',&nbsp; {path: "/"});
                     }
                     else {
                          Cookie.set('toggleState', 'closed', {path: "/"});
                     }
                }
           })
           
           //here you check existence and value of 'toggleState' in a cookie
           if ( (Cookie.get('toggleState')) && (Cookie.get('toggleState') == 'opened') ) {
                mySlide2.show();
           }
           else {
                mySlide2.hide();
           }
           //here is you simple toggling link click event
           toggle2.addEvent('click', function(e){
                e = new Event(e).stop();
                mySlide2.toggle();
           });
       
      });
           
      </script>
    • Who is John Galt?

Time to create page: 0.046 seconds