Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6343157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:22:56+00:00 2026-05-24T20:22:56+00:00

Using mootools.js 1.3.2 and mootools-more.js As far as I can tell this is supposed

  • 0

Using mootools.js 1.3.2 and mootools-more.js

As far as I can tell this is supposed to reveal the div and also hide the content and linkTab divs at the same time.

$('blogLink').addEvent('click', function(){
 $('homeLink').removeClass('active'); 
 $('linkTab').removeClass('active'); 
 $('blogLink').addClass('active');  
 content.slideOut();
 linkTab.slideOut();
 blogLink.slideIn();
});

This is the HTML

<a href="#" id="blogLink">Blog</a>
<div id="blogContent">
content here
</div>

It all works properly and that’s OK but in addition to this, I also want to be able to give people a URL like http://mysite.com/#blogLink and have that blogContent div opened. When I do that now, it takes me to the top of the page and the blogContent div is hidden.

How do I do achieve that? I did try adding the mootools-smoothscroll.js and using the method outlined here http://davidwalsh.name/smooth-scroll-mootools but that just broke the entire page – would not load properly.

I have zero experience with mootools and weak on Javascript so please excuse me if I take a while to ‘get’ what you’re trying to explain.

Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:22:56+00:00Added an answer on May 24, 2026 at 8:22 pm

    First, are you particularly attached to MooTools? If you’re a JavaScript newbie, jQuery is probably easier to use and definitely has a larger support community. But I’ll post a solution that should work in MooTools for now:

    If I understand you correctly, what you want to achieve is the following:

    • The anonymous function you posted will run when “Blog” is clicked
    • The function will also run if someone visits the page with #blogLink in the URL.

    That’s not too difficult to achieve:

    // Once the DOM has loaded - so that our elements are definitely available
    window.addEvent('domready', function() {
        // Check for #blogLink hashtag, and reveal blog
        if(window.location.hash == 'blogLink') { revealBlog(); }
    
        // Make sure blog is revealed when link is clicked
        $('blogLink').addEvent('click', revealBlog);
    });
    
    function revealBlog() {
        $('homeLink').removeClass('active'); 
        $('linkTab').removeClass('active'); 
        $('blogLink').addClass('active');  
        content.slideOut();
        linkTab.slideOut();
        blogLink.slideIn();
    }
    

    You could also change your link mark-up to:

    <a href="#blogLink" id="blogLink">Blog</a>
    

    To make sure they’re always on the correct link when the blog is revealed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm loading html content via ajax onto a div (using mootools 1.11 and squeezebox,
How can I filter (replace empty() function) in my div container using mootools? Question
Using mootools I have a regex like this: new RegExp('^([^\\D'+ separator +']+)(\\d{2})'); In a
I am using this sliding top panel using mootools (for orientation, the code is
I made a script (using mootools library) that is supposed to overlay an image
I am using Mootools 1.3.1 and I want to animate a div with fx.morph
I am using mootools in one of my webpages. http://www.mstockphoto.net/drsdirect.net/pricing/tooltipsvn.html In this page the
I'm using mootools 1.4.1 and I'm trying to get a div that 'tweens' the
I am using Mootools and I have the following div: <div class=total-title>12</div> I want
Currently I am using Form.Validator from Mootools 1.2.5 and Mootools-More 1.2.5, but i am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.