DIV / Floating

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeremy

    DIV / Floating

    Hi guys, I have a number of records of data in a table like this:

    Name Telephone
    Fred 01667 887878
    Bill 01667 889901

    etc.

    The Name is defined as a hypertext link to take the user to a person
    details editing screen. No probs so far. On mouseover, I want to display
    the contents of a DIV immediately alongside the name clicked.

    The code I have looks like this so far (for an individual line)

    <A HREF="wd_org.co ntact_maint?p_w eb_site_id=61&p _org_contact_id =2
    &p_org_id=1" onMouseOver="sh ow('cont2')" onMouseOut="hid e('cont2')">
    Jones, Jenny</A>
    <div id="cont2" style="position :absolute; padding:0px; left:200px;
    top:200px; width: 179px; height: 64px; z-index:2; background-color:#
    7eae58; visibility:hidd en">
    <span class="icams-normal-text"><p>Jones</p></span>
    </div>

    The a function hide defined elsewhere which sets the style.visibilit y to
    "visible" and oanother called hide to hide it.

    How can I get the div contents displayed right next to the item the
    mouse is over?




    --

    jeremy
  • Steve Pugh

    #2
    Re: DIV / Floating

    Jeremy <newspostings@h azelweb.co.uk> wrote:
    [color=blue]
    >Name Telephone
    >Fred 01667 887878
    >Bill 01667 889901
    >
    >etc.
    >
    >The Name is defined as a hypertext link to take the user to a person
    >details editing screen. No probs so far. On mouseover, I want to display
    >the contents of a DIV immediately alongside the name clicked.[/color]

    Have you thought about just using the title attribute? Much simpler.
    [color=blue]
    >The code I have looks like this so far (for an individual line)[/color]

    A URL would be useful as your CSS and your JavaScript impact on this.
    [color=blue]
    ><A HREF="wd_org.co ntact_maint?p_w eb_site_id=61&p _org_contact_id =2
    >&p_org_id=1" onMouseOver="sh ow('cont2')" onMouseOut="hid e('cont2')">
    >Jones, Jenny</A>
    ><div id="cont2" style="position :absolute; padding:0px; left:200px;
    >top:200px; width: 179px; height: 64px; z-index:2; background-color:#
    >7eae58; visibility:hidd en">
    > <span class="icams-normal-text"><p>Jones</p></span>
    ></div>[/color]

    <p> is not allowed inside <span>.
    How long are the contents of the div?
    [color=blue]
    >The a function hide defined elsewhere which sets the style.visibilit y to
    >"visible" and oanother called hide to hide it.
    >
    >How can I get the div contents displayed right next to the item the
    >mouse is over?[/color]

    As you're using visibility rather than display then the easiest thing
    is to get rid of the div, the p and the positioing.

    <A HREF="wd_org.co ntact_maint?p_w eb_site_id=61&p _org_contact_id =2
    &p_org_id=1" onMouseOver="sh ow('cont2')" onMouseOut="hid e('cont2')">
    Jones, Jenny</A><span id="cont2" style="z-index:2;
    background-color:#7eae58; visibility:hidd en"
    class="icams-normal-text">Jones</span>

    Of course what exactly will heppen will depend on the rest of the code
    which you haven't shown us.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

    Comment

    • Jeremy

      #3
      Re: DIV / Floating

      In article <pdd4sv0u9v8203 or2dtc7f6u2lpvm alca6@4ax.com>, steve@pugh.net
      says...[color=blue]
      > Jeremy <newspostings@h azelweb.co.uk> wrote:
      >[color=green]
      > >Name Telephone
      > >Fred 01667 887878
      > >Bill 01667 889901
      > >
      > >etc.
      > >
      > >The Name is defined as a hypertext link to take the user to a person
      > >details editing screen. No probs so far. On mouseover, I want to display
      > >the contents of a DIV immediately alongside the name clicked.[/color]
      >
      > Have you thought about just using the title attribute? Much simpler.[/color]

      Thanks Steve, my approach was actually somewhat ill-thought-out and was
      using some code I thought was right (came from another site) - in
      essence what I am trying to acheive is layer that is displayed with some
      content that will stay in place until the user moves the pointer away
      from the name. Looking for the lightest-weight, x-browser solution (have
      found a fairly lightweight though MS-only solution at msdn.microsoft. com

      (http://msdn.microsoft.com/workshop/s...opup/usingpopu
      p.htm - the 4th one down "Custom Tooltips").



      --

      jeremy

      Comment

      • Vladdy

        #4
        Re: DIV / Floating

        See if this one helps:


        --
        - Vladdy



        "Jeremy" <newspostings@h azelweb.co.uk> wrote in message
        news:MPG.1a2c50 bbb4942c3198995 d@news.individu al.net...
        | In article <pdd4sv0u9v8203 or2dtc7f6u2lpvm alca6@4ax.com>, steve@pugh.net
        | says...
        | > Jeremy <newspostings@h azelweb.co.uk> wrote:
        | >
        | > >Name Telephone
        | > >Fred 01667 887878
        | > >Bill 01667 889901
        | > >
        | > >etc.
        | > >
        | > >The Name is defined as a hypertext link to take the user to a person
        | > >details editing screen. No probs so far. On mouseover, I want to
        display
        | > >the contents of a DIV immediately alongside the name clicked.
        | >
        | > Have you thought about just using the title attribute? Much simpler.
        |
        | Thanks Steve, my approach was actually somewhat ill-thought-out and was
        | using some code I thought was right (came from another site) - in
        | essence what I am trying to acheive is layer that is displayed with some
        | content that will stay in place until the user moves the pointer away
        | from the name. Looking for the lightest-weight, x-browser solution (have
        | found a fairly lightweight though MS-only solution at msdn.microsoft. com
        |
        | (http://msdn.microsoft.com/workshop/s...opup/usingpopu
        | p.htm - the 4th one down "Custom Tooltips").
        |
        |
        |
        | --
        |
        | jeremy


        Comment

        • Jeremy

          #5
          Re: DIV / Floating

          In article <ddcxb.785$i81. 509@nwrdny02.gn ilink.net>,
          vladimir.g.kryl ov@verizon.net says...[color=blue]
          > See if this one helps:
          > www.klproductions.com/kltooltips.html
          >[/color]

          Cheers, thats the sort of thing I want. Any idea how much script is
          behind such a solution?

          --
          jeremy

          Comment

          • Vladdy

            #6
            Re: DIV / Floating

            The size of the script file is 9.5K
            You will also need to add CSS declarations.
            If you already have title attributes defined, it takes 2 lines to add the
            described funtionality to your html page. Unlike with other custom tooltips
            scripts, there is no need to litter your HTML code with onmouseover and
            onmouseout events.

            You can e-mail me further questions

            -Vladdy


            "Jeremy" <newspostings@h azelweb.co.uk> wrote in message
            news:MPG.1a2fce 2de1022fc498997 1@news.individu al.net...
            | In article <ddcxb.785$i81. 509@nwrdny02.gn ilink.net>,
            | vladimir.g.kryl ov@verizon.net says...
            | > See if this one helps:
            | > www.klproductions.com/kltooltips.html
            | >
            |
            | Cheers, thats the sort of thing I want. Any idea how much script is
            | behind such a solution?
            |
            | --
            | jeremy
            |


            Comment

            Working...