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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:45:33+00:00 2026-05-24T17:45:33+00:00

I have made menu and centered it using css: margin-left:auto; margin-right: auto; . This

  • 0

I have made menu and centered it using css: margin-left:auto; margin-right: auto;. This menu is made of <a> links with float:left property. In Firefox and Chrome and even IE8 everything is ok – menu is in the center and in one horizontal line. But in IE9 there is problem – last element is 1px lower than rest of menu. It looks like that:
IE9 menu.
In IE7 there is also problem – last element is under the menu:
IE7 menu.

I have tried adding display:inline; and it helped with float – in IE7 and IE9 menu was also looking like it should be. But menu centering was lost – menu was in one line but it was starting from the left in all borwsers that I checked.

There is also Javascript that is adding fade effect to menu items. I think that problem lay within this Javascript.

Code of my menu looks like that:

And css:

    .menu
    {
        background: url('Images/bg.jpg') repeat-x left top;
        height: 73px;
        margin-top: 8px;
    }

    .menu_inner
    {
        margin: 0 auto;
        width: 1001px;       
    }

    .menu_inner a
    {
        float: left;
        padding: 0px;
        margin: 0px;
    }

And Javascript wchich is adding fade effect:

(function ($) {
    $.fn.cross = function (options) {
        return this.each(function (i) {
            // cache the copy of jQuery(this) - the start image
            var $$ = $(this);

            // get the target from the backgroundImage + regexp
            var target = $$.css('backgroundImage').replace(/^url|[\(\)'"]/g, '');

            // nice long chain: wrap img element in span
            $$.wrap('<span style="position: relative;"></span>')
            // change selector to parent - i.e. newly created span
                    .parent()
            // prepend a new image inside the span
                    .prepend('<img>')
            // change the selector to the newly created image
                    .find(':first-child')
            // set the image to the target
                    .attr('src', target);

            // the CSS styling of the start image needs to be handled
            // differently for different browsers
            if ($.browser.msie || $.browser.mozilla) {
                $$.css({
                    'position': 'absolute',
                    'left': 0,
                    'background': '',
                    'top': this.offsetTop
                });
            } else if ($.browser.opera && $.browser.version < 9.5) {
                // Browser sniffing is bad - however opera < 9.5 has a render bug 
                // so this is required to get around it we can't apply the 'top' : 0 
                // separately because Mozilla strips the style set originally somehow...                    
                $$.css({
                    'position': 'absolute',
                    'left': 0,
                    'background': '',
                    'top': "0"
                });
            } else { // Safari
                $$.css({
                    'position': 'absolute',
                    'left': 0,
                    'background': ''
                });
            }

            // similar effect as single image technique, except using .animate 
            // which will handle the fading up from the right opacity for us
            $$.hover(function () {
                $$.stop().animate({
                    opacity: 0
                }, 550);
            }, function () {
                $$.stop().animate({
                    opacity: 1
                }, 550);
            });
        });
    };

})(jQuery);

// note that this uses the .bind('load') on the window object, rather than $(document).ready() 
// because .ready() fires before the images have loaded, but we need to fire *after* because
// our code relies on the dimensions of the images already in place.
$(window).bind('load', function () {
    $('img.fade').cross();
});

Any help here much appreciated!

  • 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-24T17:45:35+00:00Added an answer on May 24, 2026 at 5:45 pm

    There is clearly something wrong with this Javascript.

    Try changing it for something else like: http://bavotasan.com/2010/jquery-simple-animated-fade-effect/

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

Sidebar

Related Questions

I have a menu made with HTML, using a simple UL with lots of
i have made a css sticky footer menu which is working great apart from
please help me with this roll up/down side bar menu. I have made a
I have made a pure CSS dropdown menu for my client. The dropdown menu
I have a vertical menu in my system which is basically made of HTML
I have made a new windows service which works fine using barebone code (just
I have made a Web page using jquery and php where all files are
I have made a simple accordion for my site using jQuery... It worked great,
I've made a very simple dropdown menu using jQuery slideup and slidedown for the
I've made a horizontal menu using a list. I'm trying to get each <li>

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.