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

  • Home
  • SEARCH
  • 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 6885041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:35:06+00:00 2026-05-27T05:35:06+00:00

jQuery(‘ul#reorderps ul ul li’).mouseover( function(){ jQuery(this).css(cursor,pointer); var position= jQuery(this).position(); jQuery(#up).click(function() { alert(‘hey’); }); }

  • 0
jQuery('ul#reorderps ul ul li').mouseover(
    function(){
    jQuery(this).css("cursor","pointer");
    var position=   jQuery(this).position();

        jQuery("#up").click(function() {
            alert('hey');
        });
    }

    );

I expect that it does alerts ‘hey’ one time when i mouseover on that particular element. But it does it for the size of the selected li’s. Whats wrong and how can i resolve it.Actually i have to pick up the element on which the mouse is over when clicking on the up id button.

here is the html snippet its actually i long html so only posting a part.


<ul id="reorderps">
<li>Financial</li>
<ul>
    <li>Hardware</li>
        <ul>
            <li>Product 1</li>
            <li>Product 2</li>
            <li>Product 3</li>
            <li>Product 4</li>
            <li>Product 5</li>
            <li>Product 6</li>
            <li>Product 7</li>
            <li>Product 8</li>
        </ul>
    <li>Software</li>
  • 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-27T05:35:07+00:00Added an answer on May 27, 2026 at 5:35 am

    You are binding a click event on a mouseover event. I think your want this:

    jQuery('ul#reorderps ul ul li').mouseover(function(){
        jQuery(this).css("cursor","pointer");
        var position=   jQuery(this).position();
        alert("MOUSEOVER");
    });
    
    jQuery("#up").click(function() {
        alert('hey');
    });
    

    Now if you click on the div #up, it will alert hey and on the LI mouseover it will say mouseover. If you want to have a click event on an element within the LI’s. Do the following:

    jQuery('ul#reorderps ul ul li').mouseover(function(){
        jQuery(this).css("cursor","pointer");
        var position=   jQuery(this).position();
        alert("MOUSEOVER");
    })
    .find("#up").click(function(){
        alert("hey");
    });
    

    EDITED

    Each LI has a button up and down? Then you can do this

    var lastHoveredLI = null;
    
    jQuery('ul#reorderps ul ul li').mouseover(function(){
        jQuery(this).css("cursor","pointer");
        var position=   jQuery(this).position();
        lastHOveredLI = this;
    });
    
    jQuery("#up").click(function(){
        var li = $(lastHoveredLI);
    });
    
    jQuery("#down").click(function(){
        var li = $(lastHoveredLI);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
jQuery(a).not(div#mnuMain a).live(click, function(event){ event.preventDefault(); alert(yes I got u); }); How to make it work?
jQuery('td[class=bgoff]').each(function() { var td = jQuery(this); ... no apply selector to this only });
jQuery(document).ready(function ($) { $('body').keypress(function (e) { alert(e.which); }); }); This will pop up an
jQuery("body").dblclick(function(event){ var x = event.pageX - this.offsetLeft; var y = event.pageY - this.offsetTop; jQuery("<div></div>").addClass("node").css("position","absolute")
Jquery search by example: <script> $(function() { var availableTags = [ ActionScript, AppleScript, Asp,
jQuery's .each function takes exactly one argument- a function. And yet, In this piece
jQuery: $(#contact-us-form).submit(function () { var nameVal = $(input[name=name]).val(); var companyVal = $(input[name=company]).val(); var titleVal
jQuery(document).ready(function(){ $(function() { $('.button-a').each(function() { $(this).hover( function () { $('.button-title', this).animate({ opacity: 0.6 },
jQuery(function() { jQuery(ul.logos-sprite-icon-wrap li a.logos-icon).hover(function() { jQuery(this).animate({ 'padding-top': '0px', 'padding-bottom': '5px', }, 500); },

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.