Thanks Klaus.

On Feb 29, 11:28 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Wasn't clear to me you were talking about solely jQuery, e.g.
> *JavaScript based* element selection.
>
> There are a few CSS selectors that are hardly - if at all  - to
> recreate with JavaScript. :first-line as well as :link and :visited
> belog to these...
>
> It may work somehow, but I doubt it would be in any way much reliable.
>
> --Klaus
>
> On Feb 29, 9:12 pm,bweaverusenet<[EMAIL PROTECTED]> wrote:
>
> > Klaus, thanks, but I'm talking about jquery selectors. (IE 6 doesn't
> > seem to support the next operator + in CSS, as in h2 + p:first-line.)
> > Try the following in FF and IE. The :first-line alert gives an error,
> > while :first works fine. Previous versions of jquery simply returned
> > nothing. So to sum-up:
>
> > * jquery doesn't seem to handle the :first-line selector
> > * IE6 doesn't support h2 + p:first-line in CSS
>
> > Thanks!
>
> > <html>
> > <head>
> > <script type="text/javascript" src="http://code.jquery.com/jquery-
> > latest.pack.js"></script>
> > <style>
> > #w{width:20em;}
> > h2 + p:first-line{color:red;}
> > </style>
> > <script>
> > $(document).ready(function(){
> > alert(":first=" + $("p:first").text());
> > alert(":first-line=" + $("p:first-line").text());//jquery error});
>
> > </script>
> > </head>
> > <body>
> > <div id="w">
> > <h2>Test</h2>
> > <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla id
> > magna quis quam fermentum ultricies. Donec ac magna. Duis commodo
> > leo.</p>
> > <p>XXXXXXXXXXXXXXXXXXXXX.</p>
> > <p>Testing one two three.</p>
> > </div>
> > </body>
> > </html>
>
> > On Feb 29, 2:45 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote:
>
> > > On Feb 29, 6:53 pm,bweaverusenet<[EMAIL PROTECTED]> wrote:
>
> > > > Hi. Is there some workaround for the unsupported :first-line pseudo-
> > > > selector to get the first line of text? Even if it involves javascript
> > > > code. The only thing I can come up with is some overly-complex
> > > > typographical guesstimate of where the line ends, but that seems
> > > > fraught with problems. Any help would be appreciated. Thanks. -bill
>
> > > The :first-line pseudo-element is supported since IE 5.5.
>
> > >http://msdn2.microsoft.com/en-us/library/ms530754(VS.85).aspx
>
> > > --Klaus

Reply via email to