[jQuery] Re: What is the event when a user presses the enter key anywhere on the page?

2009-12-18 Thread discern
On a similar note, are the up and down arrows always the same keyCode?

[jQuery] Re: How to compare data in 2 jQuery data() elements

2009-12-17 Thread discern
Thanks. I'll give that a go. Otherwise, I'll just write 2 different functions: one for comparison (I'll probably compare hashes using the sha1 plugin) and one for sending the data to the backend.

[jQuery] How to compare data in 2 jQuery data() elements

2009-12-16 Thread discern
When the document.ready fires, this data gets set (simplified for example purposes): function getFields() { var s = { "field1" : $("#field1").val(), "field2" : $("#field2").val(), "field3" : $("#field3").val() } return s; } $("#original-fields").data("fields",getFields()); Then, when so

[jQuery] How to compare data in 2 jQuery data() elements

2009-12-16 Thread discern
When the document.ready fires, this data gets set (simplified for example purposes): [code] function getFields() { var s = { "field1" : $("#field1").val(), "field2" : $("#field2").val(), "field3" : $("#field3").val() } return s; $("#original_data").data("fields",getFields()); [/code] Then

[jQuery] Re: Superfish - Auto Arrows on sub menus only?

2009-12-10 Thread discern
No problem, but I think I should correct my previous comment. This is unnecessary if your menu is id"nav" as it would do nothing, as it assumes your unordered list has the CLASS of sf-menu: $("ul.sf-menu").superfish({ autoArrows: false }); And the first superfish block in my example above shoul

[jQuery] Re: Superfish - Auto Arrows on sub menus only?

2009-12-10 Thread discern
You can put it right after the place where you call superfish to begin with. It's just a built-in option for superfish. For example the top of your document might look something like this: My Page $('#nav').superfish({ delay:750, speed:'fast' }); $('#nav>li>a span').r

[jQuery] Re: Modifying a CSS class's properties

2009-11-19 Thread discern
I don't know if that is possible (although almost anything, it seems, is possible with jQuery), but what if you had a secondary class in your CSS and used addClass('secondary') to the element. It would inherit styles from the original and apply the secondary styles.

[jQuery] Before/Append/Prepend/After Margin Rendering Bug?

2009-11-19 Thread discern
I have a large div with several divs (they mimic s). In those are two input type="text" fields and two buttons. None of the elements are floating, but the "buttons" are actually s that are display: inline- block. If I .prepend() or .after() a new div to one of the existing divs (using the function

[jQuery] Re: UI Dialog: Need the ID of the clicked button...

2009-11-18 Thread discern
Use a global. Makes more sense than my solution. Thanks. I always forget about globals.

[jQuery] Re: UI Dialog: Need the ID of the clicked button...

2009-11-18 Thread discern
Solved my own problem (again). For anyone else with a similar question, just add a hidden field to your dialog form: ... Then, in the click event, add: $("#id").val(id); after the dialog('open') line. The final result is: var opt = { autoOpen: false, modal: true, b

[jQuery] UI Dialog: Need the ID of the clicked button...

2009-11-18 Thread discern
Because I am using the CLASS of the button to open UI Dialog (as opposed to the ID), how can I pass it the ID (or any data, for that matter)? I need to pass the ID of the button to dialog so I know which row to apply the actions of the dialog to. var opt = { autoOpen: false, modal:

[jQuery] Re: Superfish - Auto Arrows on sub menus only?

2009-11-13 Thread discern
Perfect. Thank you!

[jQuery] Re: Superfish - Auto Arrows on sub menus only?

2009-11-12 Thread discern
Thanks, but I now realize my question was not terribly clear. Superfish has the autoArrows option, but that adds arrows to ALL the list items having sub list items, at any level. What I would like is to only add arrows (with Superfish's autoArrow option) to list items that happen to have a sub-lev

[jQuery] Superfish - Auto Arrows on sub menus only?

2009-11-11 Thread discern
Anyone know of a quick way to apply auto arrows to ONLY the sub menus, while leaving the top-level list items sans-arrow?

[jQuery] Re: SUPERFISH - drop-downs sticking open in Safari

2009-11-11 Thread discern
Problem solved. Apparently, Safari handles position: static differently than other browsers, including other webkit browsers. I had the following CSS to prevent *this exact problem* in IE7: #nav li:hover,#nav li.sfHover { position: static; } When I removed it, the sticky menus vanished from Safa

[jQuery] Re: SUPERFISH - drop-downs sticking open in Safari

2009-11-11 Thread discern
Screenshot: http://www.postimage.org/image.php?v=Ts1jTUUi

[jQuery] SUPERFISH - drop-downs sticking open in Safari

2009-11-11 Thread discern
The suckerfish menu on my site, enhanced with Superfish, works great in Firefox (Win, Mac & Linux), Opera 9 Win, Konqueror, Chrome and, surprisingly enough, IE 7 and 8. But the menus are sticking open in Safari 4 Mac and Windows. I have several jQuery plugins, plus my own .js file. All are include