www.webdeveloper.com
Results 1 to 2 of 2

Thread: need to fix a problem

  1. #1
    Join Date
    Dec 2010
    Location
    Romania
    Posts
    27

    need to fix a problem

    Hello,
    I have a Mootools accordion. The code is the following:
    Code:
    <script type="text/javascript">
    window.addEvent('domready', function() {
    	var myAccordion<?php echo $uniqid; ?> = new Accordion($('accordion_sp1_id<?php echo $uniqid; ?>'), '.toggler', '.sp_inner', {
    		opacity: false,
    		onActive: function(toggler, sp_inner){
    			toggler.addClass('active');
    		},
    		onBackground: function(toggler, sp_inner){
    			toggler.removeClass('active');
    		}
    	});
    });
    </script>
    <div id="accordion_sp1_id<?php echo $uniqid; ?>" class="accordion_sp1_id<?php echo $uniqid; ?>">
    	<?php foreach ( $list as $row ){ ?>
    		<div class="toggler">
    			<span><span><?php echo $row->title; ?></span></span>
    		</div>
    		<div class="clr"></div>
    		<div class="sp_inner">
    			<?php echo $row->introtext; ?>
    		</div>
    	<?php } ?>
    </div>
    I need that acordion to have the default position with all those rows closed.
    Now, I have a row active by default.Plus that, I want that the clicked row (despite that is active row) to be colapsed.
    How can I make these issues ?

    Thanks,

  2. #2
    Join Date
    Dec 2010
    Location
    Romania
    Posts
    27
    I found it....
    It must be added the following properties:
    Code:
    <script type="text/javascript">
    window.addEvent('domready', function() {
    	var myAccordion<?php echo $uniqid; ?> = new Accordion($('accordion_sp1_id<?php echo $uniqid; ?>'), '.toggler', '.sp_inner', {
    		opacity: false,
    		/* begin update */
                              display:-1,
                              alwaysHide:true,
                              /* end update */
                              onActive: function(toggler, sp_inner){
    			toggler.addClass('active');
    		},
    		onBackground: function(toggler, sp_inner){
    			toggler.removeClass('active');
    		}
    	});
    });
    </script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles