[jQuery] Re: Create a class on run-time?

2008-07-20 Thread Brian J. Fink

For the second time, I am posting this to the errant poster named "my
name". Do NOT post an unsubscribe request to an existing thread. Don't
you know how to find the link for posting a new topic? Besides, you
can unsubscribe from your My Account link at the top of this page.
Click the button marked "Manage Subscriptions". Scroll down the page
to the line that begins with "jQuery (English)". At the end of that
line there is a dropdown menu to edit your subscription type. Select
"unsubscribe".

On Jul 20, 10:52 am, my name <[EMAIL PROTECTED]> wrote:
> please unsubscribe me.
> 
>
>
>
> > Date: Sun, 20 Jul 2008 06:04:34 -0700
> > Subject: [jQuery] Re: Create a class on run-time?
> > From: [EMAIL PROTECTED]
> > To: jquery-en@googlegroups.com
>
> > I mean (2) create css set of rules.
> > Now i have a simple way to modify the css set of rules.
> > Thanks. : )
>
> > On Jul 20, 1:15 am, Ariel Flesler  wrote:
> >> You mean, (1) add a class to an element, or (2) create css set of
> >> rules ?
>
> >> if (1): check the docs (docs.jquery.com).
> >> if(2): jQuery.Rule could be the 
> >> solutionhttp://flesler.blogspot.com/2007/11/jqueryrule.html
>
> >> --
> >> Ariel Fleslerhttp://flesler.blogspot.com/
>
> >> On 18 jul, 19:13, Evert  wrote:
>
> >>> Is it possible to create css class on run-time with jquery/javascript?
> >>> if yes, how?
>
> _
> With Windows Live for mobile, your contacts travel with 
> you.http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mob...


[jQuery] Re: unsubscribe (was: Create a class on run-time?)

2008-07-20 Thread Brian J. Fink

Do NOT reply to an existing thread with a different topic? Don't you
know where the New Post link is? And besides, you can go to your
account from the My Account  link at the top of this page. Then click
on the button that says, "Manage Subscriptions" and scroll down the
page that appears, until you come to the line that says "jQuery
(English)" at the beginning of it. At the end of that line you will
see a dropdown menu to edit your subscription. Click on it and select
"unsubscribe".

On Jul 20, 10:52 am, my name <[EMAIL PROTECTED]> wrote:
> please unsubscribe me.
> 
>
>
>
> > Date: Sun, 20 Jul 2008 06:04:34 -0700
> > Subject: [jQuery] Re: Create a class on run-time?
> > From: [EMAIL PROTECTED]
> > To: jquery-en@googlegroups.com
>
> > I mean (2) create css set of rules.
> > Now i have a simple way to modify the css set of rules.
> > Thanks. : )
>
> > On Jul 20, 1:15 am, Ariel Flesler  wrote:
> >> You mean, (1) add a class to an element, or (2) create css set of
> >> rules ?
>
> >> if (1): check the docs (docs.jquery.com).
> >> if(2): jQuery.Rule could be the 
> >> solutionhttp://flesler.blogspot.com/2007/11/jqueryrule.html
>
> >> --
> >> Ariel Fleslerhttp://flesler.blogspot.com/
>
> >> On 18 jul, 19:13, Evert  wrote:
>
> >>> Is it possible to create css class on run-time with jquery/javascript?
> >>> if yes, how?
>
> _
> With Windows Live for mobile, your contacts travel with 
> you.http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mob...


[jQuery] Re: Using jQuery on imported content

2008-07-14 Thread Brian J. Fink

What syntax are you using for the anchors themselves?

On Jul 14, 2:00 pm, Peter Benoit <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have an "index" page with a div, that I $
> ('#mydiv").load('mypage.html') into.
>
> The problem I'm having is, I have anchors on "mypage" that I would
> like to effect with the click event on the "index" page.  Trying to
> access these loaded anchors via $('a#anchorid').click(...), isn't
> working.  Can someone show me how to handle this?
>
> Thanks!
> -pete


[jQuery] Re: jQuery and Prototype

2008-07-14 Thread Brian J. Fink

It appears that Prototype uses the $ functionality, but in a slightly
different way. You may consider employing jQueryNoConlfict() and then
call jQuery() instead of $(). Also try loading the jQuery script last.

On Jul 14, 1:01 pm, Michael <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've been using jQuery for my new website and everything has been
> working fine, no 
> errors:http://www.aber.ac.uk/designstudio/mike/newnew/newweb/index-backup-14...
>
> Then I saw this website:
>
> http://24ways.org/examples/introducing-udasss/
>
> And I wanted that functionality on my site. So I tried the code (which
> uses prototype) and my jQuery code stops working.
>
> http://www.aber.ac.uk/designstudio/mike/newnew/newweb/
>
> The lavalamp at the top right has stopped working and so has the drop
> down on the settings and on the right hand sidebar. my firefox web
> developer toolbar tells me that $(document).ready is not a function,
> so I added jQuery.noConflict(); into my code and changed $ to jQuery.
> Then it says that Error: $(".cats-list") is null. And the lavalamp has
> just stopped working.
>
> Any help would be appreciated to fix these problems.


[jQuery] Re: .removeClass() performance is very low on IE7

2008-07-08 Thread Brian J. Fink

Be sure to change that [ to a ( so it will work. :)

On Jul 8, 8:31 am, "Joel Birch" <[EMAIL PROTECTED]> wrote:
> Hi Evert,
>
> '.someclass' is a slow selector as it has to check every single
> element on the page to see if it matches class="someclass". Limiting
> the search closer to the desired elements will speed up the selection
> hugely. For example, choose the closest common ancestor that all
> potential target elements share and that has an id (say,
> #somecontainer) and also specify the type of element that the target
> will be if possible (in this case, a div). Your improved code would
> look like this:
>
> // find all divs with class 'someclass' that are somewhere within
> // (descendant of) an element with id 'somecontainer':
>
> $('#somecontainer div.someclass').removeClass['someclass');
>
> Please let us know if your code still seems slow in IE7 after this.
>
> Joel Birch.


[jQuery] Re: Position cursor at end of textbox?

2008-07-08 Thread Brian J. Fink

Please note: This discussion group is malfunctioning and you must open
quoted text in order to read the last line of the previous post. The
last tow lines should be

 });
});


If you do not copy the second }); my code will fail.



On Jul 8, 2:26 pm, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
> This is the best I can come up with. I wanted to catch the onselect
> event, but for some reason Safari won't respond. (Didn't want to keep
> using a timeout. It's a hack, but it works.) I reduced the length of
> the timeout to 0 milliseconds, and I cleaned up the call by passing
> the this object as a parameter. I also changed the moveStart for IE to
> a collapse instead.
>
> $(function() {
>  $(':text').focus(function() {
>   if (this.setSelectionRange) /* DOM */
>   {
>setTimeout(function(t) { /* hack for select delay */
> t.setSelectionRange(t.value.length,t.value.length);
>},0,this);
>   }
>   else if (this.createTextRange) /* IE */
>   {
>r=this.createTextRange();
>r.collapse(false);
>r.select();
>   }
>  });
>
> });


[jQuery] Re: Position cursor at end of textbox?

2008-07-08 Thread Brian J. Fink

This is the best I can come up with. I wanted to catch the onselect
event, but for some reason Safari won't respond. (Didn't want to keep
using a timeout. It's a hack, but it works.) I reduced the length of
the timeout to 0 milliseconds, and I cleaned up the call by passing
the this object as a parameter. I also changed the moveStart for IE to
a collapse instead.

$(function() {
 $(':text').focus(function() {
  if (this.setSelectionRange) /* DOM */
  {
   setTimeout(function(t) { /* hack for select delay */
t.setSelectionRange(t.value.length,t.value.length);
   },0,this);
  }
  else if (this.createTextRange) /* IE */
  {
   r=this.createTextRange();
   r.collapse(false);
   r.select();
  }
 });
});


[jQuery] Re: Position cursor at end of textbox?

2008-07-03 Thread Brian J. Fink

OK, I was a little premature in my judgment. But why add a new
function to jQuery when it will only be used once in your code? That's
kind of silly.

On Jul 3, 10:58 am, h3 <[EMAIL PROTECTED]> wrote:
> $.extend($.fn, {
> selectRange: function(start, end) {
> // use only the first one since only one input can be
> focused
> if ($(this).get(0).createTextRange) {
> var range = $(this).get(0).createTextRange();
> range.collapse(true);
> range.moveEnd('character',   end);
> range.moveStart('character', start);
> range.select();
> }
> else if ($(this).get(0).setSelectionRange) {
> $(this).focus().get(0).setSelectionRange(start, end);
> }
> return $(this);
> }
>
> });
>
> I think it's pretty much the best crossbrowser solution you will find.
>
> $('input').selectRange(0,0) to reset the carret position, to position
> it at the end you will need to get length of the input's value.. you
> just made me think
> I could add support for -1, thanks :D
>
> ~h
>
> On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
>
> > By default it seems browsers select all the text in a textbox when it
> > gains focus by way of a tab-press.  I would like the cursor to be
> > positioned at the end of any existing text in the input, instead.  The
> > examples I'm turning up on Google don't work and seem needlessly
> > complex, and since jQuery simplifies everything else I used to hate
> > about Javascript, I thought I'd see if there's a simple way to
> > position the cursor in a text input box on focus.  Is it doable?
>
> > Thanks...


[jQuery] Re: Position cursor at end of textbox?

2008-07-03 Thread Brian J. Fink

Returns error: $(this).caret is not a function.
The function must be part of the plugin you alluded to.

On Jul 2, 8:23 pm, spicyj <[EMAIL PROTECTED]> wrote:
> This might be helpful:
>
> http://pastie.org/226790// shamelessly stolen from the Masked Input
> plugin
>
> $(":text").bind("focus", function() {
>   $(this).caret(this.value.length);
>
> });
>
> Not tested, so I don't know if it works, but it might.


[jQuery] Re: Position cursor at end of textbox?

2008-07-03 Thread Brian J. Fink

Bah! What's with the $(this).get(0) when all you need is the this
keyword from JavaScript?
Oh, and by the way, Your solution would disable selection entirely. I
don't think Paul had in mind to kill a flea with a sledgehammer!

On Jul 3, 10:58 am, h3 <[EMAIL PROTECTED]> wrote:
> $.extend($.fn, {
> selectRange: function(start, end) {
> // use only the first one since only one input can be
> focused
> if ($(this).get(0).createTextRange) {
> var range = $(this).get(0).createTextRange();
> range.collapse(true);
> range.moveEnd('character',   end);
> range.moveStart('character', start);
> range.select();
> }
> else if ($(this).get(0).setSelectionRange) {
> $(this).focus().get(0).setSelectionRange(start, end);
> }
> return $(this);
> }
>
> });
>
> I think it's pretty much the best crossbrowser solution you will find.
>
> $('input').selectRange(0,0) to reset the carret position, to position
> it at the end you will need to get length of the input's value.. you
> just made me think
> I could add support for -1, thanks :D
>
> ~h
>
> On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
>
> > By default it seems browsers select all the text in a textbox when it
> > gains focus by way of a tab-press.  I would like the cursor to be
> > positioned at the end of any existing text in the input, instead.  The
> > examples I'm turning up on Google don't work and seem needlessly
> > complex, and since jQuery simplifies everything else I used to hate
> > about Javascript, I thought I'd see if there's a simple way to
> > position the cursor in a text input box on focus.  Is it doable?
>
> > Thanks...


[jQuery] Re: Position cursor at end of textbox?

2008-07-03 Thread Brian J. Fink

There's a $.caret()?

On Jul 2, 8:23 pm, spicyj <[EMAIL PROTECTED]> wrote:
> This might be helpful:
>
> http://pastie.org/226790// shamelessly stolen from the Masked Input
> plugin
>
> $(":text").bind("focus", function() {
>   $(this).caret(this.value.length);
>
> });
>
> Not tested, so I don't know if it works, but it might.


[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Brian J. Fink

My apologies, Erik. Yours is the superior method. I must have been
remembering the behavior of IE5.

On Jul 2, 8:12 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> Ick! Global variables and eval'd code! How about (untested, logic should be
> unchanged):
>
> $(function() {
> $(':text').bind('focus', function() {
> var o = this;
> if(o.setSelectionRange) { /* DOM */
> setTimeout(function()
> {o.setSelectionRange(o.value.length,o.value.length);}, 2);
> } else if(o.createTextRange) {/* IE */
> var r = o.createTextRange();
> r.moveStart('character', o.value.length);
> r.select();
> }
> });
>
> });
>
> Adds an anonymous function, which adds a function call, but saves an eval
> and doesn't require a global variable, which is potentially problematic.
>
> --Erik
>
> On 7/2/08, Brian J. Fink <[EMAIL PROTECTED]> wrote:
>
>
>
> > And I checked my code again. It DOES work on FF3, FF2, and IE7.
>
> > On Jul 2, 5:37 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
> > > Thanks for the code.  It doesn't work for me--still when I tab into a
> > > textbox in either IE7 or FF3 the content is selected and the cursor
> > > isn't positioned at the end of the text, even when I pull out
> > > everything but this function and two textboxes to test.
>
> > > I think I may just give up--it was a minor detail and not requested by
> > > the users.  Bugs me, though.  Seems like it shouldn't be so tricksy...
>
> > > On Jul 2, 3:12 pm, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
>
> > > > There may be a jQuery way to do this, but I don't know what it is.
>
> > > > However, I do know 2 ways to accomplish this: one DOM way, one IE way.
> > > > Both methods must be employed.
>
> > > > $(function() {
> > > >  $('input[type="text"]').bind('focus',function() {
> > > >   window.o=this;
> > > >   if (o.setSelectionRange) /* DOM */
> > > >setTimeout('o.setSelectionRange(o.value.length,o.value.length)',2);
> > > >   else if (o.createTextRange) /* IE */
> > > >   {
> > > >var r=o.createTextRange();
> > > >r.moveStart('character',o.value.length);
> > > >r.select();
> > > >   }
> > > >  });
>
> > > > });
>
> > > > On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
>
> > > > > By default it seems browsers select all the text in a textbox when it
> > > > > gains focus by way of a tab-press.  I would like the cursor to be
> > > > > positioned at the end of any existing text in the input,
> > instead.  The
> > > > > examples I'm turning up on Google don't work and seem needlessly
> > > > > complex, and since jQuery simplifies everything else I used to hate
> > > > > about Javascript, I thought I'd see if there's a simple way to
> > > > > position the cursor in a text input box on focus.  Is it doable?
>
> > > > > Thanks...


[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Brian J. Fink

I believe setTimeouts work outside the scope of the function they are
called from. Test your way but I don't think it'll work.

On Jul 2, 8:12 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> Ick! Global variables and eval'd code! How about (untested, logic should be
> unchanged):
>
> $(function() {
> $(':text').bind('focus', function() {
> var o = this;
> if(o.setSelectionRange) { /* DOM */
> setTimeout(function()
> {o.setSelectionRange(o.value.length,o.value.length);}, 2);
> } else if(o.createTextRange) {/* IE */
> var r = o.createTextRange();
> r.moveStart('character', o.value.length);
> r.select();
> }
> });
>
> });
>
> Adds an anonymous function, which adds a function call, but saves an eval
> and doesn't require a global variable, which is potentially problematic.
>
> --Erik
>
> On 7/2/08, Brian J. Fink <[EMAIL PROTECTED]> wrote:
>
>
>
> > And I checked my code again. It DOES work on FF3, FF2, and IE7.
>
> > On Jul 2, 5:37 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
> > > Thanks for the code.  It doesn't work for me--still when I tab into a
> > > textbox in either IE7 or FF3 the content is selected and the cursor
> > > isn't positioned at the end of the text, even when I pull out
> > > everything but this function and two textboxes to test.
>
> > > I think I may just give up--it was a minor detail and not requested by
> > > the users.  Bugs me, though.  Seems like it shouldn't be so tricksy...
>
> > > On Jul 2, 3:12 pm, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
>
> > > > There may be a jQuery way to do this, but I don't know what it is.
>
> > > > However, I do know 2 ways to accomplish this: one DOM way, one IE way.
> > > > Both methods must be employed.
>
> > > > $(function() {
> > > >  $('input[type="text"]').bind('focus',function() {
> > > >   window.o=this;
> > > >   if (o.setSelectionRange) /* DOM */
> > > >setTimeout('o.setSelectionRange(o.value.length,o.value.length)',2);
> > > >   else if (o.createTextRange) /* IE */
> > > >   {
> > > >var r=o.createTextRange();
> > > >r.moveStart('character',o.value.length);
> > > >r.select();
> > > >   }
> > > >  });
>
> > > > });
>
> > > > On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
>
> > > > > By default it seems browsers select all the text in a textbox when it
> > > > > gains focus by way of a tab-press.  I would like the cursor to be
> > > > > positioned at the end of any existing text in the input,
> > instead.  The
> > > > > examples I'm turning up on Google don't work and seem needlessly
> > > > > complex, and since jQuery simplifies everything else I used to hate
> > > > > about Javascript, I thought I'd see if there's a simple way to
> > > > > position the cursor in a text input box on focus.  Is it doable?
>
> > > > > Thanks...


[jQuery] Re: possible bug in each()? moving from 1.2.3 to 1.2.6

2008-07-02 Thread Brian J. Fink

Is that the correct way to spell it? Maybe all lowercase would work.
(I don't know. I use $ myself.)

On Jul 2, 6:48 pm, darren <[EMAIL PROTECTED]> wrote:
> Hi
>
> Im trying to use 1.2.6, moving from 1.2.3.  I have a working function
> in 1.2.3 but it is not working with the updated jquery library, and
> I'm wondering if i have found a bug.
>
> The trouble call is this:
>
> jQuery('#apparatus .annotation').each( function(i){
> ...
>
> When stepping over this call, firebug returns an error of "object not
> defined".
>
> As I mentioned, this code is working correctly with jQuery 1.2.3.
> Note also I'm using jQuery, not $ for all of my calls.  Also, im using
> jQuery.noConflict(). I have tried to used the uncompressed and packed
> versions, witht he same result.
>
> Any suggestions?


[jQuery] Re: unsubscribe me

2008-07-02 Thread Brian J. Fink

Look, we all know Rohit is confused... we don't need to make it THAT
hard on him.

On Jul 2, 6:39 pm, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> Brian J. Fink wrote:
> > @Eric: He said he forgot his username and password.
> > @Rohit: Then how did you log in to post this?
>
> I'm posting this without logging in. And I read the mail without logging
> in aren't I clever.
>
> Hint: gmane.org - provided you use the same email address in e.g.
> Thunderbird as your google groups account (which does not have to be
> anything to do with gmail) you can get all the joys of mailing list
> membership in a handy NNTP interface. Can't live without it myself.
>
> Col


[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Brian J. Fink

And I checked my code again. It DOES work on FF3, FF2, and IE7.

On Jul 2, 5:37 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
> Thanks for the code.  It doesn't work for me--still when I tab into a
> textbox in either IE7 or FF3 the content is selected and the cursor
> isn't positioned at the end of the text, even when I pull out
> everything but this function and two textboxes to test.
>
> I think I may just give up--it was a minor detail and not requested by
> the users.  Bugs me, though.  Seems like it shouldn't be so tricksy...
>
> On Jul 2, 3:12 pm, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
>
> > There may be a jQuery way to do this, but I don't know what it is.
>
> > However, I do know 2 ways to accomplish this: one DOM way, one IE way.
> > Both methods must be employed.
>
> > $(function() {
> >  $('input[type="text"]').bind('focus',function() {
> >   window.o=this;
> >   if (o.setSelectionRange)     /* DOM */
> >    setTimeout('o.setSelectionRange(o.value.length,o.value.length)',2);
> >   else if (o.createTextRange)     /* IE */
> >   {
> >    var r=o.createTextRange();
> >    r.moveStart('character',o.value.length);
> >    r.select();
> >   }
> >  });
>
> > });
>
> > On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
>
> > > By default it seems browsers select all the text in a textbox when it
> > > gains focus by way of a tab-press.  I would like the cursor to be
> > > positioned at the end of any existing text in the input, instead.  The
> > > examples I'm turning up on Google don't work and seem needlessly
> > > complex, and since jQuery simplifies everything else I used to hate
> > > about Javascript, I thought I'd see if there's a simple way to
> > > position the cursor in a text input box on focus.  Is it doable?
>
> > > Thanks...


[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Brian J. Fink

Also be sure you have two sets of }); at the end of your function:

 });
});

The message displayed with the 2 of them separated, so the second one
was easy to miss.


On Jul 2, 5:37 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
> Thanks for the code.  It doesn't work for me--still when I tab into a
> textbox in either IE7 or FF3 the content is selected and the cursor
> isn't positioned at the end of the text, even when I pull out
> everything but this function and two textboxes to test.
>
> I think I may just give up--it was a minor detail and not requested by
> the users.  Bugs me, though.  Seems like it shouldn't be so tricksy...
>
> On Jul 2, 3:12 pm, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
>
> > There may be a jQuery way to do this, but I don't know what it is.
>
> > However, I do know 2 ways to accomplish this: one DOM way, one IE way.
> > Both methods must be employed.
>
> > $(function() {
> >  $('input[type="text"]').bind('focus',function() {
> >   window.o=this;
> >   if (o.setSelectionRange)     /* DOM */
> >    setTimeout('o.setSelectionRange(o.value.length,o.value.length)',2);
> >   else if (o.createTextRange)     /* IE */
> >   {
> >    var r=o.createTextRange();
> >    r.moveStart('character',o.value.length);
> >    r.select();
> >   }
> >  });
>
> > });
>
> > On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
>
> > > By default it seems browsers select all the text in a textbox when it
> > > gains focus by way of a tab-press.  I would like the cursor to be
> > > positioned at the end of any existing text in the input, instead.  The
> > > examples I'm turning up on Google don't work and seem needlessly
> > > complex, and since jQuery simplifies everything else I used to hate
> > > about Javascript, I thought I'd see if there's a simple way to
> > > position the cursor in a text input box on focus.  Is it doable?
>
> > > Thanks...


[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Brian J. Fink

Funny, it worked for me on IE7. And FF2. I didn't test it on 3 yet.

BTW if you already have a $ or $(document).ready, you must take the
code inside the curly braces and insert that into it.

On Jul 2, 5:37 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
> Thanks for the code.  It doesn't work for me--still when I tab into a
> textbox in either IE7 or FF3 the content is selected and the cursor
> isn't positioned at the end of the text, even when I pull out
> everything but this function and two textboxes to test.
>
> I think I may just give up--it was a minor detail and not requested by
> the users.  Bugs me, though.  Seems like it shouldn't be so tricksy...
>
> On Jul 2, 3:12 pm, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
>
> > There may be a jQuery way to do this, but I don't know what it is.
>
> > However, I do know 2 ways to accomplish this: one DOM way, one IE way.
> > Both methods must be employed.
>
> > $(function() {
> >  $('input[type="text"]').bind('focus',function() {
> >   window.o=this;
> >   if (o.setSelectionRange) /* DOM */
> >setTimeout('o.setSelectionRange(o.value.length,o.value.length)',2);
> >   else if (o.createTextRange) /* IE */
> >   {
> >var r=o.createTextRange();
> >r.moveStart('character',o.value.length);
> >r.select();
> >   }
> >  });
>
> > });
>
> > On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
>
> > > By default it seems browsers select all the text in a textbox when it
> > > gains focus by way of a tab-press.  I would like the cursor to be
> > > positioned at the end of any existing text in the input, instead.  The
> > > examples I'm turning up on Google don't work and seem needlessly
> > > complex, and since jQuery simplifies everything else I used to hate
> > > about Javascript, I thought I'd see if there's a simple way to
> > > position the cursor in a text input box on focus.  Is it doable?
>
> > > Thanks...


[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Brian J. Fink

There may be a jQuery way to do this, but I don't know what it is.

However, I do know 2 ways to accomplish this: one DOM way, one IE way.
Both methods must be employed.

$(function() {
 $('input[type="text"]').bind('focus',function() {
  window.o=this;
  if (o.setSelectionRange) /* DOM */
   setTimeout('o.setSelectionRange(o.value.length,o.value.length)',2);
  else if (o.createTextRange) /* IE */
  {
   var r=o.createTextRange();
   r.moveStart('character',o.value.length);
   r.select();
  }
 });
});


On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
> By default it seems browsers select all the text in a textbox when it
> gains focus by way of a tab-press.  I would like the cursor to be
> positioned at the end of any existing text in the input, instead.  The
> examples I'm turning up on Google don't work and seem needlessly
> complex, and since jQuery simplifies everything else I used to hate
> about Javascript, I thought I'd see if there's a simple way to
> position the cursor in a text input box on focus.  Is it doable?
>
> Thanks...


[jQuery] Re: .removeClass() performance is very low on IE7

2008-07-02 Thread Brian J. Fink

Why are you using an ID on 2 different elements?

On Jul 2, 11:51 am, Evert <[EMAIL PROTECTED]> wrote:
> //only 2 elements to remove
> $("#id").removeClass('onesimpleclassonly');
>
> It took almost 3 ~ 4 seconds to remove the class.
> What can I do to speed up the process?


[jQuery] Re: Noob question about accessing element contents

2008-07-02 Thread Brian J. Fink

This forum is about using jQuery, so our answers will usually be
focused on the best JQUERY way, not necessarily the BEST way.

On Jul 2, 11:51 am, ml1 <[EMAIL PROTECTED]> wrote:
> I'm trying to find out the "best practice" for getting the contents of
> one particular element.  I know about the each() call.
>
> As I said I can use ways that seem not so efficient to get the
> contents of a single element but I want to know the best way.
>
> On Jul 1, 5:20 pm, Mike Alsup <[EMAIL PROTECTED]> wrote:
>
> > > I am using jquery to parse some xml.  I'm looking for the best
> > > practice to access an elements text contents.
>
> > > Let's say my xml looks like this:
>
> > > 
> > >   
> > >  Hello world!
> > > > >
> > >   Goodnight moon!
> > >
> > > 
>
> > > I can get a wrapped set of the elements this way: $('items > item',
> > > xml)
>
> > > And I can get the text of element 1 this way:  $('items > item:eq(1)',
> > > xml).text()
>
> > > But how do I get the contents once I am directly accessing the element
> > > instead of the jquery object?
>
> > > In other words I'd like to do something like this: $('items > item',
> > > xml)[1].text(), but since the element that’s returned from the array
> > > [] doesn’t support text() how do I get it’s contents?
>
> > > I know I can wrap it in a second $ call, as in $($('items > item', xml)
> > > [1]).text() but that seems less than ideal.
>
> > Why do you need to access the element?  Are you trying to get the
> > contents of each 'item'?  If so, here's a way to do that:
>
> > $('items > item').each(i,o) {
> > // in this loop 'i' is the index of the loop iteration
> > // and 'o' is the object of the iteration (item element in this
> > case)
> > var $item = $(o); //  could also do:  var $item = $(this);
> > var txt = $item.text();
>
> > });


[jQuery] Re: Newbe: Why can't I reference $('#...') in functions?

2008-07-02 Thread Brian J. Fink

$() is exactly the same as $(document).ready()

On Jul 2, 12:20 pm, spicyj <[EMAIL PROTECTED]> wrote:
> I haven't tried it myself, but does it help if you replace the first
> three lines with:
>
> $(document).ready(function() {
> $("#button").click(filldiv);
>
> });
>
> Just a first thought.
> ~Ben
>
> lwoods wrote:
> > Why can't I reference the DIV using the jQuery format?  Here is the
> > example (minus opening HTML):
>
> > 
> > 
> > 
> > 
> > 
>
> > 
> > 
> > 
> > 
> > 


[jQuery] Re: unsubscribe me

2008-07-02 Thread Brian J. Fink

@Eric: He said he forgot his username and password.
@Rohit: Then how did you log in to post this?

On Jul 2, 1:56 pm, Eric Martin <[EMAIL PROTECTED]> wrote:
> Click the "Edit my membership" on the right, then click the
> "Unsubscribe" button...
>
> On Jul 2, 10:05 am, "Rohit Mandlik" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > How can i unsubscribe from this forum so i will not get more mails from this
> > forum.
> > I forgot my username and password.
> > please help me
>
> > thanks
> > @Rohit


[jQuery] Re: Using ASCII characters in textfield

2008-07-02 Thread Brian J. Fink

Apparently the Autocomplete plugin is escaping the & character. This
may be a bug, or may be done intentionally, I don't know.

I'm not sure what the workaround would be.

On Jul 2, 10:02 am, Gearóid O'Ceallaigh <[EMAIL PROTECTED]> wrote:
> I'm using an autocomplete function on a textfield but I'm having a
> problem since the autocomplete array is filled with German words so
> special characters (such as ü, ä and ö). I can insert the ASCII codes
> for these characters in the array and when the autocomplete display
> pulls down, the array elements are displayed correctly.
>
> However, when the user selects an option with a German character, the
> ASCII code of the element is displayed instead of the German
> character.
>
> For example, if the user selects "Anlagenführer", the text field would
> be populated with "Anlagenführer".
>
> Does anyone have any ideas of a workaround?


[jQuery] Re: Noob question about accessing element contents

2008-07-02 Thread Brian J. Fink

Let's say you've got the element stored in a variable as an
XMLElement, then it would be a simple matter to refer to the jQuery
object of the element itself, for example, for variable elem:

$(elem,xml).text()

On Jul 2, 12:10 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> $('item', xml).eq(1).text()
>
> - Richard
>
> On Wed, Jul 2, 2008 at 11:51 AM, ml1 <[EMAIL PROTECTED]> wrote:
>
> > I'm trying to find out the "best practice" for getting the contents of
> > one particular element.  I know about the each() call.
>
> > As I said I can use ways that seem not so efficient to get the
> > contents of a single element but I want to know the best way.
>
> > On Jul 1, 5:20 pm, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > > > I am using jquery to parse some xml.  I'm looking for the best
> > > > practice to access an elements text contents.
>
> > > > Let's say my xml looks like this:
>
> > > > 
> > > >   
> > > >  Hello world!
> > > > > > >
> > > >   Goodnight moon!
> > > >
> > > > 
>
> > > > I can get a wrapped set of the elements this way: $('items > item',
> > > > xml)
>
> > > > And I can get the text of element 1 this way:  $('items > item:eq(1)',
> > > > xml).text()
>
> > > > But how do I get the contents once I am directly accessing the element
> > > > instead of the jquery object?
>
> > > > In other words I'd like to do something like this: $('items > item',
> > > > xml)[1].text(), but since the element that's returned from the array
> > > > [] doesn't support text() how do I get it's contents?
>
> > > > I know I can wrap it in a second $ call, as in $($('items > item', xml)
> > > > [1]).text() but that seems less than ideal.
>
> > > Why do you need to access the element?  Are you trying to get the
> > > contents of each 'item'?  If so, here's a way to do that:
>
> > > $('items > item').each(i,o) {
> > > // in this loop 'i' is the index of the loop iteration
> > > // and 'o' is the object of the iteration (item element in this
> > > case)
> > > var $item = $(o); //  could also do:  var $item = $(this);
> > > var txt = $item.text();
>
> > > });


[jQuery] Re: Detecting pressed keys (not keypress, but if it's already pressed)

2008-06-30 Thread Brian J. Fink

Yout might also try setting a one-time keyup in which you test the
CTRL key state. But on a PC that key is the ALT key. Are you using
MAC?

On May 28, 7:11 am, Charles Sexton <[EMAIL PROTECTED]> wrote:
> Hi guys and girls,
>
> I don't know if this is possible, but I'm aiming to detect whether or
> not a key is pressed, as in the key is already pressed when the page
> loads.
>
> My application changes the page when Ctrl+arrow is pressed, but
> without being able to detect whether Ctrl is still pressed when the
> next page loads, both keys have to be pressed again.
>
> So is there any way to detect if a key is currently pressed, but the
> keystroke occurred before the page loaded?
>
> Many thanks to all who help,
>
> Charles


[jQuery] Re: Replace not a function with Regular Expression

2008-06-30 Thread Brian J. Fink

Glad I could be of assistance.


[jQuery] Re: Display a busy indicator?

2008-06-28 Thread Brian J. Fink

$('body').css('cursor','wait');

On Jun 27, 11:19 am, Felix Schwarz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I use the autocomplete script 
> fromhttp://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
>
> There is something I could not figure out: Is it possible to show an
> busy indicator while the results are fetched from a remote server?
>
> thanks,
> fs


[jQuery] Re: determine if form still "under focus"

2008-06-28 Thread Brian J. Fink

Can you supply some code?

On Jun 28, 6:34 am, "C. Feldmann" <[EMAIL PROTECTED]>
wrote:
> Hello!
>
> I have bumped into a problem that I have been trying to solver for
> hours now, without any sign of hope.
>
> I have a form which is loaded into a div through an ajax call. I would
> like to hide the form again as soon as the focus is lost. The form
> consists of inputs, textareas and selects.
> I have tried .blur() both on the form and the parent div, but that
> just didn't react. I can obviously bind a .blur to an input field, but
> that doesn't help, since I only want to trigger my function if the
> cursor is in none of the form fields.
>
> If there was a way for me to traverse through the form fields and
> check if one is focused it would be great. I googled for a possibility
> to determine if an input, select or textarea is "under focus", but I
> couldn't find anything useful.
>
> Alternatively it would be great to find out what triggers .blur()
> events on non form-elements (i.e. divs for forms themselves).
>
> How can I solve determine if a form is not being "used" anymore?
>
> Thanks
> Capser


[jQuery] Re: Replace not a function with Regular Expression

2008-06-28 Thread Brian J. Fink

You quoted "match", not "replace". Is this the code that caused the
error? If it is, replace the word "match" in your code with the word
"replace"; otherwise, repost with the code that generated the error.
In any event, match() takes only one argument and returns an array of
String objects, whereas replace() takes two: one RegExp and one
String, just like you have for match(), and returns the modified
String. Check your code again. The line:

$("").attr("src", item.media.m).match(/_m\.jpg/
g,'_b.jpg').appendTo("#images").fadeTo(1800, 1.0);

should read:

$("").attr("src", item.media.m).replace(/_m\.jpg/
g,'_b.jpg').appendTo("#images").fadeTo(1800, 1.0);

which should work just fine.

And I know you have jQuery in your code, but this was a JavaScript
question.

On Jun 27, 11:47 am, parrfolio <[EMAIL PROTECTED]> wrote:
> Trying to pull in flickr feed and replace the _m with _b in the url to
> print large images.
>
> 
> $.getJSON("http://api.flickr.com/services/feeds/groups_pool.gne?
> [EMAIL PROTECTED]&lang=en-us&size=b&format=json&jsoncallback=?",
> function(data){
>   $.each(data.items, function(i,item) {
> $("").attr("src", 
> item.media.m).match(/_m\.jpg/g,
> '_b.jpg').appendTo("#images").fadeTo(1800, 1.0);
>
> if ( i == 8 ) return false;
>   });
> $('#images, .content ul').innerfade({
> speed: '800',
> timeout: 5000,
> type: 'sequence'
> });
> });
>
> I'm having a tough time with the regular expression. I get replace is
> not a function. Anyone have any ideas on how to replace the url _m
> with _b?


[jQuery] Re: Validation is not working as expected. Input value deleted!

2008-06-26 Thread Brian J. Fink

Try using String.search(regexp)+1 instead of regexp.test(String).

Are you getting legitimate values to fail, or invalid ones to pass?

On Jun 20, 7:48 pm, shapper <[EMAIL PROTECTED]> wrote:
> Very strange ... it works both ways ... well, what I mean is that I
> keep having the same problem in both cases.
>
> Any more ideas?
>
> Did anyone notice that the Validation Examples Forms that have Masking
> don't work in Firefox 3?
>
> Thanks,
> Miguel
>
> On Jun 20, 7:46 pm, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
>
> > @Miguel: It appears you have the RegExp value and the value switched.
> > Maybe you meant:
>
> > $.validator.addMethod('sqldatetime', function (value) {
> >   return value.test(/^(([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1]
> > [0-9]|[2]
> > [0-3]):([0-5][0-9]):([0-5][0-9])|)$/);
>
> > }, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss');
>
> > On Jun 20, 6:53 am, shapper <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I am trying to validate and mask a text box that should contain a
> > > DateTime in the following format:
>
> > > -mm-dd hh:mm:ss
>
> > > The validation is not working as expected. The problem is:
>
> > >   In a presence of a valid data I deleted a small part of it (ss). The
> > > mask is revealed for this part.
> > >   If after deleting a part of the date/time I change the focus to
> > > another input or submit the form I get:
> > >   1. A message saying the date/time is invalid (This is expected)
> > >   2. The entire content of the input disappears. (This is not suppose
> > > to happen!)
>
> > > Every time I insert a invalid date I get a message but the date/time
> > > inserted is deleted. What is going on?
>
> > > I am testing the date/time in 2 ways: Required and through a method
> > > that uses Regex:
>
> > >   // Form validation
> > >   $("#Edit").validate({
> > > rules: {
> > >   UpdatedAt: {
> > > required: true,
> > > sqldatetime: true
> > >   }
> > > },
> > > messages: {
> > >   UpdatedAt: {
> > > required: "Insert Date/Time",
> > > sqldatetime: "Check the date/time. Use the format -mm-
> > > dd hh:mm:ss"
> > >   }
> > > }
> > >   });
>
> > > And the method sqldatetime is:
>
> > > $.validator.addMethod('sqldatetime', function (value) {
> > >   return /^(([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2]
> > > [0-3]):([0-5][0-9]):([0-5][0-9])|)$/.test(value);
>
> > > }, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss');
>
> > > The Regex validates only non empty values. If the value is empty it is
> > > also valid.
> > > I have made this so that my method does not conflict with Required and
> > > allow to have the two options only by adding or not the required rule.
>
> > > I tried to find the problem but wasn't able to.
>
> > > Any idea what is going wrong?
>
> > > Thanks,
> > > Miguel


[jQuery] Re: Has anyone been able to perform Hover-Grouping?

2008-06-26 Thread Brian J. Fink

$('td.add,td.dropdown').hover(function() {
 $('td.add,td.dropdown').addClass(someclassnamehere);
},function() {
 $('td.add,td.dropdown').removeClass(someclassnamehere);
});

might work.

On Jun 26, 7:00 am, F1LT3R <[EMAIL PROTECTED]> wrote:
> What is hoverGrouping?
>
> "hoverGrouping" would allow somebody to use multiple elements in the
> selector such as...
>
> $('TD.one & TD.two').hoverIntent();
>
> This function would be very useful for work with product tables. I am
> currently trying to create a table that uses hoverIntent on two
> seperate TDs. But when I mouseOut of one TD, I have unHovered from the
> other. As I am sure you are aware, a  element does no allow a
> ,  or any other element to surround multiple  or
> .
>
> The only workaround for this is to create a TD with a COLSPAN
> attribute and put the two elements inside this. However, this by
> definition is obtrusive as it is creating markup that is solely
> intended to modify the styles.
>
> So there's my issue. I would love to get your thoughts on this and
> will put this idea around to the jQuery community in general.


[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-20 Thread Brian J. Fink

Perhaps you forgot to use jquery.extend() to create your rule plugin,
or maybe you should figure out a way to return jquery(jquery.rule)
value instead. When I said "unchainable," I meant that methods of the
rule object break the chain for successive rule() calls, forcing the
coder to insert

;$

to make it work.

As for the glitch with IE7, I don't know if the problem lies with Rule
1.0.1 or jQuery 1.2.6, but even though this statement works in IE7:

 $.rule('a','style').css('color','red');

The following variant:

 $.rule('a','style').append('color: red');

generates the following error message:

Line: 1121
Char: 4
Error: Invalid property value.
Code: 0

On Jun 19, 7:54 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> > Hence the word "unchainable."
>
> What do you mean ? The methods of rule objects are chainable, they
> always return the rule object.
> Of course a rule object doesn't have a 'rule' method that is, in fact,
> the rule constructor.
>
> Is like expecting something like this to work:
>
> $('div').hide().$('p').show();
>
> > Also, your plugin does not work on IE7.
>
> That's odd, I just tried the demo with my IE7 and it worked
> completely, can you describe the problems you find ?
> CSS DOM rules are VERY buggy so there'll always be weak points.
> Specially for animations.
>
> Cheers
> --
> Ariel Fleslerhttp://flesler.blogspot.com/


[jQuery] Re: Validation is not working as expected. Input value deleted!

2008-06-20 Thread Brian J. Fink

@Miguel: It appears you have the RegExp value and the value switched.
Maybe you meant:

$.validator.addMethod('sqldatetime', function (value) {
  return value.test(/^(([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1]
[0-9]|[2]
[0-3]):([0-5][0-9]):([0-5][0-9])|)$/);
}, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss');



On Jun 20, 6:53 am, shapper <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am trying to validate and mask a text box that should contain a
> DateTime in the following format:
>
> -mm-dd hh:mm:ss
>
> The validation is not working as expected. The problem is:
>
>   In a presence of a valid data I deleted a small part of it (ss). The
> mask is revealed for this part.
>   If after deleting a part of the date/time I change the focus to
> another input or submit the form I get:
>   1. A message saying the date/time is invalid (This is expected)
>   2. The entire content of the input disappears. (This is not suppose
> to happen!)
>
> Every time I insert a invalid date I get a message but the date/time
> inserted is deleted. What is going on?
>
> I am testing the date/time in 2 ways: Required and through a method
> that uses Regex:
>
>   // Form validation
>   $("#Edit").validate({
> rules: {
>   UpdatedAt: {
> required: true,
> sqldatetime: true
>   }
> },
> messages: {
>   UpdatedAt: {
> required: "Insert Date/Time",
> sqldatetime: "Check the date/time. Use the format -mm-
> dd hh:mm:ss"
>   }
> }
>   });
>
> And the method sqldatetime is:
>
> $.validator.addMethod('sqldatetime', function (value) {
>   return /^(([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2]
> [0-3]):([0-5][0-9]):([0-5][0-9])|)$/.test(value);
>
> }, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss');
>
> The Regex validates only non empty values. If the value is empty it is
> also valid.
> I have made this so that my method does not conflict with Required and
> allow to have the two options only by adding or not the required rule.
>
> I tried to find the problem but wasn't able to.
>
> Any idea what is going wrong?
>
> Thanks,
> Miguel


[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-19 Thread Brian J. Fink

Hence the word "unchainable."

Also, your plugin does not work on IE7.

On Jun 19, 3:27 pm, "Ariel Flesler" <[EMAIL PROTECTED]> wrote:
> Because .rule is property of jQuery, not a method of Rule objects.
>
> On 6/19/08, Brian J. Fink <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Then why doesn't this statement work:
>
> > $.rule('p{border: 1px solid
> > green}').appendTo('style').rule('a','style').append('color: red');
>
> > Whereas these do?
>
> > $.rule('p{border: 1px solid green}').appendTo('style');
> > $.rule('a','style').append('color: red');
>
> > On Jun 18, 4:32 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> > > I checked now, they ARE chainable.
>
> > > 24 methods are inherited.
>
> > > Cheers
> > > --
> > > Ariel Fleslerhttp://flesler.blogspot.com/
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com


[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-19 Thread Brian J. Fink

Then why doesn't this statement work:

$.rule('p{border: 1px solid
green}').appendTo('style').rule('a','style').append('color: red');

Whereas these do?

$.rule('p{border: 1px solid green}').appendTo('style');
$.rule('a','style').append('color: red');

On Jun 18, 4:32 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> I checked now, they ARE chainable.
>
> 24 methods are inherited.
>
> Cheers
> --
> Ariel Fleslerhttp://flesler.blogspot.com/


[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-18 Thread Brian J. Fink

Well, I was about to accuse you of a design flaw, but when I followed
the examples in the demo page, I discovered the right way, and it
works perfectly, even when there's more style tags than one. I still
say it's a bit awkward.

And no, they are not chainable, but if you make the rule object an
extension of the jQuery object, it will inherit the properties and
methods of the jQuery object and so will be chainable.

On Jun 17, 11:08 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> > Thanks for the pointer! Say, is there a way this functionality could
> > be integrated into jQuery itself?
>
> Nope.
>
> > Can I chain like this?
>
> $.rule returns a Rule object with its own methods. I don't recall if
> the methods are chainable, maybe they are.
>
>
>
> > Also consider that you may want to distinguish between one window's
> > document and another's, as in:
>
> The rules affects the page once it's added to a style or link. Whose
> window is that style/link from, is up to you.
>
> > These might be considered. Also in the demos it is unclear whether the
> > style rule is added to the FIRST tag called "style" or ALL of them,
> > since your page contains only one. This makes a difference, because
> > the style listed last in the document is the one that gets applied.
>
> That's why there is a documentation appart from the demo. The 2nd
> argument of the constructor is the context (just like with jQuery).
> The context can be a selector, a jQuery object, a stylesheet, etc.
>
> Cheers
> --
> Ariel Fleslerhttp://flesler.blogspot.com/


[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-17 Thread Brian J. Fink

@Hamish: Yes, that is what I had in mind, but more like:

$(document).css('p','color: red; border: 1px gray
inset').css('h1','font-size: 200%; text-align: center; text-transform:
small-caps');

On Jun 16, 4:41 pm, Hamish Campbell <[EMAIL PROTECTED]> wrote:
> As an example do you mean:
>
> $(document).css('p', 'color: red').css('h1', 'font-size: 200%');
>
> On Jun 14, 6:13 am, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
>
> > I was tinkering with jQuery when I got an idea: why not have a way to
> > do something like:
>
> > $(document).css(selector,rule);
>
> > Then it could be chained for as many rules as you would wish:
>
> > $
> > (document).css(selector1,rule1).css(selector2,rule2)...css(selectorN,ruleN)­;
>
> > If this is already part of the jQuery functionality, tell me the
> > syntax to use. Otherwise, consider this a submission of a new idea.


[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-17 Thread Brian J. Fink

Thanks for the pointer! Say, is there a way this functionality could
be integrated into jQuery itself? I also think that the structure is
still a little awkward, but I'm glad someone thought of it already.
Can I chain like this?

$.rule('a{text-decoration:none}','style').rule('h2{text-
align:center}','style').rule...

Also consider that you may want to distinguish between one window's
document and another's, as in:

$(document).rule(...)
$("iframe#f1").rule(...)

These might be considered. Also in the demos it is unclear whether the
style rule is added to the FIRST tag called "style" or ALL of them,
since your page contains only one. This makes a difference, because
the style listed last in the document is the one that gets applied.

On Jun 17, 8:42 am, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> There is a plugin for that, it's called Rule:
>
> http://flesler.blogspot.com/2007/11/jqueryrule.html
>
> Cheers
> --
> Ariel Fleslerhttp://flesler.blogspot.com
>
> On 16 jun, 05:32, Olaf Bosch <[EMAIL PROTECTED]> wrote:
>
> > Brian J. Fink schrieb:
>
> > > $(document).css(selector1,rule1).css(selector2,rule2)...css(selectorN,ruleN­);
>
> > > If this is already part of the jQuery functionality, tell me the
> > > syntax to use.
>
> > Yes, it's ON:
>
> >   $("p").css({ color: "red", background: "blue" });
>
> > --
> > Viele Grüße, Olaf
>
> > ---
> > [EMAIL 
> > PROTECTED]://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
> > ---


[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-16 Thread Brian J. Fink

I didn't mean $(element).css(object), I meant $
(document).css(selector,rule). The difference is this: css() as it
stands makes a one-time change to the members of the jQuery object by
adjusting the style attribute of each. When a new element matching the
query string is created, it does not have the desired css values.
Trust me: I've already tested it.

What I'm talking about is a way to directly manipulate the document's
style sheets using jQuery.

On Jun 16, 4:32 am, Olaf Bosch <[EMAIL PROTECTED]> wrote:
> Brian J. Fink schrieb:
>
> > $(document).css(selector1,rule1).css(selector2,rule2)...css(selectorN,ruleN);
>
> > If this is already part of the jQuery functionality, tell me the
> > syntax to use.
>
> Yes, it's ON:
>
>   $("p").css({ color: "red", background: "blue" });
>
> --
> Viele Grüße, Olaf
>
> ---
> [EMAIL PROTECTED]://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
> ---


[jQuery] Re: What point i should take care while upgrading to jQuery 1.2.6

2008-06-13 Thread Brian J. Fink

What version are you using right now?

On Jun 13, 1:00 pm, Dushyant Patel <[EMAIL PROTECTED]> wrote:
> hello,
>
> What point i should take care while upgrading to jQuery 1.2.6?
>
> Can anyone suggest me?


[jQuery] Is there a way to use the css function with $(document) directly?

2008-06-13 Thread Brian J. Fink

I was tinkering with jQuery when I got an idea: why not have a way to
do something like:

$(document).css(selector,rule);

Then it could be chained for as many rules as you would wish:

$
(document).css(selector1,rule1).css(selector2,rule2)...css(selectorN,ruleN);

If this is already part of the jQuery functionality, tell me the
syntax to use. Otherwise, consider this a submission of a new idea.


[jQuery] Can I use $(document).css?

2008-06-13 Thread Brian J. Fink

My first post appears to have gotten lost, so here it goes again.

I was tinkering with jQuery when I got an idea: why not have a way to
use the css function to put new rules into the document, not just
styles on collections of elements? Something like:

$
(document).css(selector1,rule1).css(selector2,rule2)...css(selectorN,ruleN);

If this functionality already exists in jQuery, let me know the
syntax; otherwise, please consider it for an upcoming version.