replace text except when mouse hovers above it

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

    replace text except when mouse hovers above it

    I'd like to replace the text content of a subdiv by "...", except when
    the mouse is hovering either above it, or above another subdiv of the
    same parent. Something like:

    <div class="parent">
    <span class="name"><a href="#">Name</a></span>:
    <span class="message" >This is the text</span>
    </div>

    div.parent span.message { display: none }
    div.parent:afte r { content: "..." }

    But then? Ideally I'd like the original message to become visible if the
    mouse hovers over the three dots, but I don't think that's possible...
    I'd settle for making it visible if it hovers over the name.

    I can't make either of these work.

    Help?

    And, is it possible to select a div if you hover over a child element?
    That would be a way around it.

    --
    Bart.
  • Daniel =?ISO-8859-15?Q?D=E9chelotte?=

    #2
    Re: replace text except when mouse hovers above it

    Bart Lateur a écrit :
    I'd like to replace the text content of a subdiv by "...", except when
    the mouse is hovering either above it, or above another subdiv of the
    same parent. Something like:
    >
    <div class="parent">
    <span class="name"><a href="#">Name</a></span>:
    <span class="message" >This is the text</span>
    </div>
    >
    div.parent span.message { display: none }
    div.parent:afte r { content: "..." }
    >
    But then?
    Not too bad for a start. How about http://yo.dan.free.fr/tmp/bart.html ?
    Not exactly pretty, but close to what you describe (in web browsers and
    IE7, probably).
    But then, what do you *really* want to achieve? Please provide an URL
    with an excerpt of real content, not just "this is the text".
    [...]
    And, is it possible to select a div if you hover over a child element?
    That would be a way around it.
    To /select/ a div? Again, what do you want to do? (the big picture)

    --
    Daniel Déchelotte

    Comment

    Working...