Results 1 to 6 of 6

Thread: [2005] Using pop up hover menus

Hybrid View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    [2005] Using pop up hover menus

    Hi!

    On a masterpage I ahve a menu which displays some hyperlinks, and when the user click the hyperlink a dropdown menu appear (a styled div with hyperlinks)

    As they have done this before, they added all thess menu divs at them bottom of the masterpage, and everything worked fine. But now I want to do some refactorying and replace them with a usercontrol and ajax hovermenuextender. I have 3 hyperlinks and 3 div menus, and 3 extenders. Everything works fine except when I add the usercontrol to the masterpage. Then there is a LOT of added empty space because of the content panels for the menus.

    How can I solve this problem? I want the top left menu as a usercontrol, but I don't want the content divs to create empty space between top menu and content. I set the divs to visibility: hidden but this doesn't mean they disappear....

    /Henrik

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Re: [2005] Using pop up hover menus

    An update, I noticed the panel only occupy space until I make it appear for the first time. After that it works perfectly. I used the IE developer toolbar to find out what happens and it looks like this in the attached picture.

    As you can see the div with its menu options is hidden outside what I consider to be the actual content. As soon as I go to the hyperlinkbutton that show the menu, the horizontal scrollbar of the page will disappear and everything is normal.

    Can this have something to do with that I fill the div with values dynamically during page load?

    /Henrik
    Attached Images Attached Images  

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Using pop up hover menus

    When you fill the DIV up how are you hiding them? Is it the codebehind .Visible or is it a CSS display/visible property?

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Re: [2005] Using pop up hover menus

    Hi!

    The div has the style visible: false;

    It should work, but not here

    /Henrik

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Using pop up hover menus

    Try display:none; instead. I believe visible:false; only hides it but doesn't remove it from page layout flow.

  6. #6
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: [2005] Using pop up hover menus

    What I'd suggest doing is a CSS-based popup. You get better control over the styling, and trust me, it's a LOT easier to implement than any of the .NET AJAX controls. Take a quick look at jQuery if you'd like; it makes this kind of stuff much easier, and generally cross-browser compliant as well, but it's not a requirement. CSS tooltips work something as such:

    HTML:
    HTML Code:
    1. <div class="tooltipLink">
    2.     The Finished Product
    3.     <div class="tooltipPopup">
    4.         Demo text inside our wonderful popup. Isn't this cool?<br />
    5.         It even handles <a href="http://www.google.com">links</a>!
    6.     </div>
    7. </div>

    CSS:
    CSS Code:
    1. .tooltipLink {position:relative; float:left; cursor:pointer; color:#335599;}
    2. .tooltipLink .tooltipPopup {position:absolute; display:none; left:20px; top:14px; width:200px; padding:3px; background-color:#ddd; border:solid 1px #a2bEd7; color:#000000;}
    3. .tooltipLink:hover .tooltipPopup {display:block;}

    Full explanation is provided here. It's a block-level element positioned absolutely to the parent anchor, and therefore the popup itself isn't even part of the flow layout. It stays out of the way, and works fine in any browser. Throw in a bit of jQuery to add fancy animations to it or what have you... adding an AJAX callback to retrieve data to display in the popup wouldn't be that difficult either. Either way, it's cross-browser functional, doesn't break flow layout, and is extremely customizable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width