• Resolved etespey

    (@etespey)


    I’ve been trying to load a Mootools scrollbar into one of my posts. I copy/pasted the code from another working site into my WordPress post in the html editor. I input the following code into the function and nothing happens:

    function jsplace() {
        echo '<link type="text/css" href="https://espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/mootools/vScrollbar.css"/>
    		  <script type="text/javascript" src="https://espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/mootools/mootools-1.2.4-core.js"></script>
    		  <script type="text/javascript" src="https://espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/mootools/mootools-1.2.4.4-more.js"></script>
    		  <script type="text/javascript" src="https://espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/mootools/Scrollbar.js"></script>
    		  <script type="text/javascript" src="https://espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/webtwoloader.js"></script>';
    }
    
    // Add hook for front-end <head></head>
    add_action('wp_head', 'jsplace');
    
    //strip paragraph tags from markup
    remove_filter('the_content', 'wpautop');

    Here is the link to the web page under the heading Web Plugins:
    Web2.0 Applications>

    All the list items with lorum ipsum text should be contained with a scrollbar beside it.

Viewing 1 replies (of 1 total)
  • Thread Starter etespey

    (@etespey)

    I fixed the problem though I probably didn’t use the best way possible. I had to register and enqueue each script file individually and used absolute urls (relative ones didnt work for some reason). The scripts were placed in my functions.php file like so:

    //CREATE SCRIPTS FOR MOOTOOLS SCROLLBAR
    add_action('wp_enqueue_scripts','mooloader');
    
    function mooloader() {
    	wp_register_script('moomaster','https://www.espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/mootools/mootools-1.2.4-core.js',FALSE);
    
    	wp_register_script('moomore','https://www.espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/mootools/mootools-1.2.4.4-more.js',FALSE);
    	wp_register_script('mooscroll','https://www.espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/mootools/Scrollbar.js',FALSE);
    
    	wp_enqueue_script('moomaster');
    	wp_enqueue_script('moomore');
    	wp_enqueue_script('mooscroll');
    }
    //CREATE STYLE FOR MOOTOOLS SCROLLBAR
    add_action('wp_enqueue_scripts','moostyler');
    
    function moostyler() {
    	wp_register_style('moostyle','https://www.espeykreativedesigns.com/webauthoring/wp-content/themes/pagelines-template-theme/scripts/mootools/vScrollbar.css',FALSE);
    	wp_enqueue_style('moostyle');
    }

    The content for the scrollbar is on the wordpress page at this url https://espeykreativedesigns.com/webauthoring/web-2-0-applications/

Viewing 1 replies (of 1 total)
  • The topic ‘Using Mootools with WordPress’ is closed to new replies.