hide and show text

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

    #16
    Re: hide and show text

    Dr John Stockton a ecrit :[color=blue]
    >
    > JRS: In article <y8tcbjvv.fsf@h otpop.com>, seen in
    > news:comp.lang. javascript, Lasse Reichstein Nielsen <lrn@hotpop.com >
    > posted at Tue, 16 Dec 2003 21:14:12 :-[color=green]
    > >Dr John Stockton <spam@merlyn.de mon.co.uk> writes:
    > >[color=darkred]
    > >> Such a reference is particularly inconsiderate of those who use an
    > >> inferior off-line newsreader which cannot search the headers of a local
    > >> newsbase, and, being off-line, do not have immediate access to Google.[/color]
    > >
    > >They should still accept <news:3FDBB460. 6020309@Pointed Ears.de>, which
    > >is an official URL scheme.[/color][/color]

    Does it depent of server (relay) ?
    because when I click on link above I get : ERROR message

    Comment

    • DU

      #17
      Re: hide and show text

      Lasse Reichstein Nielsen wrote:
      [color=blue]
      > Thomas 'PointedEars' Lahn <PointedEars@we b.de> writes:
      >
      >[color=green]
      >>Evertjan. wrote:[/color]
      >
      >[color=green][color=darkred]
      >>>function hide(x){
      >>> document.getEle mentById(x).sty le.display='non e'
      >>>}
      >>>function show(x){
      >>> document.getEle mentById(x).sty le.display=''
      >>>}[/color]
      >>
      >>This is syntactically and semantically correct but error-catching
      >>and inefficient. See <3FDBB460.60203 09@PointedEars. de> for details.[/color]
      >
      >
      > To me "error catching" is *good* (you *want* to catch your errors,
      > otherwise you can't fix them).
      >[/color]

      "Error catching" strongly suggests error handling with javascript try,
      catch, finally coding.
      [color=blue]
      > I checked the message you refer to for details, Your point is that
      > the author didn't check for the existence of getElementById?
      >
      > The W3C DOM is the one thing I can accept not checking for.[/color]

      I entirely agree with you on this. If a browser does not support
      document.getEle mentById, then I think it is not worth the trouble trying
      to write more javascript code (hacks, cross-browser code) to support it.
      One day, people have to upgrade their browser.

      Obviously,[color=blue]
      > if you need to support older browsers (Netscape 4, IE 4), you will
      > need to use proprietary code, but a footnote to that effect should be
      > sufficient.
      >[/color]

      If a webpage is well designed, then content should degrade gracefully
      and normal, basic webpage functionality should/will work in such page.
      The limits I set in building webpages involve browsers which only
      support document.all and document.layers .
      [color=blue]
      > Anyway, the existence of document.getEle mentById and the style object
      > on the node are not sufficient to conclude that the code works.[/color]

      Good point! Mozilla 1.6beta and Opera 7.23 supports visibility:coll apse
      but the rendering obviously proves that its support is limited, incomplete.

      Bug 77019: <tr style="visibili ty: collapse;"> looks like hidden and
      collapsed
      RESOLVED (bernd_mozilla) in Core - Layout: Tables. Last updated 2004-05-02.



      CSS2 17.5.5 Dynamic row and column effects
      "The 'visibility' property takes the value 'collapse' for row, row
      group, column, and column group elements. This value causes the entire
      row or column to be removed from the display, and the space normally
      taken up by the row or column to be made available for other content."
      http://www.w3.org/TR/CSS2/tables.html#dynamic-effects

      DU

      It fails[color=blue]
      > in, e.g., Opera 6, because it doesn't allow dynamic changing of the
      > display property.
      >
      > /L[/color]

      Comment

      • DU

        #18
        Re: hide and show text

        Thomas 'PointedEars' Lahn wrote:
        [color=blue]
        > Lasse Reichstein Nielsen wrote:
        >[color=green]
        >>Thomas 'PointedEars' Lahn <PointedEars@we b.de> writes:
        >>[color=darkred]
        >>>Evertjan. wrote:
        >>>
        >>>>function hide(x){
        >>>> document.getEle mentById(x).sty le.display='non e'
        >>>>}
        >>>>function show(x){
        >>>> document.getEle mentById(x).sty le.display=''
        >>>>}
        >>>
        >>>This is syntactically and semantically correct but error-catching
        >>>and inefficient. See <3FDBB460.60203 09@PointedEars. de> for details.[/color]
        >>
        >>To me "error catching" is *good* (you *want* to catch your errors,
        >>otherwise you can't fix them).[/color]
        >
        >
        > Of course it was not meant this way.
        >
        >[color=green]
        >>I checked the message you refer to for details, Your point is that
        >>the author didn't check for the existence of getElementById?[/color]
        >
        >
        > That is what `error-catching' refers to. What would be the
        > appropriate expression for provoking script errors with such?
        >[/color]

        error-catching in a javascript newsgroup could be referring to
        try...catch...f inally coding too, you know.

        [color=blue]
        >[color=green]
        >>The W3C DOM is the one thing I can accept not checking for. Obviously,
        >>if you need to support older browsers (Netscape 4, IE 4), you will
        >>need to use proprietary code, but a footnote to that effect should be
        >>sufficient.[/color]
        >
        >
        > You could not be more wrong. W3C-DOM is supported in Windows-IE not
        > really (meaning it is not usable) below version 5.5 and support in
        > other UAs is still limited. However, it should be rule of thumb for
        > a Web author and J(ava)Script programmer not to exclude any people
        > who want to use a site,[/color]

        That is why proper testing should be done to insure that content is
        accessible without javascript. A properly designed webpage will not
        prevent web-tv users, Lynx users, speech browsers, etc.. from accessing
        the webpage's content and using normal standard navigation.
        When designing a page, one should start with establishing the content,
        then the structure, then the markup code, then the style formating and
        then and only at the end the script code. And testing the webpage should
        go in the reverse order (by disabling script, then stylesheet).

        no matter how standards-compliant their UA is.[color=blue]
        > They may not have a choice.
        >
        >[color=green]
        >>Anyway, the existence of document.getEle mentById and the style object
        >>on the node are not sufficient to conclude that the code works. It fails
        >>in, e.g., Opera 6, because it doesn't allow dynamic changing of the
        >>display property.[/color]
        >
        >
        > It looks like you oppose yourself, as the `display' property is part of
        > the W3C-DOM Level 2 Style Specification and not specified as read-only.
        >
        > But thanks for pointing this out, this will save me a lot of trouble.
        > Can one even accomplish what the OP wants in Opera 6 and if yes, how?
        >[/color]

        I know that getElementById method is supported by Opera 6 and so is CSS
        property visibility. I don't know if that would work for table rows: I
        doubt it.
        [color=blue]
        >
        > PointedEars[/color]

        If it can not be accomplished in Opera 6 (or any other UA), then it
        proves that basic normal accessibility should be considered when
        designing the webpage and that users should be prepared to be told, to
        be invited to upgrade their browser to the latest available version.

        No one started with the basic issues either, regarding the OP initial
        post: what are the webpage goals, requirements, overview, what's its
        context within the site, etc. We were all asked about how to implement
        the visibility solution on a targeted table row. Who knows, this could
        be a working solution for a badly assessed/diagnosticated problem.

        DU

        Comment

        • DU

          #19
          Re: hide and show text

          Richard Cornford wrote:
          [color=blue]
          > "Thomas 'PointedEars' Lahn" <PointedEars@we b.de> wrote in message
          > news:3FDDDEE8.1 040602@PointedE ars.de...
          > <snip>
          >[/color]

          [snipped]
          [color=blue]
          > The dynamic aspects of Operas 5 & 6 are limited to CSS positioned
          > elements, which may be sized, moved and z-index stacked, but the results
          > suffer from numerous display bugs and are dubious at best. Given the
          > OP's table mark-up, Opera <= 6 will not be able to perform this task at
          > all. It is possible to set the style.position property of elements
          > dynamically so an element can be rendered position:absolu te; but that
          > isn't going to work well (if at all) with a TR element and Opera never
          > re-flows the remaining content even if you do that. Otherwise,
          > visibility = 'hidden' would conceal the content, but not really
          > satisfactorily.
          >
          > Richard.
          >
          >[/color]

          Concealing the content would certainly be a start, an acceptable outcome
          for a not-so-recent (outdated IMO) browser version. The subject line of
          this thread is about hiding text.
          What I strongly suspect here is that the OP's real webpage is based on
          table design. Within a non-table-based webpage design, there would be
          other ways to show and hide text.

          DU

          Comment

          Working...