[jQuery] Re: change element attribute, then have jquery act on that change?

2008-12-22 Thread Kean
Livequery and other event delegation techniques are cool, but, in a matter of simplicity pschwei1 , why don't you try the jQuery toggle event? I think it will definitely work for this case. http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C... On Dec 22, 2:34 pm, Dave Methvin

[jQuery] Re: Smarter way to write this repetitive code?

2008-12-22 Thread Ryura
Right - .each() is still being called internally. You'd need to bind the event to a parent element. On Dec 22, 7:24 pm, Kean shenan...@gmail.com wrote: dbzz, IMO, your code still add a listener to each of the .headline var txt = $('.article-text'); var $hl = $('.headline');

[jQuery] Re: how to select the content of the current table row?

2008-12-22 Thread j0llyr0g3r
Cam Spiers, thank you very much, i adapted your really helpfull example and solved it like this: function clickOnTableRow() { var row = jQuery(this); var songUrl = row.children(td.hidden_url_field_for_track_list).text (); // do other

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Kean
try this, it accounts for checking all the required fields to see if they are blank and disable jQuery(function(){ // all the required text fields var $required = $('input.required:text'); // function checks for blank input var isBlank = function(str) {

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Kean
var checkAllRequired = function () { var allFilled = true; $required.each(function() { if (isBlank(this.value)) allFilled = false; }); return allFilled; } can

[jQuery] Superfish - negative margin on hover in IE

2008-12-22 Thread Brian
I would like to put a negative margin on the hover of the LI's in a superfish jQuery menu on a vertical menu. When I do this, in IE on the hover, the elements go below the rest of the menu. It's fine in Firefox. Here's my starting code: /*** adding sf-vertical in addition to sf-menu creates a

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Dave Methvin
$('input:text.required').each(function() { var val = (this.value.length); if (val == 0) { $('#submit').attr('disabled', 'disabled'); } }); I think this is equivalent to: if ( $(':text.required[value=]').length )

[jQuery] params list

2008-12-22 Thread Dirceu Barquette
Hi, this code return function list: var o = {} for (v in $) { o[v] = $[v]; var Typeof = typeof $[v]; $('divspan'+Typeof+' /spanspan '+v+' /span/div').appendTo('body'); } How to return option list for each class above? thanks Dirceu Barquette

[jQuery] Re: how to display ads after page load

2008-12-22 Thread Dave Methvin
If the ads are fixed in size, define an iframe of that size and have that iframe reference a small html file that includes the ad site javascript. That way the page can continue to load while the ad scripts are running.

[jQuery] Re: params list

2008-12-22 Thread Dirceu Barquette
sorry, I think this is better code for the eg: var Typeof = {}; for (v in $) { Typeof[v] = typeof $[v]; $('divspan'+Typeof[v]+' /spanspan '+v+' /span/div').appendTo('body'); } But, how to list parameters [and,or] options for each function? thanks again!! Dirceu Barquette 2008/12/23

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Rick Faircloth
Thanks, Kean and Dave, for your code suggestions and feedback. And, Dave...yes, I would have preferred, actually, to use Jorn's validation plug-in, but could not figure out a way to cause it to validate on blur. Jorn has set up the default validation to occur after a form is submitted, but I

[jQuery] $({key: value}) functionality?

2008-12-22 Thread Ryura
I'm looking into ways to manipulate Javascript objects using jQuery, and I was wondering if there's anything I can do with the selectors when passing an object to jQuery. For example, $({ obj1: { name: a, prop: x }, obj2: { name: b, prop: y }, obj3: { name: c, prop: z } }).filter('[name=a]');

[jQuery] Re: Rewrite $('slide-images').getElementsByTagName('li'); with JQuery

2008-12-22 Thread Ricardo Tomasi
or simply $('#slide-images li:gt(0)').hide(); Later on you can get the last one with $('#slide-images li:last') (or last-child), or cache the collection. On Dec 22, 8:25 pm, Dave Methvin dave.meth...@gmail.com wrote: Untested, but I think this does it: function init(){   LastPic =

[jQuery] Re: $({key: value}) functionality?

2008-12-22 Thread Ryura
I found out I can do: var data = {}; data.x = { a: [], b: [], c: [], d: [], e: [] } data.x.a.push({ name: foo, num: 0 }); data.x.a.push({ name: foo2, num: 0 }); $(data.x.a).filter('[num=0]') or

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Rick Faircloth
How can this: // all the required text fields var $required = $('input.required:text'); be expanded to include 'input.required:select' ? I tried all the variations I could think of, including: $('input.required:text', 'input.required:select') but that, and every other

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Karl Rudd
From http://docs.jquery.com/Selectors (Forms section): :input Matches all input, textarea, select and button elements. To select all Form elements with a required class: $(':input.required') Karl Rudd On Tue, Dec 23, 2008 at 2:39 PM, Rick Faircloth r...@whitestonemedia.com wrote: How can

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Rick Faircloth
D'oh! I can't believe it was that simple! And I read everything I could find, including the docs on selectors. (Should have read it twice, I guess...) Anyway, question, Karl, et al... How can I validate a select input? I've tried setting the default select value to which I thought would be

[jQuery] SimpleModar overlay container size issue

2008-12-22 Thread Isaac
I have a script that dynamically detects the size (using outerwidth and outerheight) of a div tag that I use as my modal window. It works on all pages of my site except this page: http://www.lacopts.org/dbase/register.php where it erroneously displays the container height, eventhough it is

[jQuery] ui datepicker error onSelect:

2008-12-22 Thread strebel
For the life of me I cannot get this to work: Jquery 1.2.6 and ui 1.6r2 and tried with 1.5.3 stable $('input.tdate').datepicker({onSelect:function(dateText){alert (dateText);} }); Keeps throwing when calendar date is clicked: inst is undefined _get()()jquery-u3.min.js (line 198)

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Karl Rudd
Not quite sure what you're asking. Why would you try to set the select's value? The select gets it's value from the selected child option. My advice would be to use the Jorn's plugin ( http://docs.jquery.com/Plugins/Validation ). From what I can see it seems to do validation on blur by default.

[jQuery] hiding a div using html select (drop down)

2008-12-22 Thread Louie Miranda
I tried to hide the div id=divarea using the toggle() function below. javascript code script type=text/javascript $(document).ready(function() { $(#dropdown).click(function() { $(#divarea).toggle(); }); }); /script html code p select id=dropdown

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Rick Faircloth
The select gets it's value from the selected child option. Perhaps that's why I can't get validation to work! My advice would be to use the Jorn's plugin Believe me, I've tried. I worked with it every way I could think of to disable the default onSubmit event and cause validation only

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Karl Rudd
Have a look at the validate method ( http://docs.jquery.com/Plugins/Validation/validate ) According to the documentation to suppress validation on submission all you need to do is: $('form').validate({ onsubmit: false }); Note: I've never used the plugin before, so this is all untested.

[jQuery] Re: How to get parts of URL after domain

2008-12-22 Thread Wonder95
OK, so if I try using that to set my banner, I come up with something like this: var img = { '/ops/content/services': 'banner2.jpg', '/ops/content/services': 'banner3.jpg', }[location.pathname] || 'banner1.jpg'; $(td#header).css(background,url(/ops/sites/all/themes/

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Rick Faircloth
Yeah, I've read that a dozen times... Here's what I've got that I can't make work: script type=text/javascript $(document).ready(function() { $('#add-rental-property-form').validate({ errorPlacement: function(error, element) {

[jQuery] Re: How to get parts of URL after domain

2008-12-22 Thread Michael Geary
Steve, now I'm really confused. Does it work like a charm, or do you keep getting an error? (Or both?) :-) BTW, you can write $(td#header) as just $(#header) and it may actually be faster because it will use a direct document.getElementById() lookup. Also, just a suggestion, if you get in the

[jQuery] SimpleModal container size problem

2008-12-22 Thread Isaac
I have a script that dynamically detects the size (using outerwidth and outerheight) of a div tag that I use as my modal window. It works on all pages of my site except this page: http://www.lacopts.org/dbase/register.php where it erroneously displays the container height, eventhough it is

[jQuery] Extract Dropdown Menu Items to Array?

2008-12-22 Thread Vik
Is there a way to extract the text of all the items included in a dropdown menu, into an array? Thanks in advance to all for any info.

[jQuery] Re: Can datepicker do individual linking?

2008-12-22 Thread sabastian
Please, can someone inform me if it is possible to have individual html links for each date in datepicker. On Dec 22, 7:42 pm, sabastian sabastiangron...@yahoo.com wrote: For instance if someone chooses 5/5/09 in datepicker I would like them to be linked to one html page. In contrast, if

<    1   2