[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(selec

[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 j

[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] Re: Is there a way to use the css function with $(document) directly?

2008-06-16 Thread Brian J. Fink
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).cs

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

2008-06-17 Thread Brian J. Fink
here 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: >

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

2008-06-17 Thread Brian J. Fink
TECTED]> 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

[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 e

[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 PRO

[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]> w

[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 fo

[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 ;$ t

[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

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

2008-06-26 Thread Brian J. Fink
e 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: > > &

[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 t

[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, wherea

[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 w

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

2008-06-30 Thread Brian J. Fink
Glad I could be of assistance.

[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 >

[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

[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

[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 PROTE

[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. >

[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 ea

[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: 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 */

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

2008-07-02 Thread Brian J. Fink
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. > >

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

2008-07-02 Thread Brian J. Fink
d 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 kno

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

2008-07-02 Thread Brian J. Fink
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 J

[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

[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

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

2008-07-02 Thread Brian J. Fink
ll, 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

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

2008-07-02 Thread Brian J. Fink
.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

[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 kn

[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, { >

[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", funct

[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 fir

[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 pa

[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 PROT

[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

[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 jQuer

[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 effec

[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 y

[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 marke