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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:54:56+00:00 2026-05-28T00:54:56+00:00

I dont what is going on but I have this menu set like this

  • 0

I dont what is going on but I have this menu set like this

<div class="indice_item activo">
<div class="indice_item">
<div class="indice_item">
<div class="indice_item">
<div class="indice_item">
<div id="puntero" style="width: 180px; height: 19px; top: 70px; left: 0px; background-color: rgb(10, 173, 247);">&nbsp;</div>

The thing is that the div.puntero is a div that follows the mouse when it hovers over the different indice_item. I do this with jquery and its functions animate.
When the page loads it creates this div.puntero, it looks for the first item of this menu and gets the width and the top and left coordinates, so it can set the div.puntero under the item that has the class activo.

This is the code that does that

/*
 * Seleccionado el primero activo 
 */
$(document).ready(function() {
    $('div.indice_item').last().after('<div id="puntero">&nbsp;</div>');
    //seteamos el puntero donde debe estar
    ancho=$('div.indice_item').first().width()
    alert(ancho);
    $('#puntero').width($('div.indice_item').first().width());
    $('#puntero').height(($('div.indice_item').first().height()+3));
    $('#puntero').css({
        "top"  : $('div.indice_item').position().top,
        "left" : $('div.indice_item').position().left
    });
    $('.indice_item').each(function (){
        //$(this).
    });
});

This works perfectly in firefox, but in chrome I have several problems, it seemed to work correct. But then I pressed reload or F5 and the width of the div.puntero goes crazy.
I added the alert(ancho); for the width and when I go to the page it gives me the correct width 180, and when I press reload 1665 or 1649, of the charts.
Why it is working like that?

  • 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-28T00:54:57+00:00Added an answer on May 28, 2026 at 12:54 am

    Try to set the height and width after everything is loaded, i.e, use $(window).load(function() {//set height and width here});.

    I believe it appears to work fine in firefox because of caching. Maybe I’m wrong, just set-up jsFiddle. It’ll be lot easier to pin-point the issue.

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

Sidebar

Related Questions

I'm going off this great example I found, it works, but when I have
I have this CSS Menu. It's fully functional. But when I put it in
I have a game with menu - level select - game vc I'd like
I have this class: <Serializable()> _ Public Class Bonder ''' <summary> ''' General information
I have the android:cacheColorHint=#00000000 set on my ListView, which fixed this issue in one
I don't know what is going but my jquery validate plugin(1.5.5) is not working
I don't have the slightest idea what's going on here, and Google provides no
I don't know either my implementation have bugs or StringBuilder is going wrong. From
I have a file and I don't know how big it's going to be
I have issues with NSUserDefaults and I don't quite understand what is going on.

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.