Forums

Mootools css effect not working (1 post)

  1. aneesuddin
    Member
    Posted 8 months ago #

    Chaps and Chapettes

    I'm having this problem right now.

    I have a very basic mootools function that increases the height of a div with hidden overflow to reveal some content.

    My mootools effect works without error on a static version and not at all on the wordpress version even though I have enqueued the scripts correctly and am not running any other scripts. It doesn't even render any errors. i am at a loss!

    This is how I am referencing the mootools libraries:

    <?php wp_enqueue_script('mootools', get_bloginfo('template_directory') .'/js/mootools/mootools.js' , 'false' , '1.2.0'); ?>
    <?php wp_enqueue_script('filterExpand' , get_bloginfo('template_directory') .'/js/mootools/filterExpand.js' ,  array( 'mootools' ) , '1.2.0'); ?>
    <?php wp_head(); ?>

    This is the expand function:

    window.addEvent('domready', function() {
    	var el = $('myElement');
    
    	var anotherEl = $('FilterElement');
    	// Or we just use Element.morph
    	$('maximizeFilterElement').addEvent('click', function(e) {
    		e.stop();
    		// Changes the element's style to .myClass defined in the CSS
    		anotherEl.morph('.filterElementMax');
    	});
    
    	$('minimizeFilterElement').addEvent('click', function(e) {
    		e.stop();
    		// You need the same selector defined in the CSS-File
    		anotherEl.morph('div.filterElementMin');
    	});
    });

    This is the css:

    .filterElementMax
    	{height: 500px;}
    div.filterElementMin
    	{height: 22px;}

    This is the div:

    <div id="FilterElement" class="middle filterElementMin">

    The smarter ones than I amongst you (no doubt, most of you) will be able to spot to cause of the problem. Help!

Reply

You must log in to post.

About this Topic