[jQuery] Referring to the current DOM object in a jQuery method parameter list

2009-12-31 Thread Nathan Klatt
Hi y'all,

I have a case where I want to do something like:

$(#someId).text($(#someId).attr(alt));

I can avoid making duplicate selections like this:

var someId = $(#someId);
$someId.text($someId.attr(alt));

But, that seems like too much code for jQuery. :) I want something
like:

$someId.text(self.attr(alt));

This doesn't work:

$someId.text($(this).attr(alt));

Does that functionality exist and I just couldn't find it in the docs?

Thanks.


Re: [jQuery] $.ajax - different results in Chrome and Safari.

2010-01-02 Thread Nathan Klatt
On Sat, Jan 2, 2010 at 1:13 AM, bookmarc mmelc...@gmail.com wrote:
 The following code gives a a parser error in Google Chrome and
 Firefox but seems to work in Safari.  Can anyone see what I am doing
 wrong or understand why this is happening?

I see a couple things that make me wonder:

 header
 ...
 /header

Maybe this was just a transcription oops, but drop the ers.

                diagnostics: false

True booleans shouldn't have quotes around them, though it could be
your server wants them in string form for some reason, I suppose.

Good luck.

Nathan


Re: [jQuery] Another Why doesn't this work in IE

2010-01-04 Thread Nathan Klatt
Is it okay if the load happens immediately after the data is posted?
Or will it be loading something based on the DB actions having been
successful completed? As it is it's not waiting for the post to
complete before issuing the load.

Nathan


Re: [jQuery] Another Why doesn't this work in IE

2010-01-04 Thread Nathan Klatt
Then I'd say you ought to try making the load the callback of the post
and see if that works, something along the lines of:

$(#TOAppr).live(click, function() {
$.post(webapps/hr/admin/actions/act_adminHR_handler.cfm, {
desc: $(this).attr('desc'),
pk: $(this).attr('pk')
},
function() {

$(#content-box).load(webapps/hr/admin/display/dsp_timeOffApprove.cfm?dept=+dept+ap=1);
});
return false;
});


Re: [jQuery] Need your opinion you ALL!!!

2010-01-07 Thread Nathan Klatt
 Someone wants me to use FULL DIRECTORY PATHS for every page

Assuming you're generating your html on the back-end, just use a
variable for the base URL and no worries.

Stict with UNIX through the learning curve and I guarantee you'll
never go back, at least not voluntarily. :)

Nathan


Re: [jQuery] The form is not submitted onKeyDown

2010-01-07 Thread Nathan Klatt
On Thu, Jan 7, 2010 at 11:04 AM, Andre Polykanine wrote:
 var validator=$(#myform).validate( { snip });

 $(document).keydown (function (e) {
if (e.ctrlKey  e.which==13) { validator.form(); }
 });

 then I'm trying to submit. If I do something wrong (for example, leave
 a required field blank) and press Ctrl+Enter, Validator gently tells
 me that yes, that field is required, go on and fill it in. But if I
 fill in the field and do everything correctly, pressing Ctrl+Enter
 gives absolutely nothing: no errors and no submit.

It's not submitting because you never tell it to. I would first try
replacing the call to validator.form() with $(#myform).submit(). I
would assume that does the validation check first. In case doing that
bypasses the validation, check the return value of validator.form()
and submit if it's successful, a la: if (validator.form())
$(#myform).submit();.

Nathan


Re: [jQuery] Re: can anchor tag be used in jquery to define areas

2010-01-11 Thread Nathan Klatt
On Mon, Jan 11, 2010 at 10:36 AM, Oliur o.r.chowdh...@gmail.com wrote:
 I am trying to figure out how would the user sees Faq section as they
 click on the link. Problem is Home is the default tab not the FAQ one
 and hence not visible by default.

Hopefully someone will post a better solution but what I do is check
for the hash in the URL then, if I find one, call
$(#+tabFromHash).click().

Nathan


Re: [jQuery] Re: long-term browser support strategy

2010-01-11 Thread Nathan Klatt
 IE 6 use is 3 times that of Safari (all versions) depending on whose
 statistics you believe. Why not drop support for Safari while you're
 at it? And Opera and Chrome?

Because you don't have to do anything to support Safari or Chrome or
Opera - they actually work. To stop supporting them you'd have to stop
supporting standards.

 I work with several clients that do
 not want to lead the way in this respect, and need to support IE6 as
 long as it has a fair usage share, which may be for several more
 years.]

 That is a sensible decision

Anyone clinging to IE6, at this point, has gone wy beyond not
leading the way!

Nathan


Re: [jQuery] getScript - Site does not finish loading?

2010-01-12 Thread Nathan Klatt
On Tue, Jan 12, 2010 at 3:53 AM, chricke c.beckm...@vectan.de wrote:
 as i understand the getScript function should be asyncronous, but when
 i use it the website won't finish loading (in firefox).
snip
        function getCounter(){
                jQuery.getScript('http://example.com/counter?id='+get_url_param
 ('id'), function(){
                        jQuery('#counterfu_online_count').text(count);
                        getCounter();
                });
        }
        getCounter();
 });

 getCounter() calls itself so the counter this script is used for is
 updated - all works well, just the page keeps loading...

 so whats the problem here? why does the website not finish loading?

Okay, you acknowledge you've got a recursive function there (sorta -
is there a special term for recursion through a callback like that?
Anyone?) but do you admit to infinite recursion? If so, could you
point us to a page that causes the problem? Or expound on what you
mean by the page keeps loading? 'Cause, yeah, it's gonna do that as
written. :) You need an exit case for the recursion, possibly
something like the below, though it's hard to comment when I'm not
sure what the reason is to get the same script two times.

var getCounterCount = 0;
function getCounter() {
++getCounterCount;
jQuery.getScript(
'http://example.com/counter?id='+get_url_param('id'),
function() {
jQuery('#counterfu_online_count').text(count);
if (getCounterCount  2) getCounter();
});
}

Nathan


Re: [jQuery] Get Value. Please, is kind of urgent. Thanks.

2010-01-12 Thread Nathan Klatt
Like so?

if (GBrowserIsCompatible()) {
   var gmapsUrl = /Google/Map;
   if ($(#Place).val())
  gmapsUrl += /+$(#Place).val();
   $.getJSON(gmapsUrl, Initialise);
}


Re: [jQuery] Re: Get Value. Please, is kind of urgent. Thanks.

2010-01-12 Thread Nathan Klatt
On Tue, Jan 12, 2010 at 3:42 PM, shapper mdmo...@gmail.com wrote:
 And is there a way to check if GBrowserCompatible is valid?

From http://www.idealog.us/2007/02/check_if_a_java.html:

if (typeof(yourFunctionName) == 'function') yourFunctionName();

Nathan


Re: [jQuery] Append prepend?

2010-01-12 Thread Nathan Klatt
On Tue, Jan 12, 2010 at 4:36 PM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I cant seem to understand the logic behind these functions. append prepend
 appendTo, prependTo

Methinks you're very close! This what you're getting at?

http://jsbin.com/elaja/edit

Nathan


Re: [jQuery] Are numerical properties/indexes supported?

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 2:03 AM, Dean deanpe...@gmail.com wrote:
 Any jQuery object currently has numerical properties/indexes that
 store references to the DOM node elements matched in the search.
 (E.g., $(div)[0] is a reference to the first matched DOM node
 element in the search.) Can we rely on these properties remaining in
 jQuery indefinitely?

Every time $(div) is executed, it queries the DOM. If you want to
save the results, save them: var divs = $(div). Then, access them in
the documented way: divs.eq(0). If brackets work now, as they are not
mentioned in the documentation then, no, you can't count on that
working in the future.

Nathan


Re: [jQuery] Converting a javascript to jQuery

2010-01-13 Thread Nathan Klatt
This is totally untested but I expect it should look something like the
below.

Nathan

function initShowHideDivs() {
  $(div.breakbg).each(function(breakbgIndex) {
this
  .click(showHideContent)
  .attr(id, ssdm+breakbgIndex)
//  .className==ssdhead
  .next(div)
.attr(id, ssds+breakbgIndex)
.css({display:none, height:1px})
.find(div).eq(0)
  .css(top, (0-contentDiv.offsetHeight)+px
  .addClass(ssdcontent)
  .attr(id, ssdsc+breakbgIndex);
  });
}

// I imagine this could be further jQuerified but, not knowing what your
needs are...
function showHideContent(e, inputId) {
  if (yatrassd_slideInProgress) return;

  yatrassd_slideInProgress = true;

  if ( ! inputId ) inputId = this.id;
  var numericId = inputId.toString().replace(/[^0-9]/g,);
  var answerDiv = $(#ssds + numericId);
  var imgId = $(#arrowimg + numericId);

  objectIdToSlideDown = false;

  if (answerDiv.is(:visible)) {
 slideContent(numericId, (yatrassd_slideSpeed*-1));
 yatrassd_activeId = false;
 imgId.src=/yatra_blue-theme/images/hotel/ssdarrowdown.gif;

  } else {
imgId.src=/yatra_blue-theme/images/hotel/ssdarrowdown.gif;

if (yatrassd_activeId  yatrassd_activeId != numericId) {
  objectIdToSlideDown = numericId;
  slideContent(yatrassd_activeId,(yatrassd_slideSpeed*-1));
  imgId.src=/yatra_blue-theme/images/hotel/ssdarrowup.gif;

} else {
  answerDiv.show();
  imgId.src=/yatra_blue-theme/images/hotel/ssdarrowup.gif;
  slideContent(numericId,yatrassd_slideSpeed);
}
}


Re: [jQuery] Cloning a table row that is not in a table

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 9:15 AM, RhythmicDevil rhythmicde...@gmail.com wrote:
 So it seems I can only select a row if its in a table? That makes no
 sense?

Makes perfect sense; a table row cannot exist outside of a table.

Nathan


Re: [jQuery] Re: Cloning a table row that is not in a table

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 11:36 AM, RhythmicDevil rhythmicde...@gmail.com wrote:
 I did not think the selectors would enforce that.

It's not the selectors; the problem is the tr never makes it into the
DOM because the invalid html gets ignored by the browser. Because the
tr isn't in the DOM, the selector has no chance of finding it. :)

Nathan


Re: [jQuery] please can you help me with with :contains? :)

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 10:54 AM, happysmile francesca.manc...@gmail.com
wrote:
 It works only the first time you click on the button (changes from
 'show' to 'hide'), while it remains almost always 'Hide' in all the
 following clicks.

This won't help you understand :contains but I think it does what you want:

http://jsbin.com/udesu/edit

Assuming this markup:
p
  button class=show_profileShow details/button
  span class=directors_details style=display:none
br /details details details/span/p

The code:
$('.show_profile').click(function() {

  // toggle link class to change the arrow background image
  var jThis = $(this)
.toggleClass(hide_profile);

  // toggle visibility profile
  var jDetails = jThis.next('.directors_details')
.toggle();

  // change show/hide text in the link
  if (jDetails.is(:visible)) {
jThis.text(jThis.text().replace('Show','Hide'));
  } else {
jThis.text(jThis.text().replace('Hide','Show'));
  }

  return false;
});

Nathan


Re: [jQuery] Re: Cloning a table row that is not in a table

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 11:58 AM, RhythmicDevil rhythmicde...@gmail.comwrote:

 If its not in the DOM why do I see it in the source? I am having a
 disconnect here. I have fixed it as I said above. But I am curious I
 thought the DOM represented the HTML that is present at load time.


Maybe I misunderstand what you mean by in the source - do you mean when
you do a View | Source it's there? Because that is merely the text sent by
the server to the browser. It's what the browser uses to generate the DOM,
it is not the DOM itself. Know what I mean?

Nathan


Re: [jQuery] Sceptic about JQuery

2010-01-13 Thread Nathan Klatt
Using a Javascript framework is definitely a Good Thing. It allows you to
step back and focus on what you want to do rather than on the details of
getting it done in a way that will work efficiently, in various browsers,
etc. Unless there's some external force compelling you to use jQuery, it
would be a good idea to at least consider the alternatives, a good starting
point being the Wikipedia entry, of course,
http://en.wikipedia.org/wiki/JavaScript_library.

Nathan


Re: [jQuery] javascript loaded via ajax

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 1:53 PM, nihal nihal.c...@gmail.com wrote:
 is there anyway to remove the newly added function from the dom?

Wrap the code you want to be removeable in its own script element,
give it an id, then remove it just like any other element. As has been
discussed today, removing it doesn't mean *poof* it's gone, just that
it could be removed by the garbage collector, so you'll likely be able
to continue calling the function after it's been removed.  See:

http://jsbin.com/ixite/edit

script id=removeMe type=text/javascript
  function hello(msg) { alert(msg); }
/script

script type=text/javascript
$().ready(function() {
  hello(one);
  $(#removeMe).remove();
  hello(two);
  setTimeout(hello('three'), 2500);
});
/script

The code gets removed from the DOM (verified using Firebug) but the
function still works 2.5 seconds later.

Nathan


Re: [jQuery] javascript loaded via ajax

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 6:45 PM, Michael Geary m...@mg.to wrote:
 In your example, the hello function will never be garbage collected, because
 the window object has a property named 'hello' that holds a reference to the
 function.

Thanks for the correction.

Nathan


Re: [jQuery] Re: hide() works fine - fadeOut() is not working - Don't understand....

2010-01-17 Thread Nathan Klatt
On Sun, Jan 17, 2010 at 6:17 AM, Reinhard Vornholt
reinhard.vornh...@gmail.com wrote:
 After switching to jQuery 1.4 everything works fine.
 My guess is, that it had something to do with the css of my div. It
 had a position:fixed attribute. But thats just a guess.

Glad you got it figured out but it wasn't the position:fixed styling
or, at least, not only that.

http://jsbin.com/esado/edit

I just like to play on JSBin. :)


Re: [jQuery] some basic questions

2010-01-17 Thread Nathan Klatt
On Sat, Jan 16, 2010 at 12:03 AM, Enoch enochelli...@gmail.com wrote:
 I have a tabbed page using jquery themes with the tabs structured as
 lis.  The first tab has a form that you can fill out.
 The second tab, when clicked is supposed to bring up a summary of your
 form and offer a submit button.

Aside from the jQuery documentation (http://docs.jquery.com/) I have
no specific tutorials to recommend. If it helps, though, I've
implemented a quick, but annotated, example of what you described:

http://jsbin.com/aqoti/edit

Good luck and have fun!

Nathan


Re: [jQuery] background mouseover fade effect

2010-01-17 Thread Nathan Klatt
On Tue, Jan 12, 2010 at 4:25 PM, 1.am.W1z4rd 1.am.w1z...@gmail.com wrote:
 I need to add a mouseover effect to the navigation for a site that I'm
 building.  I need the backgroundColor to fade from none, to black, and
 then on mouseout, I need it to fade back to none.  This would be easy
 if I were using two colors, but since I'm using 'none' as one

You probably figured something out for this by now but, if not, one
kinda ugly way would be to position a black div behind the element,
hide it, and fade it in on mouseover and back out on mouseout...

Nathan


Re: [jQuery] Select part of text and add a CSS class

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 6:02 AM, Mircea i...@amsterdamsat.com wrote:
 I am trying to create my first jQuery script. I want to have a text in
 a p, select it with the cursor and add a class to it. I know that I
 can use the .select and .addClass functions.

I bet you need to wrap the selected text in a span - you can't apply a
class to an arbitrary block of text, you know?

Might not be the only problem with your script but I bet it's at least
part of it. :)

Good luck,

Nathan


Re: [jQuery] Validation plugin

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 4:55 AM, perkin5 mshe...@btinternet.com wrote:
 http://www.richardbarnfather.co.uk/esu/php/booking_mike.php

 All fields have a class of 'required' and the email field has

The fields that aren't validating have typos in the class setting -
they're missing the equals sign: classrequired instead of
class=required.


Re: [jQuery] Re: SlideDown Issue.. help!

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 6:19 AM, for...@gmail.com for...@gmail.com wrote:
 Hi, can you tell me the alternative to make it only work on the select
 'a'

Simplest way is to give the 'a' an id:

a id=alias-box-link href=#alias-box
style=font-size:10px;Custom Alias/a

Then set its click handler this in the Javascript like this:

$('a#alias-box-link').click(function () {

Otherwise, depending on what else you have going on, you could do
something like what Waseem suggested or something like this example:

http://jsbin.com/aqoti/edit

Nathan


Re: [jQuery] new forums used?

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 10:05 AM, Octavian Rasnita orasn...@gmail.com wrote:
 If some of the users won't like the forum, they would be able to use the
 mailing lists, while if other users wouldn't want to receive the emails from
 the mailing list they could just unsubscribe, so the mailing lists won't
 hurt anyone.

The mailing list is great but what's expected to happen shortly after
they stop moderating it, reportedly a significant effort, is the list
will be overrun by spammers. Hopefully their fears are unfounded but
I'm not holding my breath.

Nice knowin' y'all. ;)

Nathan


Re: [jQuery] JQuery Trigger Event

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 10:30 AM, ashar udeen asharud...@gmail.com wrote:
 $('#parent1').trigger(click);

 This code seems to be work in Firefox. But when I tried the same in
 IE8, it does not work. Could any one update me, how to fix this.

Have you tried just $('#parent1').click()?


Re: [jQuery] $.ajax call doesn't complete on 400 bad request response

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote:
 Can't seem to get any response from an ajax call which response is 400
 Bad Request

      $.ajax({
               url: url
               type: GET,
               dataType: json,
               success: aj.dataLoaded,
               error: function() {
                 alert(error);
               },
               complete: function() {
                 alert(complete);
               }
             });

 When server responds with error code 400 neither the error function
 nor the complete function is called, any tips on how to correct this?

What is aj.dataLoaded doing? I believe a 400 will go to the success
callback; after that finishes (assuming it does so :) it should call
the complete callback. Can the call to complete be disabled by
returning false from the success/error callback?

Nathan


Re: [jQuery] $.ajax call doesn't complete on 400 bad request response

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote:
 Can't seem to get any response from an ajax call which response is 400
 Bad Request

      $.ajax({
               url: url
               type: GET,

Hey, is that missing comma after url a typo?

Nathan


Re: [jQuery] Re: selected accordion background

2010-01-18 Thread Nathan Klatt
Pasquale,

Looks like it no longer sets the class to selected for you; just gotta
do it yourself.

On Mon, Jan 18, 2010 at 12:31 PM, spiderling webmas...@spiderling.ca wrote:
 bump :-)

 On Jan 15, 7:13 pm, spiderling webmas...@spiderling.ca wrote:
 I'm using an accordion which functions perfectly. I was using jQuery
 1.2.6 with UI 1.6 and was able to have a different background image
 displayed when the section was expanded using .selected. I upgraded to
 jQuery 1.3.2 with UI 1.7.2, and the selected / expanded background
 image no longer works. Everything else works fine. Any suggestions on
 how I can get it working again with 1.3.2 and 1.7.2?

 Thanks
 Pasquale

 // jQuery
 script type=text/javascript
 $(document).ready(function(){
         $(#accordion1).accordion({
                 active: false,
                 header: '.heading',
                 collapsible: true,
                 autoHeight: false
         })
  .bind('accordionchange', function(event, ui) {
$(ui.oldHeader).removeClass(selected);
$(ui.newHeader).   addClass(selected);
  });
});
 /script

Nathan


Re: [jQuery] Re: Validation on a Modal form does not work

2010-01-18 Thread Nathan Klatt
 On Jan 7, 10:39 am, Elan Noy elan...@gmail.com wrote:
 I have amodalform that I want to validate.
 Themodalis based on the simplemodalplugin and thevalidationis
 based onvalidationplugin.
 Thevalidationworks well on a regular (nonmodal) form. ANy ideas?

  script type=text/javascript
             jQuery.validator.addMethod(zip, function(value, element)
 {
                 return this.optional(element) || value.match(/^((\d{5}-
 \d{4})|(\d{5})|([a-z]\d[a-z]\s?\d[a-z]\d))$/i);
             }, US or Canadian postal code only);
             $(document).ready(function(){
                 getaddressBook();
                 $(#addAddress).validate({

Could it be simply that the document is already ready so your ready
function is not being called? Try executing the contents of the ready
function inline?

Nathan


Re: [jQuery] need help with simple jQuery problem

2010-01-19 Thread Nathan Klatt
That seems like a lot of code for something so simple. Why don't you
just follow the example from the docs:

http://docs.jquery.com/Effects/slideToggle#speedcallback

?

Nathan


Re: [jQuery] JQuery Trigger Event

2010-01-19 Thread Nathan Klatt
On Tue, Jan 19, 2010 at 10:03 AM, Asharudeen asharud...@gmail.com wrote:
 Unfortunately, It seems trigger is not a issue.. I am trying to list dynamic
 file tree using JQuery. It seems to be work fine in Firefox. But in IE, it
 has not working.. I thought it is related to trigger event.

It might be worthwhile for you to put together a simple example on one
of the collaborative Javascript sites (e.g., http://jsbin.com) so
others on the list can easily see it for ourselves and play around.

Nathan


Re: [jQuery] Simplae JQuery/Ajax question - GET variables

2010-01-19 Thread Nathan Klatt
On Tue, Jan 19, 2010 at 11:06 AM, parot russ...@parotkefalonia.com wrote:
 What I cannot do and I do not seem to get a sensible, easy to follow and
 understandable answer from knowledgeable JQuery people is find out how to
 pass the valiable trythis to the page tryit.php and then return the result,
 in this case a simple php echo.

I must misunderstand you...

var trythis = 57;
$.get(tryit.php, { trythis: trythis }, function(data) {
$(#resultsGoHere).html(data); });

Nathan


Re: [jQuery] Simplae JQuery/Ajax question - GET variables

2010-01-19 Thread Nathan Klatt
On Tue, Jan 19, 2010 at 11:32 AM, parot russ...@parotkefalonia.com wrote:
 Very near, but it is more basic than that - how do I get the variable
 ?trythis=changable value into var trythis=;

Maybe a sequence diagram would be helpful. Here's what I hear you asking:

http://www.websequencediagrams.com/?lz=bm90ZSBsZWZ0IG9mIHdlYnBhZ2U6IG1lIGZpcnN0IQpKYXZhc2NyaXB0LT50cnlpdC5waHA6IHRyeXRoaXMgPSA1NwoAPwVyaWdoAEAFABsLU2ltcGxlIGVjaG8gb2YgdmFyaWFibGUANggKAEgJLS0-AF8KOiA1NwBrDQCBDgkACQ8AexUic29tZXRoaW5nIGVsc2UiAExSAFERAIEXFQB3EQs=default

Could you modify that to better explain what you mean, maybe?

Nathan


Re: [jQuery] Simplae JQuery/Ajax question - GET variables

2010-01-19 Thread Nathan Klatt
On Tue, Jan 19, 2010 at 1:45 PM, parot russ...@parotkefalonia.com wrote:
 I want to scroll back and forward through the months on a calendar without
 refreshing the page. I have the php calendar, but I don't want any page
 refresh which I can do with PHP and just send the GET to the page.  so
 ideally what I need is 2 links back and forward with the month variable i.e.
 1-12 (Jan - Dec) passed to JQury/Ajax. I have been looking at a number of
 scripts, but all to far complex (i.e. do more than I need) just I cant
 fathom out how to pass Back (Jan go to Dec) or Forward (Jan go to Feb) and
 so on. just need 1 month at a time, nothing fancy etc.

How's about something like this?

button id=prevMonthPrevious month/button
div id=calendar/div
button id=nextMonthNext month/button

script type=text/javascript
var currentMonth = 1;
function loadMonth(newMonth) {
   $(#calendar).load(getCalendar.php?m=+newMonth);
}
$().ready(function() {
   loadMonth(currentMonth);
   $(button#prevMonth).click(function() { loadMonth(--currentMonth); });
   $(button#nextMonth).click(function() { loadMonth(++currentMonth); });
});
/script


Re: [jQuery] (Validate) Checking once an Entry is Change

2010-01-19 Thread Nathan Klatt
On Sat, Jan 16, 2010 at 6:42 PM, Scott Wilcox sc...@tig.gr wrote:
 Pastebin of code: http://pastebin.com/ma643a4e

Hiya Scott,

What's the code at the other end look like - i.e., /api/check/existac?

Nathan


Re: [jQuery] Multiple elements slider

2010-01-19 Thread Nathan Klatt
On Tue, Jan 19, 2010 at 1:39 PM, Mircea i...@amsterdamsat.com wrote:
 I have one slider that have to resize font-size on 4 different
 elements. At this time it works on all 4 of them (span) but I would
 like to make it work for any individual element that is selected.

Have your selector add/remove a class, say, resizeable, then modify
the slider to only manipulate elements with that class, a la:

   onChanging: function(percentage, e) {
   $(.resizeable).css('font-size', maxFont * percentage);

Nathan


Re: [jQuery] Simplae JQuery/Ajax question - GET variables

2010-01-19 Thread Nathan Klatt
On Tue, Jan 19, 2010 at 2:29 PM, parot russ...@parotkefalonia.com wrote:
 so you could have something like

 $(button#prevMonth).click(function() {
 loadMonth(--currentMonth),loadYear(--currentYear); });

Well, to handle year and month you'll want something like:

var currentMonth = 1;
var currentYear = 2010;
function deltaMonth(delta) {
   currentMonth += delta;
   while (currentMonth  1) {
  --currentYear;
  currentMonth += 12;
   }
   while (currentMonth  12) {
  ++currentYear;
  currentMonth -= 12;
   }
}


Re: [jQuery] Selection broken in Firefox 3.5.7

2010-01-19 Thread Nathan Klatt
On Tue, Jan 19, 2010 at 2:31 PM, Jeff fnd...@gmail.com wrote:
 if ($(input[type='checkbox'][checked]).size() == 0)

Think you want:

if ($(input[type='checkbox']:checked).size() == 0)

Nathan


Re: [jQuery] Validate jquery plugin problem

2010-01-19 Thread Nathan Klatt
2010/1/19 Niagara keit...@libero.it:
 My code with  jQuery validation plug-in 1.5 work correctly, but with
 the new version NO.

In what way does it not work? False positives? False negatives?
Console errors or silent refusal? Help us to help you. ;)

Nathan


Re: [jQuery] jquery iframe hide div

2010-01-19 Thread Nathan Klatt
Assuming you do not control the content you're embedding in the
iframe, online consensus seems to be that you are SOL.

http://www.google.com/search?q=css+apply+iframe+contents

On Tue, Jan 19, 2010 at 4:05 PM, DOTS D.O.Technology Services
dotsbulk...@gmail.com wrote:
 hello all any one on this ?

 On Wed, Jan 20, 2010 at 1:34 AM, DOTS dotsbulk...@gmail.com wrote:

 hello

 these days i am also working on same and trying to hide few of the div
 inside the iframe of some other domain. just  wanted to know can you
 help me with the solution.

 Thanks


Re: [jQuery] Re: Multiple elements slider

2010-01-19 Thread Nathan Klatt
On Tue, Jan 19, 2010 at 3:12 PM, Mircea i...@amsterdamsat.com wrote:
 This is strange,
 The element is selected after I had click and drag it, change its
 position. It have the class 'selected' dynamically added to it. If I
 create another static element div class=selectedSome text/div -
 the text resize work on that new element.

You need to have the selector inside of the handler - if you select
it, save it off in a variable, then reference the variable in the
handler, it will be referring to whatever met the selector when it was
executed. E.g.,

onChanging: function(percentage, e) {
   $(.resizeable).css('font-size', maxFont * percentage);

not

var resizeable = $(.resizeable);
onChanging: function(percentage, e) {
   resizeable.css('font-size', maxFont * percentage);

You know?

Just a thought.

Nathan


Re: [jQuery] jQuery + select

2010-01-20 Thread Nathan Klatt
On Wed, Jan 20, 2010 at 12:34 AM, Mateo matthew.kim...@gmail.com wrote:
 var selectedId = $(#mySelectElement).val();

Returns the value of the select element but you want the value of the
selected option element under the select, hence:

 var selectedId = $(#mySelectElement :selected).val();

Nathan


Re: [jQuery] replaceWith bug in jQuery 1.4?

2010-01-20 Thread Nathan Klatt
On Wed, Jan 20, 2010 at 8:43 AM, teknoFX shmuel...@gmail.com wrote:
 There appears to be a bug in the jQuery 1.4 implementation of
 replaceWith.  If you try to replace an element with just plain text,
 jQuery removes the element altogether and does not swap in the text.

From the replaceWith documentation, emphasis mine: Replaces all matched
elements with the specified HTML or DOM elements. This returns the JQuery
element that was just replaced, *which has been removed from the DOM*.

Nathan


Re: [jQuery] Bindind keydown function to a form - submit on keydown (value change)

2010-01-20 Thread Nathan Klatt
function setFamily() {
  $('#family').css('font-family', $('#family :selected').val());
}
$().ready(function() {
  setFamily();
  $('#family').bind(change keypress, setFamily);
}

As a bonus, this will work if they press the first letter of the
option they're selecting - it's all good. :)

Nathan


Re: [jQuery] Re: Bindind keydown function to a form - submit on keydown (value change)

2010-01-20 Thread Nathan Klatt
On Wed, Jan 20, 2010 at 11:20 AM, Mircea i...@amsterdamsat.com wrote:
 Thanx Nathan,
 It works. It does change the class to the #family form. Is it possible
 to make it change the class to the Option element?

You mean style the option element?

function setFamily() {
  $('#family :selected').parent().andSelf()
.css('font-family', $('#family :selected').val());
}
setFamily();
$('#family').bind(change keypress, setFamily);

http://jsbin.com/agifi/edit

Nathan


Re: [jQuery] Re: Bindind keydown function to a form - submit on keydown (value change)

2010-01-20 Thread Nathan Klatt
Sorry,

function setFamily() {
  $('#family').css('font-family', $('#family :selected').val());
}
$(#family option).each(function() {
  $(this).css('font-family', $(this).val())
});
setFamily();
$('#family').bind(change keypress, setFamily);

http://jsbin.com/agifi/2/edit

Nathan


Re: [jQuery] Jquery and Dynamic assignment

2010-01-21 Thread Nathan Klatt
On Wed, Jan 20, 2010 at 2:54 AM, West415 malik.robin...@gmail.com wrote:
 My question is how can I use jquery to assign click handlers without having
 to do this:

 cfloop from=1 to=5 index=i
 button id=create-user_#i# click=createUser(#user_id#)Create
 User/button
 button id=create-user_#i# click=createUser(#user_id#)Create
 User/button
 /cfloop

Should be able to make something like this work:

$(button.createUserLink).click(function() {
  createUser(this.id);
});

Nathan


Re: [jQuery] Putting a table inside a HTML drop down select box

2010-01-21 Thread Nathan Klatt
On Thu, Jan 21, 2010 at 12:16 PM, fachhoch fachh...@gmail.com wrote:
 is there any way to put table inside a  HTML drop down select box

If you were to carpet Florida, how long would it take to vacuum?

Err, what I meant to say is, why would you want to do that? What
functionality are you hoping for?

Nathan


Re: [jQuery] Re: New Forums

2010-01-22 Thread Nathan Klatt
On Fri, Jan 22, 2010 at 3:13 PM, John Arrowwood jarro...@gmail.com wrote:

 What if the forums were 'published' to the mailing list, and the mailing
 ...
 The mailing list could be set up so that nobody except the forum 'bot' could
 post to it, which would make spam go away.  People that have accessibility
 issues or just prefer to get their information via their email client could
 continue to read things that way.  And you would have all of the benefits of
 the forum.

Oo! Man with a plan.


Re: [jQuery] This code is too complex for a noob, can someone break this down.

2010-01-22 Thread Nathan Klatt
On Fri, Jan 22, 2010 at 6:57 PM, Bugman1400
trae.be...@coachmanridge.com wrote:
 javascript:void(0);  } ,function(data){ $(#approve? echo $rrows['id'];
 ?).html(data); });' ? });'Approve

 The do.php is a query that updates a database and sets an Approve column to
 '1'.

More context plz, that fragment makes no sense.


Re: [jQuery] loading osx (eric martin) to show errors

2010-01-24 Thread Nathan Klatt
On Sun, Jan 24, 2010 at 8:22 AM, infojava infojava2...@gmail.com wrote:
 i use a link (wich shows the demo) wich i should active if an error
 occures, but it doesn't work !!!

Wrap it in a $().ready function?

$().ready(function() { $(#osx).click(); });


Re: [jQuery] iframe on another iframe

2010-01-24 Thread Nathan Klatt
On Sun, Jan 24, 2010 at 7:05 AM, DOTS D.O.Technology Services
dotsbulk...@gmail.com wrote:
 how i can put iframe on top of other iframe in html,

http://www.w3.org/TR/CSS21/visuren.html#absolute-positioning


Re: [jQuery] Are API docs in sync with latest jquery library

2010-01-24 Thread Nathan Klatt
On Sat, Jan 23, 2010 at 1:50 PM, Talisman tfried...@gmail.com wrote:
 I'm trying to use jQuery.ajax() and passing in a success callback.
 The data is loaded and the callback is invoked, but I'm not being
 passed in the XmlHttpRequest object as expected.  I've been looking at
 the documentation here: http://api.jquery.com/jQuery.ajax/

Poking around a little I see the ajax method has been around since
1.0; I wasn't able to find if the interface changed at all, however. I
assume you're using 1.4? This does sound strange - I look forward to
seeing the resolution. What are the contents of textStatus?

Nathan


Re: [jQuery] Re: loading osx (eric martin) to show errors

2010-01-24 Thread Nathan Klatt
On 24 jan, 16:39, Nathan Klatt n8kl...@gmail.com wrote:
 $().ready(function() { $(#osx).click(); });

On Sun, Jan 24, 2010 at 2:29 PM, infojava infojava2...@gmail.com wrote:
 Thanks but it does not work !!!

Okay, well what's the #osx element look like? What's its click handler?

Is the php file being accessed directly or via AJAX?

Nathan


Re: [jQuery] Re: loading osx (eric martin) to show errors

2010-01-24 Thread Nathan Klatt
On Sun, Jan 24, 2010 at 4:05 PM, infojava infojava2...@gmail.com wrote:
 when we click on the a.osx it calls this function !
 but $(a.osx).click; doesn't work

Sorry, dude - I'm at a loss. I assume the lack of parens after click
(should be '$(a.osx).click();' not '$(a.osx).click;') is a typo?
Could you point to a page that does this? Or maybe put together a
small example of the issue at one of the collaborative Javascript
sites, like jsbin.com, or something?

Nathan


Re: [jQuery] Re: loading osx (eric martin) to show errors

2010-01-24 Thread Nathan Klatt
Works great for me:

http://jsbin.com/ahowi/edit

Make sure you set up the click handler before you execute the click. :)

Nathan


Re: [jQuery] This code is too complex for a noob, can someone break this down.

2010-01-24 Thread Nathan Klatt
On Sun, Jan 24, 2010 at 12:42 PM, Bugman1400
trae.be...@coachmanridge.com wrote:
 a href=javascript:void(0); onclick='$.get(dotest.php,{ cmd: approve,
 id: 57 } ,function(data){ alert('What the Heck'); });' Approve /a
 ...
 How come I get no response? Is there a further way to debug? I've heard that
 Ajax errors may be silent unless you specify.

Well, this is gonna piss you off, but the problem with that particular
example is you've got unescaped ticks inside of ticks - check the JS
concole. Change to the following and it works:

a href=javascript:void(0); onclick=
   '$.get(dotest.php,
   { cmd : approve, id  : 57 },
   function(data) { alert(What the Heck\n\n+data); 
});'Approve/a

Nathan


Re: [jQuery] This code is too complex for a noob, can someone break this down.

2010-01-25 Thread Nathan Klatt
On Sun, Jan 24, 2010 at 9:01 PM, Bugman1400
trae.be...@coachmanridge.com wrote:
 What is the best way to check the JS console? I am currently using MS FP.
 Should I switch to something like FireFox?

If you don't want to switch environments, IE has a devloper toolbar:

http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Toolbar

Nathan


Re: [jQuery] This code is too complex for a noob, can someone break this down.

2010-01-25 Thread Nathan Klatt
On Mon, Jan 25, 2010 at 5:19 PM, Bugman1400
trae.be...@coachmanridge.com wrote:
 I still get the Error $ is not defined in the console. What could that be 
 from?

That means jQuery isn't being properly included.

Nathan


Re: [jQuery] insertAfter('.address')

2010-01-26 Thread Nathan Klatt
On Tue, Jan 26, 2010 at 8:38 AM, Bas basvdlustgr...@gmail.com wrote:
 $(this).next().insertAfter('.address').load('http://mydomain.dev/
 search/view/Id/' + $(this).attr('id') + '.html');

You're trying to insert $(this).next() after $(.address). What you
want to do - I'm guessing - is create a new div loaded with the result
of the load call, yes? You need to load the new content into a fresh
div, then insert that after $(.address).

newDiv = createElement(div);
newDiv.load(http://mydomain.dev/search/view/Id/; + $(this).attr(id)
+ .html);
newDiv.insertAfter(.address);

Something like that, I think. :)

Nathan


Re: [jQuery] insertAfter('.address')

2010-01-26 Thread Nathan Klatt
On Tue, Jan 26, 2010 at 9:27 AM, Nathan Klatt n8kl...@gmail.com wrote:
 newDiv = createElement(div);
 newDiv.load(http://mydomain.dev/search/view/Id/; + $(this).attr(id)
 + .html);
 newDiv.insertAfter(.address);

Whoops, be sure to turn newDiv into a jQuery object after creating it.


Re: [jQuery] My first clip

2010-01-27 Thread Nathan Klatt
On Wed, Jan 27, 2010 at 7:54 PM, Tiffany scallionlisena...@gmail.com wrote:
 Hi to all. I'm Tiffa , and I have create my small first erotic movie.
 Is it looks fun?

Beginning of the end?


Re: [jQuery] Re: Help with Column Navigation plugin (list page by selecting a element with particular ID)

2010-01-28 Thread Nathan Klatt
On Fri, Jan 22, 2010 at 12:50 PM, Asharudeen asharud...@gmail.com wrote:
 Assume, if the li element and anchor element have unique IDs. Is there a
 way list by using their IDs. Or is there way to list the childs of the
 particular element.

I'm not exactly sure what you're asking but, yes, you could find all
children of the clicked menu item:

$(#myTree a).click(function() {
  var immediateChildren = $(this).next().children(li);
  var allDescendants = $(this).next().find(li);
});

Those will find the li elements but you can modify it to get the a
elements or the href values or the a text or whatever.

Hope that helps - like I said, I'm not sure what you're after, exactly.

Nathan


Re: [jQuery] Tabs not working... NEED HELP!!!

2010-01-29 Thread Nathan Klatt
On Fri, Jan 29, 2010 at 4:19 PM, Erik eriks...@mac.com wrote:
                var activeTab = $(this).find(a).attr(href); //Find the rel
 attribute value to identify the active tab + content
                $(activeTab).fadeIn(); //Fade in the active content

What do your hrefs look like? Any chance you could send a link to your
page? Or set up a small example at jsbin.com or something?


Re: [jQuery] Tabs not working... NEED HELP!!!

2010-01-29 Thread Nathan Klatt
On Fri, Jan 29, 2010 at 4:19 PM, Erik eriks...@mac.com wrote:
                var activeTab = $(this).find(a).attr(href); //Find the rel

Delete the find(a) bit and you're good.

http://jsbin.com/ufagi3/edit

Nathan


Re: [jQuery] (validate) Validation following server-side submit

2010-01-31 Thread Nathan Klatt
You might consider using the remote option:

http://jquery.bassistance.de/validate/demo/captcha/

Or, have onSubmit submit the form asynchronously and redirect if the
submit is successful.

In both cases you'll want to re-validate the submittal but if it's not
successful, who cares if you handle someone being an ass in a graceful
manner? :)

Nathan


Re: [jQuery] Traversing to next class?

2010-02-03 Thread Nathan Klatt
On Tue, Feb 2, 2010 at 11:28 PM, Photonic tmlew...@gmail.com wrote:
 Now the problem I am having is with   $(this).next
 ('.textDescription').hide();   . What am I doing wrong. I was under
 the impression that it would select the next object with the class of
 textDescription and hide it... but it isn't.

You need to use nextAll(), not next().

http://api.jquery.com/next/
.next( [ selector ] ) Returns: jQuery
Description: Get the immediately following sibling of each element in
the set of matched elements, optionally filtered by a selector.

http://api.jquery.com/nextAll/
.nextAll( [ selector ] ) Returns: jQuery
Description: Get all following siblings of each element in the set of
matched elements, optionally filtered by a selector.

Nathan


Re: [jQuery] Update div content after dynamic select creation

2010-02-03 Thread Nathan Klatt
On Wed, Feb 3, 2010 at 7:12 AM, Shinnuz theangusyo...@gmail.com wrote:
 Database works, but if you see div#result doesn't update with prova3...
 why? where i'm wrong?

I do believe your problem is you're creating the nation select AFTER
you've set the handler for the select. Move your declaration of
$('#sel_nazioni').change(function() into $.post(selection.php,
{id_cont:cont}, function(data){, a la:

$(document).ready(function() {
   $('#sel_continenti').change(function(){
   var cont = $('#sel_continenti').attr('value');
   $.post(selection.php, {id_cont:cont}, function(data){
   $(#sel_nazioni).empty();
   //$(div#result).empty();
   $(div#nazioni).empty();
   $(div#result).append(prova2br /);
   //$(div#result).append(document.createTextNode(prova));
   $(#sel_nazioni).prepend(data);
   $(div#nazioni).prepend(data);
   $('#sel_nazioni').change(function(){
   var id_naz = $('#sel_nazioni').attr('value');
   $.post(result.php, {id:id_naz}, function(data){
   $(div#result).empty();
   $(div#result).append(prova3br /);
   //$(div#result).prepend(data);
   });
   });
   });
   });
});

Nathan


Re: [jQuery] “(validate)”

2010-02-04 Thread Nathan Klatt
On Thu, Feb 4, 2010 at 7:28 AM, Søren gruby mrgr...@gmail.com wrote:
 How can I validate, say a textbox inside a specific div element that
 has a specific id?

Validate validates forms so to validate a field, it has to be in a
form - doesn't matter whether it's in another div or what. Each rule
entry refers to a field's name.

From your example, it looks like you have a form with id=aspnetForm
but you don't specify what your input's name is; if it isn't txt_1 or
txt_2 then it won't be validated.

You can find some samples here:

http://jquery.bassistance.de/validate/demo/

Nathan


Re: [jQuery] Forms Plugin - Button Id

2010-02-04 Thread Nathan Klatt
On Thu, Feb 4, 2010 at 9:21 AM, neojquery w.as...@rocketmail.com wrote:
 I have two button on the page I need to know which one has
 been clicked and trigger an event based on this.

http://api.jquery.com/click/

Nathan


Re: [jQuery] popup form

2010-02-05 Thread Nathan Klatt
On Fri, Feb 5, 2010 at 3:51 AM, Oguz Yarimtepe oguzyarimt...@gmail.com wrote:
 At my web application i am using jquery for updating some div areas. I also 
 need
 to update some tables which are produced after executing some queries at my
 db. So i am planning to open a popup form that will show the current values of
 the row that is shown at the table. Changing and submiting will effect the db 
 also.

We regularly use Flexigrid, jqModal, and the jQuery Form plugin for
this purpose.

http://www.flexigrid.info/
http://dev.iceburg.net/jquery/jqModal/
http://jquery.malsup.com/form/

The author of Flexigrid hangs out on
http://groups.google.com/group/flexigrid so that's a good resource for
questions.

Nathan


Re: [jQuery] Find nodes

2010-02-05 Thread Nathan Klatt
On Fri, Feb 5, 2010 at 8:14 AM, san82 sandee...@spanservices.com wrote:
 I have the below HTML assigned to a variable in JS.

 HTML:
 #ChevronSPAN4 lt;lt;  #ChevronSPAN4id= gt;gt;

 Please let me know using jQuery how can I search the variable for SPAN
 elements with class=cheveron.

I'm guessing your variable got munged, eh? Do you mean you have a
string of HTML? If so, you could DOMify it then search in that.

var tempDiv = document.createElement('div');
tempDiv.innerHTML = (your variable);
var cheverons = $(tempDiv).find(span.cheveron);

Nathan


Re: [jQuery] Superfish text color with parent - Really need help, thanks

2010-02-09 Thread Nathan Klatt
On Tue, Feb 9, 2010 at 2:23 PM, garyh ga...@bytesolutions.com wrote:
 I am new to superfish and generally have the menu working except for
 one problem. When navigating to a sub menu the parent is properly
 keeping it's background color but the text color is reverting to its
 normal color. There is a link to the site below to see an example.

 http://dev.beckermd.com/

Hey Gary,

Not having easier access to your code I'm not sure if this is the best
fix for your issue but adding the specifier .sf-menu li.sfHover  a
to line 93 of your superfish.css file (currently has .sf-menu
li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover,
.sf-menu a:active) seems to do the trick.

Nathan


Re: [jQuery] Superfish text color with parent - Really need help, thanks

2010-02-09 Thread Nathan Klatt
On Tue, Feb 9, 2010 at 5:45 PM, Gary Herbstman ga...@bytesolutions.com wrote:
 Cool, That did the trick, THANKS!

You're welcome.

 I would love to understand this better. What exactly is this doing?

Well, what's happening is the cascade. Where there are style clashes,
whatever rule is the most specific/has the highest specificity will be
applied. Read through this first link - or even just the table at the
top - with an eye for the rule you had and what I added and I think
you'll get it.

http://www.w3.org/TR/CSS21/selector.html
http://www.w3.org/TR/CSS21/cascade.html

Nathan


Re: [jQuery] how to make this really beautifull pattern

2010-02-10 Thread Nathan Klatt
On Wed, Feb 10, 2010 at 12:27 AM, hno hno2...@gmail.com wrote:
 I have seen this pattern in http://www.altsoftware.com/index.php .
 there are news menu in the left side . Please visit this site . The
 news will be change with a really beautiful pattern in every 5
 seconds

Just animate the position and opacity or color.

http://api.jquery.com/animate/

Nathan


Re: [jQuery] Replace URL parameters

2010-02-10 Thread Nathan Klatt
On Wed, Feb 10, 2010 at 5:48 AM, Jakub j.kucharo...@gmail.com wrote:
 I want to replace all parameters, but first. I don't know what is
 wrong .. :-(

Could you give an example of what you want to happen? I.e., an input
string and what you want it to look like after the replace?

Nathan


Re: [jQuery] Replace URL parameters

2010-02-10 Thread Nathan Klatt
On Wed, Feb 10, 2010 at 5:48 AM, Jakub j.kucharo...@gmail.com wrote:
    function Dummy(){
      adress = window.location.href;
      regex = /^(.*?)?$/;
      adress = adress.replace(regex,'');
      alert(adress);
    }

One problem is you don't want to put quotes around the regex.

Nathan


Re: [jQuery] Re: how to make this really beautifull pattern

2010-02-10 Thread Nathan Klatt
On Wed, Feb 10, 2010 at 8:56 AM, Jonathan Vanherpe (T  T nv)
jonat...@tnt.be wrote:
 How about you just look at the source code?

 http://www.altsoftware.com/alt_news_rotator.js

 There's comments and everything

FTW!!!


Re: [jQuery] Popup

2010-02-10 Thread Nathan Klatt
On Wed, Feb 10, 2010 at 11:56 AM, dtirer dti...@gmail.com wrote:
 I'm using the following JQuery Popup code to make smooth popups:
 (http://yensdesign.com/2008/09/how-to-create-a-stunning-and-smooth-
 popup-using-jquery/)

 I was wondering how I can use use this to load external pages into the
 popup?

This tutorial should prove helpful:

http://pixeline.be/blog/2008/javascript-loading-external-urls-in-jqmodal-jquery-plugin/

If you don't want to use an iframe I believe you'll have to send the
request to your own server and have it fetch the external page you
want to load since most browsers don't allow XSS. If you're going to
do that, though, be careful!

http://www.owasp.org/index.php/XSS

Nathan


Re: [jQuery] Superfish text color with parent - Really need help, thanks

2010-02-10 Thread Nathan Klatt
On Tue, Feb 9, 2010 at 9:15 PM, Gary Herbstman ga...@bytesolutions.com wrote:
 So .sf-menu li.sfHover  a

 Applies that style to any A element that is a child of li.sfHover that
 is a descendent of sf-menu.

Right.

 What in superfish is happening? Is the code setting the attribute
 sfHover to the item when you traverse its children?

Just about - it looked like superfish was adding the sfHover class to
each item as it was hovered over and its menu expanded.

You can use the Firefox addon Firebug to watch the classes and styles change.

Nathan


Re: [jQuery] jquery.validate in chrome field loses focus on unhighlight

2010-02-11 Thread Nathan Klatt
On Thu, Feb 11, 2010 at 2:36 PM, jrallan jral...@hotmail.com wrote:
 Any suggestions? You cannot add $(element).focus() to the unhighlight
 function because it runs on blur() so can never escape the field.

Have you tried returning false from a blur handler or something along
those lines?

Good luck.

Nathan


Re: [jQuery] Multiple select box line wrap

2010-02-16 Thread Nathan Klatt
On Tue, Feb 16, 2010 at 9:22 AM, Paul Collins pauldcoll...@gmail.com wrote:
 I'm have a fixed width on a multiple select box. The problem is, some of the
 options are longer than the width and by default the lines won't wrap. I'm
 wondering if anyone has seen a way of making lines wrap

Multiple selects are a HTML/CSS/browser weakness.

My recommendation is to use checkboxes, styled so they highlight when
:selected and the box doesn't show, named as an array, e.g.,
name=multiSelect[]; put them all in a ul or ol and make wrapping
easy.

Nathan


Re: [jQuery] Multiple select box line wrap

2010-02-16 Thread Nathan Klatt
'Course it's a good idea!

;)

On Tue, Feb 16, 2010 at 11:29 AM, Paul Collins pauldcoll...@gmail.com wrote:
 Thanks Nathan

 That's a good idea actually, guess that would work even if you had scripts
 turned off...

 Will put that to use, thanks again.


Re: [jQuery] Scrolling Problem

2010-02-20 Thread Nathan Klatt
On Sat, Feb 20, 2010 at 9:13 AM, macgyver47 jrl...@wanadoo.fr wrote:
 div1 class=post
    div class=title
 
 div10 id=post
   div class=title
 I am trying: clicking on div#title belonging to div1 scrolls to
 div#title belonging to div2 and so on

$().ready(function() {
  $(.title).click(function() {
var thisPost = $(this).parent();
var nextPost = thisPost.next(.post);
if ( ! nextPost.length ) nextPost = thisPost.parent().find(.post);
var positionOfNextTitle = nextPost.find(.title).position(); // or offset()
window.scrollTo(positionOfNextTitle.left, positionOfNextTitle.top);
  });
});

http://jsbin.com/adoti/edit

Nathan


Re: re[jQuery] fresh tabs

2010-02-21 Thread Nathan Klatt
Perhaps you could point us to your page? Or set up an example at
jsbin.com or something?

Nathan


Re: [jQuery] Sortable list - even when list is changed

2010-02-21 Thread Nathan Klatt
Hi Rafal,

In what way does it not work? I transcribed your code into jsbin and
it seems to be fine, though I don't have any roundbox styling being
applied:

http://jsbin.com/oququ3/edit

Nathan


Re: re[jQuery] fresh tabs

2010-02-22 Thread Nathan Klatt
On Mon, Feb 22, 2010 at 2:20 AM, whynotter deboramont...@hotmail.com wrote:
 http://www.deboramontoli.it/prova/mediacenter_prova2.shtml page 2

Check this out:

http://jsbin.com/ixiyo/3/edit

You will need to do some more data localization (I've done it for
currentPosition but left totalVideos and maxMove) but I think it
should have you on your way.

Nathan


Re: [jQuery] Re: Sortable list - even when list is changed

2010-02-22 Thread Nathan Klatt
On Mon, Feb 22, 2010 at 11:10 AM, rafald rafdrepub...@gmail.com wrote:
 ok...I see on you page it works...I double checked my code.
 ...
 but the problem is I need accordion as well.

If you update the jsbin page to how you think it should be (i.e., add
the accordion) I'd be happy to look into what's wrong. :)

Go to the page I made: http://jsbin.com/oququ3/edit, make your edits,
save a New revision, then forward the link.

Nathan


Re: [jQuery] Help: Iterate through unknown number of elements, apply function

2010-02-23 Thread Nathan Klatt
On Tue, Feb 23, 2010 at 2:20 AM, xstaceyamayx sta...@staceymay.com wrote:
 Anyway, I have 2 select boxes. I can populate SelectA with items from
 a database, move the items from selectA to selectB and back again by
 clicking add and remove...

Change your HTML to look something like this:
  div class=input
select multiple class=selectA
  ?php //populate with database information ?
/select
div
  button class=addadd gt;gt;/buttonbr /
  button class=removelt;lt; remove/button
/div
select multiple class=selectB/select
  /div

Then your Javascript to something like:
$().ready(function() {
  $(.input).each(function(i) {
$(this).find(.add).click(function() {
  var container = $(this).closest(.input);
  container.find(.selectA
option:selected).appendTo(container.find(.selectB));
});
$(this).find(.remove).click(function() {
  var container = $(this).closest(.input);
  container.find(.selectB
option:selected).appendTo(container.find(.selectA));
});
  });
});

See it in action here: http://jsbin.com/osipu/edit

Nathan


Re: [jQuery] Quirks with Tablesorter

2010-02-25 Thread Nathan Klatt
On Thu, Feb 25, 2010 at 4:34 PM, West415 malik.robin...@gmail.com wrote:
 I am using a jquery plugin called tablesorter.  It works fine but I've found
 a quirk and can't seem to fix it and would love some help if possible.  When
 you sort, the sort works, but for some reason all the hr tags which render
 a horizontal link end up getting placed at the top of the table.  So the
 data sorts right but something is going on when i use the hr tags.

Sounds right to me. Instead of rows containing hrs, how about some
border styling on the trs or tds?

Nathan


Re: [jQuery] Quirks with Tablesorter

2010-02-25 Thread Nathan Klatt
On Thu, Feb 25, 2010 at 5:28 PM, West415 malik.robin...@gmail.com wrote:
 I don't need the headers to repeat though.  I'm trying to have a visual
 separator between the rows.  I don't have to use an hr tag, but the
 problem is, it tries to sort every row as if there is data there.  I'd like
 it to ignore that row when doing the sort.

 Any idea?  I'm happy to replace my hr tag with an image but I'm afraid it
 may try to sort that row to

Yeah, I'm sure it will.

What determines whether there is a separator between two rows? I
expect you'll have to re-apply that logic each time the table is
sorted; just add a class to the trs that you want to have the
separator after (or before, I suppose). Remember to remove the class
before you re-apply the logic, though. :)

Good luck.

Nathan


Re: [jQuery] Accordion help ....

2010-02-26 Thread Nathan Klatt
On Fri, Feb 26, 2010 at 3:12 PM, Erik eriks...@mac.com wrote:
 My accordion is working great, but I need to STOP the hover on the
 selected item.

You should be able to deactivate the hover for .ui-state-active elements.

Nathan


Re: [jQuery] Re: Accordion help ....

2010-02-28 Thread Nathan Klatt
On Sun, Feb 28, 2010 at 12:00 AM, Erik eriks...@mac.com wrote:
  { $(this).removeClass(ui-state-active); }

No, don't do that - that'll screw up the accordion, I expect. I mean
something in the css like:

.ui-state-active:hover {
  background-color: inherit; /* or none or some specific color */
}

Nathan


Re: [jQuery] Newbie Question: Finding and manipulating an element

2010-03-01 Thread Nathan Klatt
On Mon, Mar 1, 2010 at 5:06 AM, Aaron Johnson
aaron.mw.john...@gmail.com wrote:
 The top level list has an ID and associated css, I'd like to add a class to
 each of the nested ul elements in order to style them differently. I
 cannot manually add a class so wondered if I could do it with jQuery.

 I'm looking for a result like this:

 ul class=foo
     lia title=Announcements1 href=foo.htmlspan
 class=portal-navigation-labelHome/span/a
         ul class=bar

If all of the inner uls are styled the same you don't need a class,
just add a rule to your css:

ul.foo  li  ul {
  /* style stuff */
}

Nathan


Re: [jQuery] Slide down / Slide up, stop repeating

2010-03-02 Thread Nathan Klatt
On Mon, Mar 1, 2010 at 11:35 AM, Paul Collins pauldcoll...@gmail.com wrote:
 My problem is that if someone hovers over the .content multiple times,
 the JQuery remembers and keeps popping the menu up and down

From http://api.jquery.com/stop/:

We can create a nice fade effect without the common problem of
multiple queued animations by adding .stop(true, true) to the chain:

$('#hoverme-stop-2').hover(function() {
  $(this).find('img').stop(true, true).fadeOut();
}, function() {
  $(this).find('img').stop(true, true).fadeIn();
});

I don't like how this jerks the in animation to its end then starts
the out animation - it would be nice if it would freeze the in
animation and start the out animation from there but things get messed
up with jumpToEnd (the second param) set to false.

Nathan


Re: [jQuery] Get the previous element matching a class

2010-03-02 Thread Nathan Klatt
On Tue, Mar 2, 2010 at 9:20 AM, debussy007 debussy...@gmail.com wrote:
 I would like to have the previous TD element with class time.

 I tried : $(this).closest('td').prev('td.time').html()   (where this is a
 div element inside a TD)
 But it only works for a div inside a TD that is *directly* following the
 td.time element.

Yeah, prev only gets the immediately preceding sibling; prevAll gets
all previous siblings so I think you want something like this:

$(this).closest('td').prevAll('td.time').last().html()

Nathan


  1   2   >