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 999601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:22:48+00:00 2026-05-16T07:22:48+00:00

Now this question has been asked before but I am not able to get

  • 0

Now this question has been asked before but I am not able to get the answer. I have a Lavalamp with 4 LI inside it, clicking on each of them loads some content in a div.

It works all fine. Now I have a hyperlink somewhere on the same page outside of that lavalamp. I want that, when I click on that link, the lavalamp highlight should move to a particular li and remain there.

To make myself clear, I have a Lavalamp LI that goes like this: Home, Work, About, Contact. And I also have a ‘contact’ link somewhere on the page. When I click ‘contact’ link, the lavaLamp should move the highlight from wherever it is to the 4th option ‘Contact’.

  • 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-16T07:22:49+00:00Added an answer on May 16, 2026 at 7:22 am

    If you are using this lavalamp plugin, you’ll need to use trigger() to activate the mouseenter and click events… here is a demo.

    HTML

    <ul id="menu">
     <li><a href="#home">Home</a></li>
     <li><a href="#work">Work</a></li>
     <li><a href="#about">About</a></li>
     <li><a href="#contact">Contact</a></li>
    </ul>
    <br>
    <a class="contact" href="#contact">contact me!</a>
    

    Script

    $(document).ready(function(){
     $('ul#menu').lavaLamp();
     $('.contact').click(function(){
      $('#menu a[href*=contact]').parent().trigger('mouseenter').trigger('click');
      return false; // added to prevent propogation
     });
    });
    

    LOL, ok, since you are using the other lavalamp plugin… here is the code you can use. Also, since the lavaplamp plugin provides a click function, I have made the javascript unobtrusive by adding the function there (new demo).

    HTML

    <ul class="lavalamp">
     <li class="current"><a href="#home">Home</a></li>
     <li><a href="#work">Work</a></li>
     <li><a href="#about">About</a></li>
     <li><a href="#contact">Contact</a></li>
    </ul>
    
    <br><br><br>
    
    <div id="home" class="info">
     Home page stuff goes here.
    </div>
    <div id="work" class="info">
     Work information goes here.
    </div>
    <div id="about" class="info">
     About me.
    </div>
    <div id="contact" class="info">
     Contact me.
    </div>
    
    <br><br><br>
    
    <div class="links">
     You can see my <a href="#work">work</a> or <a href="#contact">contact me.</a>
    </div>
    

    Script

    $(function() {
     // set up lavalamp
     $(".lavalamp").lavaLamp({
      fx: "backout",
      speed: 700,
      click: function(event, menuItem) {
       // change information box
       var $block = $( $(menuItem).find('a').attr('href') );
       $('.info').not($block).hide();
       $block.fadeIn();
       return false;
      }
     });
    
     // initialize information box
     $('.current').trigger('click');
    
     // make links outside of the lavalamp work
     $('.links a').click(function(){
      var block = $(this).attr('href');
      $('.current').removeClass('current');
      $('.lavalamp').find('a[href=' + block + ']').parent().trigger('click');
     });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, apologies if this question has been asked before but I couldn't find
So, if this question has been asked before, I'm sorry. I'm not exactly sure
First of all I'm sorry if you feel this question has been raised before,
This question has been answered. I've improved the code a bit (at least I
Ok, This question is not exactly a programming question but this is what can
This question sort of covers both ServerFault.com and here, but this seems more programming
I am trying to do something similar to what the person in this question
I have a gridview which is bound to a DataTable. When I try to
Disclaimer Please don't just vote to close this because the title looks subjective, and
class TimeObject { DateTime time; bool isMatinee; } Given: {8:00, 9:30, 11:00, 12:10, 2:00,

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.