[jQuery] Re: Show all?

2007-08-03 Thread Brian Cherne
Well, I haven't seen any other accordion panes with working links so it's
hard to tell where he'll put that data... if the data DIVs were all siblings
(as they are currently) then this would work. There is a minor problem with
siblings in that Mitchell's detail pane header (attrtext) is a sibling
too... so, given the existing structure, the jQuery code would have to be
something more like:

$( targetId ).show().siblings().not('#attrtext').hide();

Really though, the two main points I was trying to express were:

1) that it looks like there could be around 50 links... it would be easier
to read, develop and maintain if there was one function (or a few functions)
that governed all links and data instead of one click function per link.
With three links (currently) it's manageable... with 50 it would be a
needlessly verbose and bloated beast.

2) that there's no need to introduce additional class names or other hooks
for information that's already accessible to jQuery (like :visible)

Brian.

On 8/3/07, Wizzud [EMAIL PROTECTED] wrote:



 There is a possible problem using siblings() - if Basics:Location is the
 current selection, and you then browse through the other accordion panels
 then presumably while you are opening/closing panels the RH panel does not
 change, ie still showing Locations; if you decide to click on Belly in the
 Pattern panel, then you need to close Basics:Location which is not a
 sibling
 of the one you need to open!



 Brian Cherne wrote:
 
  Hi Mitchell, I'm going to try writing some code and hopefully you'll get
  the
  idea and make it work (as it's untested). Basically, instead of writing
  everything out verbosely... try to determine automatically what needs to
  happen from the information stored in the DOM.
 
  $('.AccordionPanelContent a').click(function(){
  var targetId = this.id.toLowerCase();
  var txt = $(this).text();
 
  $(#attrname).css('background-color','#8FA9C5');
  $(#attrtext).text( txt );
 
  $( targetId ).show().siblings().hide();
  });
 
  I'm not sure about that last line... it depends on how many siblings.
 You
  may consider rewriting it:
 
  $( targetId ).show().siblings(':visible').hide();
 
  Or, possibly:
 
  $( targetId ).siblings(':visible').hide().end().show();
 
  This page in the documentation is your friend:
  http://docs.jquery.com/DOM/Traversing
 
  Also, while I've coded this with your example/HTML in mind I really have
  to
  say that I do not like having an id of location and an id of
 Location
  ... that's just screaming for trouble.
 
  Cheers,
  Brian.
 
 
 
  On 8/2/07, Mitchell Waite [EMAIL PROTECTED] wrote:
 
   That helps a lot Glen but I am still stuck.
 
 
 
  Here is my link
 
 
 
  http://www.whatbird.com/wwwroot/Components/Accordion%20Menu.html
 
 
 
  Each of the items inside a main menu will open its own layer, you can
 see
  the first two are working.
 
 
 
  And excuse my confusion I should have called this *close all divs but
  one
  * as it has nothing to do with show all
 
 
 
  I don't think :last applies to the last DIV  clicked.
 
 
 
  In a DIV can I use an ID and a class at the same time? Because if that
  was
  possible I could use addclass to hide all the divs with that class,
 then
  show the one that is clicked (assuming I could make the close all
 happen
  before the show)
 
 
 
  I'm not using any tables, and all I know is if an object is visible or
  invisible.
 
 
 
  Thanks
 
 
 
  Mitch
 
 
 
 
 
  *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
  *On
  Behalf Of *Glen Lipka
  *Sent:* Thursday, August 02, 2007 7:30 PM
  *To:* jquery-en@googlegroups.com
  *Subject:* [jQuery] Re: Show all?
 
 
 
  Might be easier if you post an page that isn't working.  We could be
 more
  specific.
  However...
  Use a class when you want to refer to something that is repeated on
 the
  page.
  Also you can use :last to find the last one.
  $(tr:last).show() would show the last row found.
 
  Does that help?
 
  Glen
 
   On 8/2/07, *Mitchell Waite* [EMAIL PROTECTED] wrote:
 
  What I am looking for is a way to hide the last one of these that was
  clicked. I tried saving the object that was last used in a var but that
  didnt work. I thought then maybe I could create some kind of close
 all
  that would close all the other layers but not the one we have clicked
 to
  show.
 
 $('#Location').click(function() {
   $(#attrname).css('background-color','#8FA9C5');
   $(#attrtext).text(Location);
   $(#location).show();
   $(#shape).hide();
 });
 
 $('#Shape').click(function() {
   $(#attrname).css('background-color','#8FA9C5')
   $(#attrtext).text(Shape);
   $(#location).hide();  /* should hide location */
   $(#shape).show();
 });
 
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Show-all--tf4210083s15494.html#a11977192
 Sent from the JQuery mailing list archive at Nabble.com.




[jQuery] Re: Good Javascript editor or IDE?

2007-08-03 Thread Dragan Krstic
HomeSite anyone? It is shame that Macromedia totally ignored. They didn't
put anything new for more than 5 yrs. Yeah, it still lives in  Dreamweaver
coding enviroment, and when I'm using DW, 90% of time I spent there.

-- 
Dragan Krstić krdr
http://krdr.ebloggy.com/


[jQuery] Documention Group

2007-08-03 Thread Tane Piper

Hey folks,

Hope you don't mind, but with the recent dicussion of documentation
for jQuery I've created a seperate group for it:

http://groups.google.com/group/jquery-docs/

If you are serious about helping the efforts of improving the jQuery
documentation, then please join the group and we can get the dicussion
going.  This should allow us to keep it off the main list, and keep it
in an organised place.

Discussions should be along the lines of what we can do to improve the
documentation, how we should show demo's of plugins, and how to
display the official API.

-- 
Tane Piper
http://digitalspaghetti.tooum.net

This email is: [ ] blogable [ x ] ask first [ ] private


[jQuery] Split list digests for the mainlist

2007-08-03 Thread David Duymelinck


Hello,

I think it's a good idea there are split lists but is it somehow 
possible to inject good ideas or decisions made in those split lists 
into the main list in the form of digests/split list post. I think the 
lists most eligible  for this are the plugins and the new docs list. 

I never subscribed to the other lists because the mainlist is so active 
already recieving more information about jQuery feels like an overload.

This is just my opinion, any comments would be much appreciated!

--
David Duymelinck

[EMAIL PROTECTED]



[jQuery] Autocomplete: Problem in Jörn Zaefferer's v ersion

2007-08-03 Thread Saurabh

Thanks Jörn for great plugin!!!

Realy solved my most autocomplete problems.

My requirement and expectation form Autocomplete plugin was:
1. Multimple select
2. HTML formated out put (I added, please check
http://dev.reach1to1.net/saurabh/jplugins/autocomplete/)
3. On Select callback

=Multiple select is possible but if one of the value entered by user
dont match result it clears all selected items.where It should clear
only the last/wrong value entered.

=In FormatItem now you can write HTML tags and autocomplete will only
match data and ignore HTML tags. See Load function.
http://dev.reach1to1.net/saurabh/jplugins/autocomplete/

=Please enable onselect callback.

My HTML format example
http://dev.reach1to1.net/saurabh/jplugins/autocomplete/

Thanks again,

Regards
Saurabh



[jQuery] Re: Coder vs Designer?

2007-08-03 Thread Christof Donat

Hi,

 In my present job we don't have a designer, so us coders are the designer.
 I don't mind but I'd still like to keep the two separated as much as
 possible.

Our Designer gives me (the developer) what he has produced with GoLive and a 
text describing, how things should interact. If something is not clear I 
simply ask him.

 What are others doing to make sure that even small snippets of HTML aren't
 creeping into their js files?

Idon't write them. I prefer to use a DOM Builder to create new Elements.

 $('#courseHist').append('divspan class=headingCourse
 Title/spanspan class=content' + crs.title + '/span/div');

$('#courseHist').append($.dom('div',{},[
['span',{'class':'heading'},['Course Title']],
['span',{'class':'content'},[crs.title]]
]));

Usually that is OK, because our designer uses a lot of CSS and is happy with 
code like this most of the time. If that is not acceptable, I use load() for 
a hidden part of the page at first use and then clone it as often as I need:

function insertCourseHistory(hist) {
var tmpl = $('#courseHistTemplate');
var tmplc = $('*',tmpl);
if( tmplc.lengt == 0 ) {
tmpl.load('histTemplate.htmlf',{},function() {
insertCourseTitles(hist);
});
} else {

$('#courseHist').append(tmplc).find('.content').each(function(i) {
$(this).html(hist[i].title);
});
}
}

The html fragment file 'histTemplate.htmlf':

div
span class=headingCourse Title/span
span class=content/span
/div

If the page is not public I even spare the single load and put the template on 
the page directly. Then the JS code is really simple:

$('#courseHist').append('#courseHistTemplate  *').
find('.content').each(function(i) {
$(this).html(hist[i].title);
});

On public pages you might get punished by Google for having hidden content on 
your page so I prefer to use external html fragments.

Christof


[jQuery] Re: Do you think jQuery's documentation is enought?

2007-08-03 Thread Alexandre Plennevaux
me too!

   _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ganeshji Marwaha
Sent: jeudi 2 août 2007 19:42
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Do you think jQuery's documentation is enought?


Hi list,

I have been thinking about a how-to/demo/interesting-use-cases kinda site
for jquery lately. 

But, it is not a trivial effort if we want to get it to a state where it
will be something jquery community can be proud of. So, i guess it should be
more of a community effort with a group of people leading the pack. 

So, if someone, like one of the leading plugin authors start such an effort
i will be more than willing to spend my nights and weekends on such an
effort.

-GTG


On 8/2/07, Mitchell Waite HYPERLINK
mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: 


The documentation is excellent and one major reason I am here.

As a publisher and writer of computer books, I think I know exactly what the
best next step would be for improving the docs.

Before I sold Waite Group Press to Simon and Schuster we had two very 
successful lines of language books

Bibles (ergo reference guides)
How To's (e.g. How Do I..Call a Javascript Function from jQuery)

We let IDG (now Wiley) and others do the dummies books because that area of 
the market was a gold mine if you hit it first. I am hoping we will see a
Head First jQuery from O'Rielly and a jQuery Visual QuickStart from
Peachpit.

We know Karl has a reference book coming out from Packit (you should all 
preorder it to support our local authors)

WHAT IS NEEDED FOR A JQUERY LEARNING RESOURCE

I think jQuery could benefit greatly from a simple How To
document/book/website addition/etc. If we followed my model the pages would 
be a collection of How Do I...(do something in jQ) in a standard format. It
would need a super table of contents and be set up for searching concepts.

The key is picking a range of really really good How To's. If any of you 
have our old Visual Basic How To that sucker really sold well because we
worked very hard picking good examples.

I've been thinking about what these might be and have a lot of other ideas.
In our books we would start with the most basic uses of jQuery and move up 
in difficulty and level towards later chapters.  We would aim to have How
Tos that actually did things that are useful but we would try and keep them
short as possible.

I have started a How To list because as a novice I am very aware of the 
simple assumptions the docs make and the very important things you need to
know early about syntax and basic concepts.

If anyone is interested in working with me on such a project, let me know
offline and I will report back here if I spark any interest. 

Mitch

-Original Message-
From: HYPERLINK
mailto:jquery-en@googlegroups.comjquery-en@googlegroups.com
[mailto:HYPERLINK
mailto:jquery-en@googlegroups.com[EMAIL PROTECTED] On
Behalf Of Terry B
Sent: Thursday, August 02, 2007 7:18 AM
To: jQuery (English)
Subject: [jQuery] Re: Do you think jQuery's documentation is enought?


I like HYPERLINK http://www.visualjquery.comhttp://www.visualjquery.com
for my jquery documentation...

yes there is lots of room for improvements but it's a working and
living project which is constantly changing and I think the project
managers are doing a great job to date...  and demos?  look at the 
plugin pages for demos...  imho the core documentation should only be
techinical with little to no examples...  like the link above, they
give a two liner example with before and after expectations  that
is more then a programmer deserves and is just icing on the cake...

asking for demos of the core is like asking the creators for included
libraries in any language (like c, c++, etc) to provide demos of the
library functions when the coder only needs to know the name, input 
parameters and the expected output...

~Terry





Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.476 / Base de données virus: 269.11.0/929 - Date: 31/07/2007
17:26
 


[jQuery] Re: Show all?

2007-08-03 Thread Wizzud


Sorry Brian. Blimey, I can't believe I some of the things I come out with -
looking back at what I wrote, it's (almost) a load of twaddle! Not enough
coffee, me thinks  or maybe too much!
Anyway, I agree with the points you were trying to make, especially with
number 1, though possibly less so with number 2 because I would probably use
a class to determine which item was 'open' or 'closed'. Personal choice?



Brian Cherne wrote:
 
 Well, I haven't seen any other accordion panes with working links so it's
 hard to tell where he'll put that data... if the data DIVs were all
 siblings
 (as they are currently) then this would work. There is a minor problem
 with
 siblings in that Mitchell's detail pane header (attrtext) is a sibling
 too... so, given the existing structure, the jQuery code would have to be
 something more like:
 
 $( targetId ).show().siblings().not('#attrtext').hide();
 
 Really though, the two main points I was trying to express were:
 
 1) that it looks like there could be around 50 links... it would be easier
 to read, develop and maintain if there was one function (or a few
 functions)
 that governed all links and data instead of one click function per link.
 With three links (currently) it's manageable... with 50 it would be a
 needlessly verbose and bloated beast.
 
 2) that there's no need to introduce additional class names or other hooks
 for information that's already accessible to jQuery (like :visible)
 
 Brian.
 
 On 8/3/07, Wizzud [EMAIL PROTECTED] wrote:



 There is a possible problem using siblings() - if Basics:Location is the
 current selection, and you then browse through the other accordion panels
 then presumably while you are opening/closing panels the RH panel does
 not
 change, ie still showing Locations; if you decide to click on Belly in
 the
 Pattern panel, then you need to close Basics:Location which is not a
 sibling
 of the one you need to open!



 Brian Cherne wrote:
 
  Hi Mitchell, I'm going to try writing some code and hopefully you'll
 get
  the
  idea and make it work (as it's untested). Basically, instead of writing
  everything out verbosely... try to determine automatically what needs
 to
  happen from the information stored in the DOM.
 
  $('.AccordionPanelContent a').click(function(){
  var targetId = this.id.toLowerCase();
  var txt = $(this).text();
 
  $(#attrname).css('background-color','#8FA9C5');
  $(#attrtext).text( txt );
 
  $( targetId ).show().siblings().hide();
  });
 
  I'm not sure about that last line... it depends on how many siblings.
 You
  may consider rewriting it:
 
  $( targetId ).show().siblings(':visible').hide();
 
  Or, possibly:
 
  $( targetId ).siblings(':visible').hide().end().show();
 
  This page in the documentation is your friend:
  http://docs.jquery.com/DOM/Traversing
 
  Also, while I've coded this with your example/HTML in mind I really
 have
  to
  say that I do not like having an id of location and an id of
 Location
  ... that's just screaming for trouble.
 
  Cheers,
  Brian.
 
 
 
  On 8/2/07, Mitchell Waite [EMAIL PROTECTED] wrote:
 
   That helps a lot Glen but I am still stuck.
 
 
 
  Here is my link
 
 
 
  http://www.whatbird.com/wwwroot/Components/Accordion%20Menu.html
 
 
 
  Each of the items inside a main menu will open its own layer, you can
 see
  the first two are working.
 
 
 
  And excuse my confusion I should have called this *close all divs but
  one
  * as it has nothing to do with show all
 
 
 
  I don't think :last applies to the last DIV  clicked.
 
 
 
  In a DIV can I use an ID and a class at the same time? Because if that
  was
  possible I could use addclass to hide all the divs with that class,
 then
  show the one that is clicked (assuming I could make the close all
 happen
  before the show)
 
 
 
  I'm not using any tables, and all I know is if an object is visible or
  invisible.
 
 
 
  Thanks
 
 
 
  Mitch
 
 
 
 
 
  *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
  *On
  Behalf Of *Glen Lipka
  *Sent:* Thursday, August 02, 2007 7:30 PM
  *To:* jquery-en@googlegroups.com
  *Subject:* [jQuery] Re: Show all?
 
 
 
  Might be easier if you post an page that isn't working.  We could be
 more
  specific.
  However...
  Use a class when you want to refer to something that is repeated on
 the
  page.
  Also you can use :last to find the last one.
  $(tr:last).show() would show the last row found.
 
  Does that help?
 
  Glen
 
   On 8/2/07, *Mitchell Waite* [EMAIL PROTECTED] wrote:
 
  What I am looking for is a way to hide the last one of these that was
  clicked. I tried saving the object that was last used in a var but
 that
  didnt work. I thought then maybe I could create some kind of close
 all
  that would close all the other layers but not the one we have clicked
 to
  show.
 
 $('#Location').click(function() {
   $(#attrname).css('background-color','#8FA9C5');
   $(#attrtext).text(Location);
   

[jQuery] multiline string

2007-08-03 Thread james_027

hi,

I am trying to use the jQuery .after() function. I have something like
this ..

$('p').after('p class=maina href=#sample/a/p');

I want to transform it into something like this to make the code much
easier to read

$('p').after('
p class=main
a href=#sample/a
/p
');

how can I achieve this?

Thanks
james



[jQuery] Re: multiline string

2007-08-03 Thread Klaus Hartl


james_027 wrote:

hi,

I am trying to use the jQuery .after() function. I have something like
this ..

$('p').after('p class=maina href=#sample/a/p');

I want to transform it into something like this to make the code much
easier to read

$('p').after('
p class=main
a href=#sample/a
/p
');

how can I achieve this?

Thanks
james


The + operator does string concatenation in JavScript:

$('p').after(
'p class=main' +
'a href=#sample/a' +
'/p'
);

Turned out that this is a little slow thus I tend to use a array.join() 
if the string gets longer, which is known to be faster:


$('p').after([
'p class=main',
'a href=#sample/a',
'/p'
].join(''));


--Klaus



[jQuery] UI upload

2007-08-03 Thread Alexandre Plennevaux
hi!
 
i just saw that there is an upload UI planned: HYPERLINK 
http://docs.jquery.com/UI/Uploadhttp://docs.jquery.com/UI/Upload
 
I don't know who's in charge so i'll address this to the list
 
i would like to know if i can help, since i gather some experience in doing it 
with my plugin jqUploader, and some ideas on how best to do it, and what are 
usual users expectations. 
 
Have a nice day :)
 
Alexandre

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.476 / Base de données virus: 269.11.0/929 - Date: 31/07/2007 17:26
 


[jQuery] Re: Coder vs Designer?

2007-08-03 Thread Christof Donat

Hi,

 I'm sorry Christof, didn't mean to offend you. Just saw the code and
 couldn't hold back...

No problem. I took your response as a challange, not an offense ;-)

Christof


[jQuery] Re: radiobutton is checked?

2007-08-03 Thread David Duymelinck


$(input:radio:checked)

should work too.

-- David


bytte schreef:

Ok, sorry , should hae checked the documentation better. I found this
to be the perfect answer to my question:

$([EMAIL PROTECTED]@checked])


On 3 aug, 15:03, bytte [EMAIL PROTECTED] wrote:
  

How can I check with jQuery whether or not a radiobutton is checked?



[jQuery] Re: BlockUI fade out - Possible to disable for some instances?

2007-08-03 Thread Mike Alsup

Maggi,

I just realized that I don't have this implemented correctly.  I'll
post an updated version when I have it fixed (probably tonight).

Mike


On 8/2/07, Maggi [EMAIL PROTECTED] wrote:

 Great, thanks alot Mike!

 On Aug 2, 9:01 pm, Mike Alsup [EMAIL PROTECTED] wrote:
  Hi Magnus,
 
  You can disable the fade effect when you call the blocking function
  using the fadeOut option.  For example:
 
  $.blockUI( Please wait, null, { fadeOut: 0 } );
 
  You can also change the time it takes to fade via the fadeTime option.
 
  Cheers!
 
  Mike
 
  On 8/2/07, Maggi [EMAIL PROTECTED] wrote:
 
 
 
   Hi everyone!
 
   I was wondering, and this question is mainly pointed to Mike, if I
   could disable the fade-out on the BlockUI within the BlockUI
   function?  I am using it to display a confirmation box, and if it is
   selected it displays another box, loads something with Ajax and then
   displays a Hurray box if successful.  When the fade out is used the
   old boxes can sometimes be shown in the background with the overlay.
 
   Kind regards,
   Magnus




[jQuery] Re: UI upload

2007-08-03 Thread John Resig

Sure - you should probably re-post this to the jQuery UI mailing list:
http://groups.google.com/group/jquery-ui

That's where we're currently discussing the UI stuff, you'll get a
better response :-)

--John

On 8/3/07, Alexandre Plennevaux [EMAIL PROTECTED] wrote:


 hi!

 i just saw that there is an upload UI planned:
 http://docs.jquery.com/UI/Upload

 I don't know who's in charge so i'll address this to the list

 i would like to know if i can help, since i gather some experience in doing
 it with my plugin jqUploader, and some ideas on how best to do it, and what
 are usual users expectations.

 Have a nice day :)

 Alexandre


 Ce message Envoi est certifié sans virus connu.
  Analyse effectuée par AVG.
  Version: 7.5.476 / Base de données virus: 269.11.0/929 - Date: 31/07/2007
 17:26



[jQuery] Re: multiline string

2007-08-03 Thread Karl Swedberg
Another way you could do this with multiple lines would be to  
use .insertAfter() . Something like this maybe:


$('p class=main/p)
.append('a href=#sample/a')
.insertAfter('p');


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 3, 2007, at 4:23 AM, Klaus Hartl wrote:


The + operator does string concatenation in JavScript:

$('p').after(
'p class=main' +
'a href=#sample/a' +
'/p'
);

Turned out that this is a little slow thus I tend to use a  
array.join() if the string gets longer, which is known to be faster:


$('p').after([
'p class=main',
'a href=#sample/a',
'/p'
].join(''));


--Klaus




[jQuery] Re: radiobutton is checked?

2007-08-03 Thread bytte

Ok, sorry , should hae checked the documentation better. I found this
to be the perfect answer to my question:

$([EMAIL PROTECTED]@checked])


On 3 aug, 15:03, bytte [EMAIL PROTECTED] wrote:
 How can I check with jQuery whether or not a radiobutton is checked?



[jQuery] Re: jquery.flickr + reflection

2007-08-03 Thread Daniel MacDonald

addClass('reflect') is definitely running before the images are
loading - the hazards of living in an AJAX world. setTimeout is a step
in the right direction, but you really want to add you reflections
after the response.

There are a couple of options: the flickr plugin can accept a
callback: setting to have a custom function work with the flickr
response (maybe not the best option if you are not familiar with the
flickr api) the other option would be to add your code [$
('img').addClass('reflect');] to the plug-in code inside the response
method ( just below the [if (this.s.litebox) $('#flickr').litebox();]
at the end of the code.)

On Aug 2, 1:27 am, b0bd0gz [EMAIL PROTECTED] wrote:
 Hi,
 Im trying to use the  http://cow.neondragon.net/stuff/reflection/reflection
 plugin  with the  http://www.projectatomic.com/flickr/#a_codeflickr plugin
 but  no reflection is added.

 How I have it setup at the moment is once the html is loaded, load a set of
 flickr images then add a class called reflect to all img tags on the
 document like so.

 $(document).ready(function()
 {
 $('#gallery').flickr({
 api_key: 'api key',
 type: 'search',
 user_id: 'users id',
 tags: 'siskin',
 thumb_size: 's',
 litebox: true
 });

 $('img').addClass('reflect');

 });

 The problem is it only adds a reflection to images that are not loaded using
 the flickr plugin.  You can see this in  http://b0bd0gz.adsl24.co.uk/jQuery/
 action here  where the flickr images don't have a reflection and the other
 image underneath does have a reflection.

 I hope that explains my problem, if not let me know and I'll try again.
 Thanks in advance for any help:-D

 b0bd0gz
 --
 View this message in 
 context:http://www.nabble.com/jquery.flickr-%2B-reflection-tf4204797s15494.ht...
 Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Datepicker. Hide dates from next/prev month

2007-08-03 Thread Brian Miller

CSS:

table.jCalendar td.other-month {
visibility: hidden;
}

- Brian


 Hi all.

 Right now the default behaviour of Kevin's datepicker,
 http://kelvinluck.com/assets/jquery/datePicker/v2/demo/, is to show the
 dates from the previous/next month as well as the dates from the current
 month.

 What would be the easy way to make the datepicker show the dates from
 the current month only?

 Thank you




[jQuery] jCarouselLite problem

2007-08-03 Thread Bruce MacKay


Hi folks/Ganeshji

I'm having trouble getting jCaroselLite to work first time round.

When I either link to a page containing a carousel or to a thickbox 
containing a carousel, in neither case do the images appear when that 
page/thickbox is visited via the link.


However, if I refresh the page, the images/the carousel appears immediately.

I'm trigger the plugin as...

$(document).ready(function() {
  $(.mixedContent .jCarouselLite).jCarouselLite({
btnNext: .mixedContent .next,
btnPrev: .mixedContent .prev,
visible: 2,
scroll: 2
});
});

I'm sorry, but I just can see what it is that I'm doing wrong.  Suggestions?

Thanks, Bruce



[jQuery] Re: jTip reload issue

2007-08-03 Thread Chris Hall

Thank you, I was able to solve the issue using the links you provided.

On Aug 1, 11:40 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Hi Chris,

 You're probably binding the jtip function to the page only when it's
 initially loaded. You'll probably need to re-bind it after the new
 content has been inserted into the DOM.

 Here is a link to to a quick solution:http://docs.jquery.com/
 Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_r
 equest.3F

 and here is a link to a lengthier 
 discussion:http://docs.jquery.com/Tutorials:AJAX_and_Events

 One caveat: If I recall correctly, the Behaviors plugin doesn't work
 with content that is inserted via ajax (only via DOM manipulation).

 --Karl
 _
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Aug 1, 2007, at 10:30 PM, Chris Hall wrote:



  Hello all.

  I am new to jQuery, and I must say it is FANTASTIC!

  I am using jTips and it is working very well, but with one exception.

  When my page is intially loaded, everything works great.  However,
  when I reload a DIV using AJAX, the jtips in that div do not work.

  I have verified the code I am using to reload the div is exactly the
  same (for testing, but once this is fixed it will not be).

  So for example, when the page is initially loaded I have:

  Area description goes herebr / In this area you see a
  href=tips.php?tip=player14 class=jTip id=player14
  name=GONtest13/a, a href=tips.php?tip=player19 class=jTip
  id=player19 name=GONtest5/a

  And everything works fine.

  But after the page has been loaded and I use AJAX to reload that div
  with:

  Area description goes herebr / In this area you see a
  href=tips.php?tip=player14 class=jTip id=player14
  name=GONtest13/a, a href=tips.php?tip=player19 class=jTip
  id=player19 name=GONtest5/a

  The jtips do not work.

  What am I doing wrong?

  And thanks for all your help and your wonderful framework!!!



[jQuery] Find nested elements within a div

2007-08-03 Thread Mindblender

I am trying to get all of the check box elements within a div
element.  Some are also inside a span element within the div.  When I
do $(#checkGroup/[EMAIL PROTECTED]), I get the first 5
checkboxes but the remaining 4, the ones within the span, aren't
included.  How can I select all of the check boxes regardless if they
are in a span or not?

Here is my html code:

div id=checkGroup
  input type=checkbox name=chk1 / Option 1br /
  input type=checkbox name=chk2 / Option 2br /
  input type=checkbox name=chk3 / Option 3br /
  input type=checkbox name=chk4 / Option 4br /
  input type=checkbox name=chk5 / Option 5
  span id=subGroup style=margin-left: 40px;display: block;
input type=checkbox name=chk6/ Option 6br /
input type=checkbox name=chk7/ Option 7br /
input type=checkbox name=chk8/ Option 8br /
input type=checkbox name=chk9/ Option 9
  /span
/div

Any suggestions?

thanks,
Jeff



[jQuery] jQuery slowdowns on consecutive calls

2007-08-03 Thread offwhite

http://brennan.offwhite.net/fasterjquery/

I put together a test to see how well jQuery would perform if I
carefully chained multiple functions together or use the each
function or completely break them up into separate calls. I was able
to show the chaining is the fastest while the each function still
performed alright.

What I discovered was that when the functions are run again they take
longer. And it adds up each time. I would like to know if there is
something I should do or if there is something in jQuery that is
causing this behavior.

You can see the sample here...

http://brennan.offwhite.net/fasterjquery/



[jQuery] Re: Coder vs Designer?

2007-08-03 Thread Christof Donat

Hi,

 I spot a typical case of classitis here.

I just used Matts original here.

 Why not getting a little more 
 semantic and use a real heading instead of the least semantic element
 with a class heading:

 div
  h2Course Title/h2
  p.../p
 /div

 Less bloated, less to transfer...

How about

dtCourse Title/dt
dd.../dd

And then in the original code have

dl id=courseHist/dl

Even less bloated, less to transfer, more expressive and my suggested code 
should still work (as it does with your suggestion).

Christof


[jQuery] Re: multiline string

2007-08-03 Thread james_027

hi,

nice trick!

cheers,
james


On Aug 3, 4:23 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 james_027 wrote:
  hi,

  I am trying to use the jQuery .after() function. I have something like
  this ..

  $('p').after('p class=maina href=#sample/a/p');

  I want to transform it into something like this to make the code much
  easier to read

  $('p').after('
  p class=main
  a href=#sample/a
  /p
  ');

  how can I achieve this?

  Thanks
  james

 The + operator does string concatenation in JavScript:

 $('p').after(
  'p class=main' +
  'a href=#sample/a' +
  '/p'
 );

 Turned out that this is a little slow thus I tend to use a array.join()
 if the string gets longer, which is known to be faster:

 $('p').after([
  'p class=main',
  'a href=#sample/a',
  '/p'
 ].join(''));

 --Klaus



[jQuery] Re: Coder vs Designer?

2007-08-03 Thread Klaus Hartl


Christof Donat wrote:

The html fragment file 'histTemplate.htmlf':

div
span class=headingCourse Title/span
span class=content/span
/div


I spot a typical case of classitis here. Why not getting a little more 
semantic and use a real heading instead of the least semantic element 
with a class heading:


div
h2Course Title/h2
p.../p
/div

Less bloated, less to transfer...


--Klaus


[jQuery] select .change event not firing on up/down arrow press

2007-08-03 Thread Jack Killpatrick


Hi, wondering if anyone knows why this might be happening:

I've attached a .change event to a set of select boxes:

   $('#ml_cartItems [EMAIL PROTECTED]').change(function() {
   var productID = this.id.split('_')[1];
   MLStore.changeItemQty( productID, $(this).val() );
   });

The change event fires fine when the user changes the select box using 
the mouse, but not when the keyboard up/down arrow keys are used. Know why?


Related question the MLStore.changeItemQty() function makes an ajax 
call. I don't want a user tooling up and down the select box, causing it 
to fire a slew of ajax calls. Any advice on how to handle that 
situation? I don't want to use blur, because I want the (eventual) ajax 
call to be fired just by changing the select box. I figure I can use a 
setTimeout or setInterval, but not sure what the most elegant way would be.


TIA!
Jack




[jQuery] Re: slideUp/Down flicker with 1.0.4

2007-08-03 Thread nazeem


Thanks for the effort. I have solved it by including a time delay between
slideDown and hide.

- nazeem 


Karl Swedberg-2 wrote:
 
 Are you using jQuery 1.0.4? Firefox Mac? If so, you'll need to  
 upgrade your version of jQuery.
 
 I'm reluctant to open zip files. Do you have a simple demo page where  
 the problem is evident?
 
 
 --Karl
 _
 Karl Swedberg
 www.englishrules.com
 www.learningjquery.com
 
 
 
 On Aug 2, 2007, at 12:39 PM, nazeem wrote:
 


 Anyone ?

 naz..


 nazeem wrote:

 Can someone help me solve this flicker issue when navigating this
 menu...on LHS
 I am using simple slideup and slidedown..

 attached the zip file...
  http://www.nabble.com/file/p11938864/jquery-seap.zip jquery-seap.zip
 - nazeem


 Brian Litzinger wrote:

 I noticed it Firefox, but surprisingly it doesn't happen for me in
 Safari. I'm injecting html into a div then sliding it down, and I  
 assumed
 I might not have written the code correctly, but I also noticed  
 it on
 normal elements as well.

 Brian




 Mika Tuupola wrote:


 Upon upgrading to jQuery 1.0.4 some of my slideUp/Down elements
 started to flicker. With 1.0.3 this problem did not exist.

 http://www.appelsiini.net/~tuupola/jquery/slideupdown/ 
 slideupdown5.html
 http://www.appelsiini.net/~tuupola/jquery/slideupdown/ 
 slideupdown6.html

 (Click the blue box in the corner).

 Am I missing something obvious or is this just css problem?

 -- 
 Mika Tuupola
 http://www.appelsiini.net/~tuupola/



 ___
 jQuery mailing list
 [EMAIL PROTECTED]
 http://jquery.com/discuss/







 -- 
 View this message in context: http://www.nabble.com/slideUp-Down- 
 flicker-with-1.0.4-tf2919581s15494.html#a11968093
 Sent from the JQuery mailing list archive at Nabble.com.

 
 
 

-- 
View this message in context: 
http://www.nabble.com/slideUp-Down-flicker-with-1.0.4-tf2919581s15494.html#a11981783
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Coder vs Designer?

2007-08-03 Thread Klaus Hartl


Christof Donat wrote:

How about

dtCourse Title/dt
dd.../dd

And then in the original code have

dl id=courseHist/dl

Even less bloated, less to transfer, more expressive and my suggested code 
should still work (as it does with your suggestion).


Christof


I agree, although we shouldn't choose elements for less-bloatedness :-)

I'm sorry Christof, didn't mean to offend you. Just saw the code and 
couldn't hold back...



--Klaus


[jQuery] Re: BlockUI fade out - Possible to disable for some instances?

2007-08-03 Thread Maggi

Great, thanks alot Mike!

On Aug 2, 9:01 pm, Mike Alsup [EMAIL PROTECTED] wrote:
 Hi Magnus,

 You can disable the fade effect when you call the blocking function
 using the fadeOut option.  For example:

 $.blockUI( Please wait, null, { fadeOut: 0 } );

 You can also change the time it takes to fade via the fadeTime option.

 Cheers!

 Mike

 On 8/2/07, Maggi [EMAIL PROTECTED] wrote:



  Hi everyone!

  I was wondering, and this question is mainly pointed to Mike, if I
  could disable the fade-out on the BlockUI within the BlockUI
  function?  I am using it to display a confirmation box, and if it is
  selected it displays another box, loads something with Ajax and then
  displays a Hurray box if successful.  When the fade out is used the
  old boxes can sometimes be shown in the background with the overlay.

  Kind regards,
  Magnus



[jQuery] Preloaders, Ajax and Jquery

2007-08-03 Thread [EMAIL PROTECTED]

Hi all !

I'm quite a newbie to jquery and like very much using it in my
everyday coding work.

I'd like to implement some preloaders on my website. In fact, I have a
number of blocks (divs) on one page and on loading it, I make an ajax
call to my database and retrieves css preferences from an xml doc
stored in a table. I then apply the css properties stored in the xml
through jquery to my blocks. In fact the ajax call sometimes take a
few seconds, so I would like to implement a preloader till the
preferences take effect.

Do you have an idea of how I could implement this.

Thanks in advance.

zool2o



[jQuery] Apple style gallery popup

2007-08-03 Thread flyingbuddha

Hi people,

I'm trying to create a gallery animation similar to the one here:
http://www.apple.com/macosx/leopard/features/desktop.html

When the user clicks on the pic, I want the larger version to expand
from the thumbnail version to the bigger version, moving from the
thumbnails picture into the centre of the screen as it grows.

I've tried using the interface effects plugin (Grow/Shrink), but I
don't know how to get the movement from thumb position to centre of
the screen.

Can anyone help me please?
Cheers in advance.



[jQuery] Datepicker. Hide dates from next/prev month

2007-08-03 Thread Dmitrii 'Mamut' Dimandt

Hi all.

Right now the default behaviour of Kevin's datepicker,
http://kelvinluck.com/assets/jquery/datePicker/v2/demo/, is to show the
dates from the previous/next month as well as the dates from the current
month.

What would be the easy way to make the datepicker show the dates from
the current month only?

Thank you


[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread spinnach


try it like this, .is() returns true or false so you have to use it in 
an if statement:


$(a.saveConfig).click(function() {
  if ($('div.detail').is(':visible')) alert('Hey this works');
});

dennis.

Pete wrote:

I'm trying to create a link that when clicked will produce an alert if
there are any visible divs (all .detail divs are hidden by default).
I have the following function but it doesn't seem I'm doing it
correctly; nothing happens regardless of the visibility status of the
divs.

$(a.saveConfig).click(function() {
$('div.detail').is(':visible'), (function () {
alert('Hey this works');

 });
 });


Is there a better way to do an if statement using JQuery selectors or
is there something I'm missing in my code?






[jQuery] IS condition true like an if statement?

2007-08-03 Thread Pete

I'm trying to create a link that when clicked will produce an alert if
there are any visible divs (all .detail divs are hidden by default).
I have the following function but it doesn't seem I'm doing it
correctly; nothing happens regardless of the visibility status of the
divs.

$(a.saveConfig).click(function() {
$('div.detail').is(':visible'), (function () {
alert('Hey this works');

 });
 });


Is there a better way to do an if statement using JQuery selectors or
is there something I'm missing in my code?



[jQuery] Superfish, Click no Hover

2007-08-03 Thread kristin

I'm trying to modify superfish to open when u click on the parent
link, insead of when you hover over it, but I'm not having any luck.

I'm not that great at js when it comes to writing it from scratch, but
I can take what you give me and run with it.

Any suggestions would be helpful.  Thanks!



[jQuery] Re: select .change event not firing on up/down arrow press

2007-08-03 Thread Jack Killpatrick

Ah, yes, I see that now. Works for me ;-) thx for pointing that out!

Dan G. Switzer, II wrote:

When the user has changed the value with the keyboard, it will fire
the change event when it loses focus. (I think that's right..)



Correct. 


The browsers won't fire the onchange event on a select element when you're
using the keyboard until you're finished changing the value--which when
using the keyboard is when you change focus.




  




[jQuery] Re: Do you think jQuery's documentation is enought?

2007-08-03 Thread njsuperfreak

I would like it to list every built-in function like in (MySql), and
make it searchable, with more real world examples. The problem I ran
into lastnight is I was trying to load a ext JavaScript file, and I
forgot the tutorial with the examples. I tried doing a search, and the
result was kind of garbled, and hard to read. So I got fustrated and
just rewrote the thing.

I all think your doing a wonderful job, and I bought the book as well!



[jQuery] Re: select .change event not firing on up/down arrow press

2007-08-03 Thread Collin Allen

When the user has changed the value with the keyboard, it will fire
the change event when it loses focus. (I think that's right..)


On Aug 3, 3:16 am, Jack Killpatrick [EMAIL PROTECTED] wrote:
 Hi, wondering if anyone knows why this might be happening:

 I've attached a .change event to a set of select boxes:

 $('#ml_cartItems [EMAIL PROTECTED]').change(function() {
 var productID = this.id.split('_')[1];
 MLStore.changeItemQty( productID, $(this).val() );
 });

 The change event fires fine when the user changes the select box using
 the mouse, but not when the keyboard up/down arrow keys are used. Know why?

 Related question the MLStore.changeItemQty() function makes an ajax
 call. I don't want a user tooling up and down the select box, causing it
 to fire a slew of ajax calls. Any advice on how to handle that
 situation? I don't want to use blur, because I want the (eventual) ajax
 call to be fired just by changing the select box. I figure I can use a
 setTimeout or setInterval, but not sure what the most elegant way would be.

 TIA!
 Jack



[jQuery] Re: select .change event not firing on up/down arrow press

2007-08-03 Thread Dan G. Switzer, II

When the user has changed the value with the keyboard, it will fire
the change event when it loses focus. (I think that's right..)

Correct. 

The browsers won't fire the onchange event on a select element when you're
using the keyboard until you're finished changing the value--which when
using the keyboard is when you change focus.





[jQuery] Re: Two words for Jquery

2007-08-03 Thread Frank

Bravo jquery!!

Frank

On Aug 2, 2:10 am, David Duymelinck [EMAIL PROTECTED] wrote:
 js ez

 -- David

 Geoffrey Knutzen schreef:



  Remember, the two words must be less than a total of 20 characters
  (compressed)
  :)

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
  Behalf Of David Duymelinck
  Sent: Wednesday, August 01, 2007 6:41 AM
  To: jquery-en@googlegroups.com
  Subject: [jQuery] Re: Two words for Jquery

  Javascript Effordless (in most cases)

  -- David

  Tane Piper schreef:

  Bloody Brilliant!

  (I wonder how many other 2 word ways there are to describe jQuery)

  On 8/1/07, Richard D. Worth [EMAIL PROTECTED] wrote:

  Here here.

  - Richard

  On 8/1/07, kiwwwi [EMAIL PROTECTED] wrote:

  jQuery Rocks!!

  oh... possibly will add two more words;

  Thank you :)

  I'm not the best scripter and jquery has simply allowed me to
  accomplish with my own personal site so much more than I would
  have otherwise attempted.  You people behind jquery are genious and
  your work is great, thanks.

  Kiwwwi.

 --
 David Duymelinck
 
 [EMAIL PROTECTED]



[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Ganeshji Marwaha
Yes, is() method returns true/false. This is one of the few methods which
doesnt return a jquery object because it makes more sense to return boolean.


-GTG

On 8/3/07, spinnach [EMAIL PROTECTED] wrote:


 try it like this, .is() returns true or false so you have to use it in
 an if statement:

 $(a.saveConfig).click(function() {
if ($('div.detail').is(':visible')) alert('Hey this works');
 });

 dennis.

 Pete wrote:
  I'm trying to create a link that when clicked will produce an alert if
  there are any visible divs (all .detail divs are hidden by default).
  I have the following function but it doesn't seem I'm doing it
  correctly; nothing happens regardless of the visibility status of the
  divs.
 
  $(a.saveConfig).click(function() {
$('div.detail').is(':visible'), (function () {
alert('Hey this works');
 
 });
   });
 
 
  Is there a better way to do an if statement using JQuery selectors or
  is there something I'm missing in my code?
 
 




[jQuery] Re: Superfish, Click no Hover

2007-08-03 Thread Joel Birch


Hi Kristin,

It's a silly hour in Australia and I'm not really awake, but I  
quickly changed this:


$.fn.applyHovers = function(){
return this[($.fn.hoverIntent) ? 'hoverIntent' : 'hover'](over,out);
};

...to this:

$.fn.applyHovers = function(){
if (o.useClick) {
return this.toggle(over,out);
} else {
return this[($.fn.hoverIntent) ? 'hoverIntent' : 
'hover'](over,out);
}
};

and then add the new useClick option to the defaults by changing this:

var $sf = this,
defaults = {
hoverClass  : 'sfHover',
pathClass   : 'overideThisToUse',
delay   : 500,
animation   : {opacity:'show'},
speed   : 'normal'
},

to this:

var $sf = this,
defaults = {
hoverClass  : 'sfHover',
pathClass   : 'overideThisToUse',
delay   : 500,
animation   : {opacity:'show'},
speed   : 'normal',
	useClick		: true /*this should really be false by default and set to  
true on initialisation, but easier to make it true whilst developing  
this*/

},

...and it's sort of a start towards what you want. However, submenus  
start to close when you don't want them to because using toggle is  
not the right solution here and my brain wants to sleep. Might be a  
starting point for you though. Good luck.


I might think about this some more at a later date, but for now,  
...


Joel Birch.

P.S. I released version 1.2.2 yesterday which plays better with  
jQuery 1.1.3.1 so I suggest you begin with this new version. If you  
must use jQuery 1.1.2 or earlier, then there is a line in the new  
Superfish that you can delete to make it work for older jQuery. It's  
indicated with a comment.



On 04/08/2007, at 3:06 AM, kristin wrote:

I'm trying to modify superfish to open when u click on the parent
link, insead of when you hover over it, but I'm not having any luck.

I'm not that great at js when it comes to writing it from scratch, but
I can take what you give me and run with it.

Any suggestions would be helpful.  Thanks!




[jQuery] Re: select .change event not firing on up/down arrow press

2007-08-03 Thread Ganeshji Marwaha
i guess, as others have said, the browser will fire change events only when
the select box loses focus for keyboard navigation.
But don't code for this feature making that assumption, as i don't think
this behavior is the same across all browsers.
Either IE or FF (i can't remember which) fires change events during
keyboard navigation as well. Make sure u take that into consideration
as well.

-GTG

On 8/3/07, Jack Killpatrick [EMAIL PROTECTED] wrote:


 Hi, wondering if anyone knows why this might be happening:

 I've attached a .change event to a set of select boxes:

 $('#ml_cartItems [EMAIL PROTECTED]').change(function() {
 var productID = this.id.split('_')[1];
 MLStore.changeItemQty( productID, $(this).val() );
 });

 The change event fires fine when the user changes the select box using
 the mouse, but not when the keyboard up/down arrow keys are used. Know
 why?

 Related question the MLStore.changeItemQty() function makes an ajax
 call. I don't want a user tooling up and down the select box, causing it
 to fire a slew of ajax calls. Any advice on how to handle that
 situation? I don't want to use blur, because I want the (eventual) ajax
 call to be fired just by changing the select box. I figure I can use a
 setTimeout or setInterval, but not sure what the most elegant way would
 be.

 TIA!
 Jack





[jQuery] Re: select .change event not firing on up/down arrow press

2007-08-03 Thread Ganeshji Marwaha
klaus, how did u use timeout to prevent IE or Opera from firing change
events...

Or, did u mean that, to achieve cross-browser consistency, u didn't listen
for change events, rather chose to poll the select on an interval?

-GTG


On 8/3/07, Klaus Hartl [EMAIL PROTECTED] wrote:


 Ganeshji Marwaha wrote:
  i guess, as others have said, the browser will fire change events only
  when the select box loses focus for keyboard navigation.
  But don't code for this feature making that assumption, as i don't think
  this behavior is the same across all browsers.
  Either IE or FF (i can't remember which) fires change events during
 keyboard navigation as well. Make sure u take that into consideration as
 well.

 IE and Opera fire the change event immediatly during keyboard
 navigation. To prevent that I used a timeout recently, just like
 keypress for autocompletion.


 --Klaus



[jQuery] Re: select .change event not firing on up/down arrow press

2007-08-03 Thread Klaus Hartl


Ganeshji Marwaha wrote:
i guess, as others have said, the browser will fire change events only 
when the select box loses focus for keyboard navigation.
But don't code for this feature making that assumption, as i don't think 
this behavior is the same across all browsers.

Either IE or FF (i can't remember which) fires change events during keyboard 
navigation as well. Make sure u take that into consideration as well.


IE and Opera fire the change event immediatly during keyboard 
navigation. To prevent that I used a timeout recently, just like 
keypress for autocompletion.



--Klaus


[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Klaus Hartl


Pete wrote:

I'm trying to create a link that when clicked will produce an alert if
there are any visible divs (all .detail divs are hidden by default).
I have the following function but it doesn't seem I'm doing it
correctly; nothing happens regardless of the visibility status of the
divs.

$(a.saveConfig).click(function() {
$('div.detail').is(':visible'), (function () {
alert('Hey this works');

 });
 });


Is there a better way to do an if statement using JQuery selectors or
is there something I'm missing in my code?


The good thing about jQuery is that it has that if staterment kind of 
built-in. If the selector doesn't match anything all the subsequently 
chained functions are not executed. This only works with jQuery methods 
of course but not with an alert like in your example:


$('div.detail:visible').append('I'm visible');

The string is appended only if div.detail is visible.

If you need to execute a non jQuery function you can still use the 
each() method to avoid an if statement:


$('div.detail:visible').each(function() {
alert('Hey this works');
});


--Klaus


[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Pete

I guess I'm still not getting else out of this.  I thought I had it
figured out

I think what's confusing to me as a n00b is that if does not seem to
be closed.  How would I accomplish an else condition?

On Aug 3, 11:27 am, Klaus Hartl [EMAIL PROTECTED] wrote:
 Pete wrote:
  I'm trying to create a link that when clicked will produce an alert if
  there are any visible divs (all .detail divs are hidden by default).
  I have the following function but it doesn't seem I'm doing it
  correctly; nothing happens regardless of the visibility status of the
  divs.

  $(a.saveConfig).click(function() {
 $('div.detail').is(':visible'), (function () {
 alert('Hey this works');

  });
   });

  Is there a better way to do an if statement using JQuery selectors or
  is there something I'm missing in my code?

 The good thing about jQuery is that it has that if staterment kind of
 built-in. If the selector doesn't match anything all the subsequently
 chained functions are not executed. This only works with jQuery methods
 of course but not with an alert like in your example:

 $('div.detail:visible').append('I'm visible');

 The string is appended only if div.detail is visible.

 If you need to execute a non jQuery function you can still use the
 each() method to avoid an if statement:

 $('div.detail:visible').each(function() {
  alert('Hey this works');

 });

 --Klaus



[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Pete

Sorry...  I figured it out fairly easily.  Still learning over here.
Thanks for the help!

On Aug 3, 10:57 am, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 Yes, is() method returns true/false. This is one of the few methods which
 doesnt return a jquery object because it makes more sense to return boolean.

 -GTG

 On 8/3/07, spinnach [EMAIL PROTECTED] wrote:



  try it like this, .is() returns true or false so you have to use it in
  an if statement:

  $(a.saveConfig).click(function() {
 if ($('div.detail').is(':visible')) alert('Hey this works');
  });

  dennis.

  Pete wrote:
   I'm trying to create a link that when clicked will produce an alert if
   there are any visible divs (all .detail divs are hidden by default).
   I have the following function but it doesn't seem I'm doing it
   correctly; nothing happens regardless of the visibility status of the
   divs.

   $(a.saveConfig).click(function() {
 $('div.detail').is(':visible'), (function () {
 alert('Hey this works');

  });
});

   Is there a better way to do an if statement using JQuery selectors or
   is there something I'm missing in my code?



[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Pete

I'm still confused about one thing though.  How does the else portion
work?  Sorry for being such a noob, but I haven't been able to find
the syntax using IS as an if statment through Jquery.



On Aug 3, 10:57 am, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 Yes, is() method returns true/false. This is one of the few methods which
 doesnt return a jquery object because it makes more sense to return boolean.

 -GTG

 On 8/3/07, spinnach [EMAIL PROTECTED] wrote:



  try it like this, .is() returns true or false so you have to use it in
  an if statement:

  $(a.saveConfig).click(function() {
 if ($('div.detail').is(':visible')) alert('Hey this works');
  });

  dennis.

  Pete wrote:
   I'm trying to create a link that when clicked will produce an alert if
   there are any visible divs (all .detail divs are hidden by default).
   I have the following function but it doesn't seem I'm doing it
   correctly; nothing happens regardless of the visibility status of the
   divs.

   $(a.saveConfig).click(function() {
 $('div.detail').is(':visible'), (function () {
 alert('Hey this works');

  });
});

   Is there a better way to do an if statement using JQuery selectors or
   is there something I'm missing in my code?



[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Pete

PERFECT!  That helps me out quite a bit since I didn't really know the
syntax on JQuery conditional statements.

On Aug 3, 10:26 am, spinnach [EMAIL PROTECTED] wrote:
 try it like this, .is() returns true or false so you have to use it in
 an if statement:

 $(a.saveConfig).click(function() {
if ($('div.detail').is(':visible')) alert('Hey this works');

 });

 dennis.

 Pete wrote:
  I'm trying to create a link that when clicked will produce an alert if
  there are any visible divs (all .detail divs are hidden by default).
  I have the following function but it doesn't seem I'm doing it
  correctly; nothing happens regardless of the visibility status of the
  divs.

  $(a.saveConfig).click(function() {
 $('div.detail').is(':visible'), (function () {
 alert('Hey this works');

  });
   });

  Is there a better way to do an if statement using JQuery selectors or
  is there something I'm missing in my code?



[jQuery] jCarousel question

2007-08-03 Thread Fasita

Hi, quick question about jCarousel:

I have 3 items in the carousel, showing only one at a time. What I'm
trying to accomplish is have the middle item showing on start, so you
can scroll one item left or right.

When I set the 'start: 2' option, it does start on the middle item,
but when scrolling left nothing appears, and when scrolling right the
middle item repeats, even though the content for each item is
different. This is repeated in all browsers. Am I doing something
wrong or going about this the wrong way?

Thanks in advance for the help!



[jQuery] Re: select .change event not firing on up/down arrow press

2007-08-03 Thread Klaus Hartl


Ganeshji Marwaha wrote:
klaus, how did u use timeout to prevent IE or Opera from firing change 
events...


Or, did u mean that, to achieve cross-browser consistency, u didn't 
listen for change events, rather chose to poll the select on an interval?



I'm simply delaying the handler being executed via setTimeout to prevent 
the event handler fired too early if a user navigates quickly through 
the select with the keyboard. In my case I needed to submit the form, 
which is of course critical:


var change;
$('select').bind('change', function() {
var form = this.form, submit = function() { form.submit(); };
if ($.browser.msie || $.browser.opera) {
clearTimeout(change);
change = setTimeout(submit, 400);
} else {
submit();
}
});


I'd say that is still not 100% bulletproof, but it works...


--Klaus


[jQuery] SevenMagOnline.com Feature blocks

2007-08-03 Thread Ty

Anyone have any idea how to do something like this in jQuery, I think
it's built using mooTools, that's in the js calls anyways...
http://www.sevenmagonline.com/
The 4-thumbnail blocks on the homepage just beneath the large flash
movie of features, that click and expand on mouseover. The click they
used soundManager2, which I've experimented with and didn't have much
success in IE.
Anyways the expanding part is what I like, I guess it's just an expand
on hover, and the other div's resize accordingly. anyone seen anything
similar with jQ or a plugin?

Pretty impressive site overall, since it's got some js features,
thought it was worth a mention here. Noticed it at the Expression
Engine Cms showcase.



[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Klaus Hartl


Pete wrote:

I guess I'm still not getting else out of this.  I thought I had it
figured out

I think what's confusing to me as a n00b is that if does not seem to
be closed.  How would I accomplish an else condition?



I highly recommend to make yourself familiar with JavaScript control 
structures. jQuery can do a lot for you but you still need to know the 
basics of JavaScript...

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Conditional_Statements#if...else_Statement

What do mean by not closed?

You can use an if statement without curly braces if there's only one
statement to be executed:

if (condition) alert('yes');

or

if (condition)
alert('yes');

Together with else:

if (condition) alert('yes');
else alert('no');

I tend to always use curly braces, that makes it easier to add another 
line to the conditional blocks and to me it's easier to read, but that's 
just a personal taste I guess. You'll need them anyway to group multiple 
statements in a block:


if (condition) {
alert('yes');
alert('I said yes');
} else {
alert('no');
alert('I said no');
}

Back to your example:

$(a.saveConfig).click(function() {
if ($('div.detail').is(':visible')) {
alert('Hey this works');
} else {
alert('Hey this doesn't work');
}
});


HTH


--Klaus





[jQuery] Re: select .change event not firing on up/down arrow press

2007-08-03 Thread Ganeshji Marwaha
gotcha - thanks

-GTG

On 8/3/07, Klaus Hartl [EMAIL PROTECTED] wrote:


 Ganeshji Marwaha wrote:
  klaus, how did u use timeout to prevent IE or Opera from firing change
  events...
 
  Or, did u mean that, to achieve cross-browser consistency, u didn't
  listen for change events, rather chose to poll the select on an
 interval?


 I'm simply delaying the handler being executed via setTimeout to prevent
 the event handler fired too early if a user navigates quickly through
 the select with the keyboard. In my case I needed to submit the form,
 which is of course critical:

 var change;
 $('select').bind('change', function() {
  var form = this.form, submit = function() { form.submit(); };
  if ($.browser.msie || $.browser.opera) {
  clearTimeout(change);
  change = setTimeout(submit, 400);
  } else {
  submit();
  }
 });


 I'd say that is still not 100% bulletproof, but it works...


 --Klaus



[jQuery] Resig's Accordion Lite

2007-08-03 Thread Mitchell Waite
Hi John

 

I set up your menu so its as close to the one from Adobe as I could, given
my meager knowledgebase.

 

Adobe

http://www.whatbird.com/wwwroot/Components/Accordion%20Menu.html

 

Resig

http://www.whatbird.com/wwwroot/Components/Accordion%20Menu_Resig.html

 

There are two things missing from Resig I would love to see. Maybe others
won't care about these.

 

1.  Adobe changes color when you click on the accordian, and gives it focus.
That's a nice thing. Click outside and it loses focus and goes page to the
default colors.

2.  I could not figure out how to use other easing effects, which would make
it more flexible. I do see how to control the duration.

 

I moved the css into an external sheet along with the JS.

 

Regardless you have created an amazing plug in and I urge you to continue to
work on it. I've looked at a ton of accordions and this one makes the others
look like dark stuff that smells funny. The official jQ accordian is the
pits IMHO.

 

Mitch

 



[jQuery] Re: SevenMagOnline.com Feature blocks

2007-08-03 Thread Ganeshji Marwaha
i am working on something like that... if i get lucky and find some free
time out this weekend, you can probably see an alpha version by monday
or tuesday.

-GTG

On 8/3/07, Ty [EMAIL PROTECTED] wrote:


 Anyone have any idea how to do something like this in jQuery, I think
 it's built using mooTools, that's in the js calls anyways...
 http://www.sevenmagonline.com/
 The 4-thumbnail blocks on the homepage just beneath the large flash
 movie of features, that click and expand on mouseover. The click they
 used soundManager2, which I've experimented with and didn't have much
 success in IE.
 Anyways the expanding part is what I like, I guess it's just an expand
 on hover, and the other div's resize accordingly. anyone seen anything
 similar with jQ or a plugin?

 Pretty impressive site overall, since it's got some js features,
 thought it was worth a mention here. Noticed it at the Expression
 Engine Cms showcase.




[jQuery] Coder vs Designer?

2007-08-03 Thread Matt Penner
Good catch Klaus  Christof.  I am a coder and relatively new to CSS.  I do
have a little tenancy towards classitis which I am trying to cure myself
of.

Thanks for the good suggestions!
Matt

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Christof Donat
Sent: Friday, August 03, 2007 2:16 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Coder vs Designer?


Hi,

 I spot a typical case of classitis here.

I just used Matts original here.

 Why not getting a little more
 semantic and use a real heading instead of the least semantic element
 with a class heading:

 div
  h2Course Title/h2
  p.../p
 /div

 Less bloated, less to transfer...

How about

dtCourse Title/dt
dd.../dd

And then in the original code have

dl id=courseHist/dl

Even less bloated, less to transfer, more expressive and my suggested code
should still work (as it does with your suggestion).

Christof


[jQuery] Re: forcing string literals

2007-08-03 Thread Klaus Hartl


Todd Harris wrote:

Hi all -

I have a JSON response with a parameter like

count: 0;

But if I try appending this value in a chained command, jQuery
interprets this as false and not a string literal.

eg
$(counts_col).append(json.count);

Is there a trick to making 0 a string literal and not a boolean
false?  eval()?

Thanks!



Stay away from eval ;-)

Here's the little trick, make it a string:

$(counts_col).append(json.count + '');



--Klaus


[jQuery] Re: SevenMagOnline.com Feature blocks

2007-08-03 Thread Ty

Wow OK I hadn't realized the thumbnails swap out when a main menu item
is hovered.
I thought maybe they were just set to cycle on intervals.

On Aug 3, 3:00 pm, Ty [EMAIL PROTECTED] wrote:
 Anyone have any idea how to do something like this in jQuery, I think
 it's built using mooTools, that's in the js calls 
 anyways...http://www.sevenmagonline.com/
 The 4-thumbnail blocks on the homepage just beneath the large flash
 movie of features, that click and expand on mouseover. The click they
 used soundManager2, which I've experimented with and didn't have much
 success in IE.
 Anyways the expanding part is what I like, I guess it's just an expand
 on hover, and the other div's resize accordingly. anyone seen anything
 similar with jQ or a plugin?

 Pretty impressive site overall, since it's got some js features,
 thought it was worth a mention here. Noticed it at the Expression
 Engine Cms showcase.



[jQuery] forcing string literals

2007-08-03 Thread Todd Harris

Hi all -

I have a JSON response with a parameter like

count: 0;

But if I try appending this value in a chained command, jQuery
interprets this as false and not a string literal.

eg
$(counts_col).append(json.count);

Is there a trick to making 0 a string literal and not a boolean
false?  eval()?

Thanks!



[jQuery] Help with dblclick

2007-08-03 Thread Terry B

I have a bunch of events and I loop through them.  I would like to
create a double-click effect so that I call function
eventDoubleClick but I want that event to pass its index value, as
such:

for (i=0, iarrayLength; i++)
{
$t(#event_ + i).dblclick(function () {eventDoubleClick(i)});
}


Basically all the above does is then setup so that all the event
dblclicks are calling eventDoubleClick(i) which uses the last i value;
instead of setting them up as eventDoubleClick(1),
eventDoubleClick(2),  eventDoubleClick(n)


I have tried putting   around the i and event the entire function
call...  so any help would be great so I don't sit here all day
beating up my head (or just getting sick of it and browsing the
archives at http://www.userfriendly.org  :P  )


Thanks

~Terry



[jQuery] Scrolling a div area without scrolling the page?

2007-08-03 Thread [EMAIL PROTECTED]

Hi,

I don't know if jquery will be able to address this but I thought I
would try anyway.

Is there a way to scroll a div area (which has an overflow:auto) to an
anchor point within the div without scrolling the page (i.e., the page
should remain stationary)?

I've coded a basic html example at http://matthewmoore.info/jquery/example.html.
You'll see the page scroll when you click on a letter at the top of
the div.

Any ideas?

Thanks in advance,
Matthew



[jQuery] Re: Help with dblclick

2007-08-03 Thread Michael Geary

 From: Terry B
 
 I have a bunch of events and I loop through them.  I would 
 like to create a double-click effect so that I call function 
 eventDoubleClick but I want that event to pass its index value, as
 such:
 
 for (i=0, iarrayLength; i++)
 {
 $t(#event_ + i).dblclick(function () {eventDoubleClick(i)}); }
 
 
 Basically all the above does is then setup so that all the 
 event dblclicks are calling eventDoubleClick(i) which uses 
 the last i value; instead of setting them up as 
 eventDoubleClick(1), eventDoubleClick(2),  eventDoubleClick(n)

As is so often the case, what you want is a closure. Get that i variable
to be a local variable in a function called inside the loop. Here is one way
you could code it:

   for(i=0, iarrayLength; i++) {
  (function( i ) {
 $t( #event_ + i ).dblclick( function () { eventDoubleClick(i);
});
  })( i );
   }

If that seems too obscure, this does the same thing in a more spelled-out
way:

   function addclick( i ) {
  $t( #event_ + i ).dblclick( function () { eventDoubleClick(i); });
   }

   for(i=0, iarrayLength; i++) {
  addclick( i );
   }

Either way, each time you call the function inside the loop, it creates a
new closure that has its own copy of the i variable.

-Mike



[jQuery] Re: SevenMagOnline.com Feature blocks

2007-08-03 Thread Rey Bango


Go, go, go Ganeshji!!!

Ganeshji Marwaha wrote:
i am working on something like that... if i get lucky and find some free 
time out this weekend, you can probably see an alpha version by monday or tuesday.


-GTG

On 8/3/07, * Ty* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:


Anyone have any idea how to do something like this in jQuery, I think
it's built using mooTools, that's in the js calls anyways...
http://www.sevenmagonline.com/
The 4-thumbnail blocks on the homepage just beneath the large flash
movie of features, that click and expand on mouseover. The click they
used soundManager2, which I've experimented with and didn't have much
success in IE.
Anyways the expanding part is what I like, I guess it's just an expand
on hover, and the other div's resize accordingly. anyone seen anything
similar with jQ or a plugin?

Pretty impressive site overall, since it's got some js features,
thought it was worth a mention here. Noticed it at the Expression
Engine Cms showcase.




[jQuery] Re: Resig's Accordion Lite

2007-08-03 Thread Dragan Krstic
In my inverted hover, I copy-pasted easing function from Interface.

2007/8/3, Mitchell Waite [EMAIL PROTECTED]:

  Hi John



 I set up your menu so its as close to the one from Adobe as I could, given
 my meager knowledgebase.



 Adobe

 http://www.whatbird.com/wwwroot/Components/Accordion%20Menu.html



 Resig

 http://www.whatbird.com/wwwroot/Components/Accordion%20Menu_Resig.html



 There are two things missing from Resig I would love to see. Maybe others
 won't care about these.



 1.  Adobe changes color when you click on the accordian, and gives it
 focus. That's a nice thing. Click outside and it loses focus and goes page
 to the default colors.

 2.  I could not figure out how to use other easing effects, which would
 make it more flexible. I do see how to control the duration.



 I moved the css into an external sheet along with the JS.



 Regardless you have created an amazing plug in and I urge you to continue
 to work on it. I've looked at a ton of accordions and this one makes the
 others look like dark stuff that smells funny. The official jQ accordian is
 the pits IMHO.



 Mitch






-- 
Dragan Krstić krdr
http://krdr.ebloggy.com/


[jQuery] Re: Hover accordion (as on apple.com)

2007-08-03 Thread Dragan Krstic
I added some styling to inverted accordion and changed functionality a
little bit. Now there's no need hoverIntent plugin. Still there's some
styling issues in IE6

It can be found on: http://www.bydot.net/hoveracc/hoveracc_4.htm

@John
Why callback in animation method doesn't work when using step function?

-- 
Dragan Krstić krdr
http://krdr.ebloggy.com/


[jQuery] Eloquent JavaScript hyper-book

2007-08-03 Thread Sean O


Hi,


Just wanted pass along a site I just came across that is a well-done
hyper-book titled Eloquent JavaScript.  It covers everything from basic
variables, strings, etc. to DOM, regular expressions and OOP.  As the author
states, it's aimed at the beginner JavaScript programmer, but experienced
users can find information of some use.  A nice touch is the click-to-run
code samples that launch in a console attached to the foot of the browser.

They even feature an off-line download of the hyper-book and a print
version.  All free.

http://eloquentjavascript.net/



SEAN O
http://www.sean-o.com
-- 
View this message in context: 
http://www.nabble.com/%22Eloquent-JavaScript%22-hyper-book-tf4214311s15494.html#a11989399
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: SevenMagOnline.com Feature blocks

2007-08-03 Thread LKK

I'm also interested in this effect - you can take a look at my first
rough code mockup:

http://www.kaaeklausen.dk/jquery_test/

the hover effect is by no means perfect (it works best in the latest
build of the webkit engine - if you use another browser your mileage
may vary), but maybe you or others can construct a better solution.



[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Frank

Was I misinformed or is the is(); used only with CSS?  If not,
is(click); should evaluate when click() is clicked.

Frank

On Aug 3, 2:12 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 Pete wrote:
  I guess I'm still not getting else out of this.  I thought I had it
  figured out

  I think what's confusing to me as a n00b is that if does not seem to
  be closed.  How would I accomplish an else condition?

 I highly recommend to make yourself familiar with JavaScript control
 structures. jQuery can do a lot for you but you still need to know the
 basics of 
 JavaScript...http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Condit...

 What do mean by not closed?

 You can use anifstatement without curly bracesifthere's only one
 statement to be executed:

 if(condition) alert('yes');

 or

 if(condition)
  alert('yes');

 Together with else:

 if(condition) alert('yes');
 else alert('no');

 I tend to always use curly braces, that makes it easier to add another
 line to the conditional blocks and to me it's easier to read, but that's
 just a personal taste I guess. You'll need them anyway to group multiple
 statements in a block:

 if(condition) {
  alert('yes');
  alert('I said yes');} else {

  alert('no');
  alert('I said no');

 }

 Back to your example:

 $(a.saveConfig).click(function() {
  if($('div.detail').is(':visible')) {
  alert('Hey this works');
  } else {
  alert('Hey this doesn't work');
  }

 });

 HTH

 --Klaus



[jQuery] Re: Help with dblclick

2007-08-03 Thread Terry B

i made it even more simply...  sry, took forever for the post to
actually post...

 $t(#event_ + i).dblclick(function () {eventDoubleClick(this)}); }

just send the object


On Aug 3, 4:03 pm, Michael Geary [EMAIL PROTECTED] wrote:
  From: Terry B

  I have a bunch of events and I loop through them.  I would
  like to create a double-click effect so that I call function
  eventDoubleClick but I want that event to pass its index value, as
  such:

  for (i=0, iarrayLength; i++)
  {
  $t(#event_ + i).dblclick(function () {eventDoubleClick(i)}); }

  Basically all the above does is then setup so that all the
  event dblclicks are calling eventDoubleClick(i) which uses
  the last i value; instead of setting them up as
  eventDoubleClick(1), eventDoubleClick(2),  eventDoubleClick(n)

 As is so often the case, what you want is a closure. Get that i variable
 to be a local variable in a function called inside the loop. Here is one way
 you could code it:

for(i=0, iarrayLength; i++) {
   (function( i ) {
  $t( #event_ + i ).dblclick( function () { eventDoubleClick(i);});

   })( i );
}

 If that seems too obscure, this does the same thing in a more spelled-out
 way:

function addclick( i ) {
   $t( #event_ + i ).dblclick( function () { eventDoubleClick(i); });
}

for(i=0, iarrayLength; i++) {
   addclick( i );
}

 Either way, each time you call the function inside the loop, it creates a
 new closure that has its own copy of the i variable.

 -Mike



[jQuery] Re: forcing string literals

2007-08-03 Thread Todd Harris

Aha!  Much thanks, Klaus!

On Aug 3, 1:38 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 Todd Harris wrote:
  Hi all -

  I have a JSON response with a parameter like

  count: 0;

  But if I try appending this value in a chained command, jQuery
  interprets this as false and not a string literal.

  eg
  $(counts_col).append(json.count);

  Is there a trick to making 0 a string literal and not a boolean
  false?  eval()?

  Thanks!

 Stay away from eval ;-)

 Here's the little trick, make it a string:

 $(counts_col).append(json.count + '');

 --Klaus



[jQuery] Re: Coldfusion 8 / Javascript image cropper

2007-08-03 Thread cfdvlpr

That is an awesome tag and thanks for leading me to it...

On Aug 2, 6:07 pm, Andy Matthews [EMAIL PROTECTED] wrote:
 This demo uses Prototype and Scriptaculous, but there's no reason that
 it shouldn't be able to use jQuery:

 http://cfsilence.com/blog/client/index.cfm/2007/8/2/Introducing-cfIma...



[jQuery] annoying newbie

2007-08-03 Thread jsmart

I have read through the site, and fear I am asking in the wrong place.
If I am, please accept my sincear apologies.

I use the modal pop up in many situations - it is fantastic! I am
forever indebted to the skills of the programmers, your skills make me
look clever!

I am trying to have the pop-up do something (upload an image in this
case) then when the image loads, pass the file name to a text box in
the form on the parent window. With the onload command I have been
able to make the window close automatically. My problem is passing the
data to the parent. I can do it if I make the child a seperate poop-up
window, but from modal, I get no - where. A huge amount of Googling
only led me to one related article which basically stated it was hard
to do, then gave some general ideas on how to do it.

Sadly, js is double dutch to me - I can php with the best of them,
html like a pro - css pretty darn well, but js? Not happening. I am
still studying, and trying to change this,

I do not expect you to do my work for me. Can you give me any clues
though? Maybe you know a working example I can peek at, maybe you know
a tutorial that will assist my plight?

Thank you so much for this wonderful code, and in advance for any
assistance you are able to give me.


Kindest regards,
John Smart



[jQuery] Best way to select a cell in a table?

2007-08-03 Thread Matt Penner
I have a table that represents a matrix with various columns and rows.  I
use AJAX/JSON to populate the various cells with data.  Not every cell will
contain an item of data and some may have more than one item.

What's the best way to select a specific cell of the table?

If I wanted the 2nd row 3rd cell the following works:
$(tr:eq(1), td:eq(2))

This is a rather simplistic example but is this better than, say, giving
every cell its own id or is there a completely different method that others
prefer?

Thanks,
Matt Penner


[jQuery] Unable to replicate what seems like a simple element via jQuery

2007-08-03 Thread Jim Newfer

Hello everyone,


After spending quite some time trying to figure this out, I have
resorted to asking for help because after trying what seems like
everything, I have yet to find a solution. So maybe someone could help
me out/point me in the right direction or offer some function names. I
have tried everything in regards to the .css() function, .load() and
removeAttr and attr() function to no avail. Something in my javascript
design process is failing me. Well enough of the introduction, what I
am doing is simple enough, and can be found here, jyte.com  The main
vote buttons on the page is what I am trying to do. My backend works
great via the $.get() function, except that my user can only vote once
because of classes getting changed and not being recognized. I want
the user to be able to continually swich their votes, 100 times if
they wanted. So far my design has been...

-Show normal buttons, onmousehover(show_vote_box())

div.Vote box (hidden by default, but shown using .show() in the
show_vote_box() function

div class=vote_for onmouseover=show_vote_for_color()
onclick=vote_for()/div
 -- these two
classes are hidden as well from the start because they are
 
contained within the vote box div
div class=vote_against onmouseover=show_vote_against_color()
onclickvote_against()/div

/div



Now it appears that the visual aspects work fine, UNTIL I vote, then
everything gets all screwy. From not letting me vote again, to not
recognizing changed classes.

Here is my code, hope this helps, any pointers, suggestions,
modifications are greatly appreciated.





Query File:


function showVote(){
$(div.show_votes).hide();
$(div.making_vote).show();
}

function restoreVote(){
$(div.making_vote).hide();
$(div.show_votes).show();
}

function positionFor(){
$(.make_vote_left).css(background-position, -240px 0pt);
}

function positionAgainst(){
$(.make_vote_right).css(background-position, -240px 0pt);
}

function positionForOff(){
$(div.make_vote_left).removeAttr(style);
}

function positionAgainstOff(){
$(div.make_vote_right).removeAttr(style);
}








function voteFor(story_id){
$.get(/stories/vote/1/+story_id, function(data){
$(.making_vote_left).addClass(left_selected);
$
(.making_vote_left).removeClass(making_vote_left);
alert(data);
});


}


function voteAgainst(story_id) {
$.get(/stories/vote/2/+story_id, function(data){
$(.making_vote_right).addClass(right_selected);
$
(.making_vote_right).removeClass(making_vote_right);


alert(data)
});
}









XHTML:

div id=story
h1 id=title?php echo $readstory['Story']['title']; ?/h1

p id=body?php echo $readstory['Story']['body']; ? /p
p id=related_storya href=/stories/submit/?php echo
$readstory['Story']['id'];?/?php echo $readstory['Story']['title'];?
Write A Related Story/a/p





div class=vote_box


div class=show_votes onmouseover=showVote() 

div class=?php if($already_voted_for) { ?vote_left_selected ?
php } else { ? vote_left ?php } ?
/div

div class=?php if($already_voted_against) { ?vote_right_selected ?
php } else { ?vote_right?php } ?
/div
/div



div class=making_vote style=display:none
onmouseout=restoreVote()


div class=make_vote_left onmouseover=positionFor()
onmouseout=positionForOff() onclick=voteFor(?php echo
$readstory['Story']['id']; ?)

/div


div class=make_vote_right
onmouseover=positionAgainst()onmouseout=positionAgainstOff()
onclick=voteAgainst(?php echo $readstory['Story']['id']; ?)

/div









/div





/div


/div







Any advice is GREATLY appreciated.

Sincerely,
Jim



[jQuery] Re: :eq vs :nth?

2007-08-03 Thread John Resig

Huh... I should probably nuke :nth().

--John

On 8/3/07, Karl Swedberg [EMAIL PROTECTED] wrote:
 They're the same, so you can use whichever you prefer.

 From jquery.js:

  nth: m[3]-0==i,
  eq: m[3]-0==i,



 --Karl
 _
 Karl Swedberg
 www.englishrules.com
 www.learningjquery.com





 On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
 I've searched the groups but I can't seem to find any related talk on this.

 What, if any, is the difference between using :eq(n) and :nth(n)?

 I'd like to know before I start standardizing on one or the other.

 Thanks,
 Matt Penner




[jQuery] Re: :eq vs :nth?

2007-08-03 Thread Ganeshji Marwaha
i agree, but i saw hasClass() in the roadMap for 1.2.
So, i thought you were adding some convenience methods. So thought i would
give my .02 coz, this sometimes had a tendency to increase my code and
decrease legibility with a lot of .lt(var + 1) and .gt(var - 1).

I, in particular don't have a problem with this, coz my version of jquery
has these methods ;-).

-GTG

On 8/3/07, John Resig [EMAIL PROTECTED] wrote:


 Probably not since :le(3) is the same thing as :lt(4).

 --John

 On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
  meantime, is there any possibility to add le() and ge() (for lesser than
 or
  equal to and greater than or equal to).
  I am under the assumption it is not already there.
 
  -GTG
 
 
  On 8/3/07, John Resig [EMAIL PROTECTED] wrote:
  
   Huh... I should probably nuke :nth().
  
   --John
  
   On 8/3/07, Karl Swedberg [EMAIL PROTECTED] wrote:
They're the same, so you can use whichever you prefer.
   
From jquery.js:
   
 nth: m[3]-0==i,
 eq: m[3]-0==i,
   
   
   
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com
   
   
   
   
   
On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
I've searched the groups but I can't seem to find any related talk
 on
  this.
   
What, if any, is the difference between using :eq(n) and :nth(n)?
   
I'd like to know before I start standardizing on one or the other.
   
Thanks,
Matt Penner
   
   
  
 
 



[jQuery] Re: Unable to replicate what seems like a simple element via jQuery

2007-08-03 Thread John Resig

Do you have a page using the jQuery code? It's a little bit hard to
tell from the example. Right now, the only thing that seems strange is
.removeAttr(style), but it's hard to say without seeing it in
action.

--John

On 8/3/07, Jim Newfer [EMAIL PROTECTED] wrote:

 Hello everyone,


 After spending quite some time trying to figure this out, I have
 resorted to asking for help because after trying what seems like
 everything, I have yet to find a solution. So maybe someone could help
 me out/point me in the right direction or offer some function names. I
 have tried everything in regards to the .css() function, .load() and
 removeAttr and attr() function to no avail. Something in my javascript
 design process is failing me. Well enough of the introduction, what I
 am doing is simple enough, and can be found here, jyte.com  The main
 vote buttons on the page is what I am trying to do. My backend works
 great via the $.get() function, except that my user can only vote once
 because of classes getting changed and not being recognized. I want
 the user to be able to continually swich their votes, 100 times if
 they wanted. So far my design has been...

 -Show normal buttons, onmousehover(show_vote_box())

 div.Vote box (hidden by default, but shown using .show() in the
 show_vote_box() function

 div class=vote_for onmouseover=show_vote_for_color()
 onclick=vote_for()/div
  -- these two
 classes are hidden as well from the start because they are

 contained within the vote box div
 div class=vote_against onmouseover=show_vote_against_color()
 onclickvote_against()/div

 /div



 Now it appears that the visual aspects work fine, UNTIL I vote, then
 everything gets all screwy. From not letting me vote again, to not
 recognizing changed classes.

 Here is my code, hope this helps, any pointers, suggestions,
 modifications are greatly appreciated.





 Query File:


 function showVote(){
 $(div.show_votes).hide();
 $(div.making_vote).show();
 }

 function restoreVote(){
 $(div.making_vote).hide();
 $(div.show_votes).show();
 }

 function positionFor(){
 $(.make_vote_left).css(background-position, -240px 0pt);
 }

 function positionAgainst(){
 $(.make_vote_right).css(background-position, -240px 0pt);
 }

 function positionForOff(){
 $(div.make_vote_left).removeAttr(style);
 }

 function positionAgainstOff(){
 $(div.make_vote_right).removeAttr(style);
 }








 function voteFor(story_id){
 $.get(/stories/vote/1/+story_id, function(data){
 $(.making_vote_left).addClass(left_selected);
 $
 (.making_vote_left).removeClass(making_vote_left);
 alert(data);
 });


 }


 function voteAgainst(story_id) {
 $.get(/stories/vote/2/+story_id, function(data){
 $(.making_vote_right).addClass(right_selected);
 $
 (.making_vote_right).removeClass(making_vote_right);


 alert(data)
 });
 }









 XHTML:

 div id=story
 h1 id=title?php echo $readstory['Story']['title']; ?/h1

 p id=body?php echo $readstory['Story']['body']; ? /p
 p id=related_storya href=/stories/submit/?php echo
 $readstory['Story']['id'];?/?php echo $readstory['Story']['title'];?
 Write A Related Story/a/p





 div class=vote_box


 div class=show_votes onmouseover=showVote() 

 div class=?php if($already_voted_for) { ?vote_left_selected ?
 php } else { ? vote_left ?php } ?
 /div

 div class=?php if($already_voted_against) { ?vote_right_selected ?
 php } else { ?vote_right?php } ?
 /div
 /div



 div class=making_vote style=display:none
 onmouseout=restoreVote()


 div class=make_vote_left onmouseover=positionFor()
 onmouseout=positionForOff() onclick=voteFor(?php echo
 $readstory['Story']['id']; ?)

 /div


 div class=make_vote_right
 onmouseover=positionAgainst()onmouseout=positionAgainstOff()
 onclick=voteAgainst(?php echo $readstory['Story']['id']; ?)

 /div









 /div





 /div


 /div







 Any advice is GREATLY appreciated.

 Sincerely,
 Jim




[jQuery] Re: Best way to select a cell in a table?

2007-08-03 Thread Ganeshji Marwaha
I don't think ur selector is right for selecting the 2nd row, 3rd column.
It most probably is
returning you more elements depending on the number of rows u have.
Eg: if you have 3 rows in your table, then it should return, 1 tr and
3 td's each representing the 3rd column in every row.

I would use $(td:eq(2), $(tr:eq(1)))

-GTG

On 8/3/07, Matt Penner [EMAIL PROTECTED] wrote:

 I have a table that represents a matrix with various columns and rows.  I
 use AJAX/JSON to populate the various cells with data.  Not every cell will
 contain an item of data and some may have more than one item.

 What's the best way to select a specific cell of the table?

 If I wanted the 2nd row 3rd cell the following works:
 $(tr:eq(1), td:eq(2))

 This is a rather simplistic example but is this better than, say, giving
 every cell its own id or is there a completely different method that others
 prefer?

 Thanks,
 Matt Penner




[jQuery] Re: :eq vs :nth?

2007-08-03 Thread John Resig

Well, it  should be noted that we're remove .lt() .gt() and .eq() in
favor of a new .slice() method, which will be able to produce
identical results (and even better).

--John

On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 i agree, but i saw hasClass() in the roadMap for 1.2.
 So, i thought you were adding some convenience methods. So thought i would
 give my .02 coz, this sometimes had a tendency to increase my code and
 decrease legibility with a lot of .lt(var + 1) and .gt(var - 1).

 I, in particular don't have a problem with this, coz my version of jquery
 has these methods ;-).


 -GTG

 On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:
 
  Probably not since :le(3) is the same thing as :lt(4).
 
  --John
 
  On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
   meantime, is there any possibility to add le() and ge() (for lesser than
 or
   equal to and greater than or equal to).
   I am under the assumption it is not already there.
  
   -GTG
  
  
   On 8/3/07, John Resig [EMAIL PROTECTED]  wrote:
   
Huh... I should probably nuke :nth().
   
--John
   
On 8/3/07, Karl Swedberg [EMAIL PROTECTED]  wrote:
 They're the same, so you can use whichever you prefer.

 From jquery.js:

  nth: m[3]-0==i,
  eq: m[3]-0==i,



 --Karl
 _
 Karl Swedberg
 www.englishrules.com
 www.learningjquery.com





 On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
 I've searched the groups but I can't seem to find any related talk
 on
   this.

 What, if any, is the difference between using :eq(n) and :nth(n)?

 I'd like to know before I start standardizing on one or the other.

 Thanks,
 Matt Penner


   
  
  
 




[jQuery] Re: jCarouselLite problem

2007-08-03 Thread Ganeshji Marwaha
i think, u might not be specifying the attributes width and height for the
images within the carousel.
Try, specifying width and height attributes and lemme know if it works.

-GTG

On 8/3/07, Bruce MacKay [EMAIL PROTECTED] wrote:


 Hi folks/Ganeshji

 I'm having trouble getting jCaroselLite to work first time round.

 When I either link to a page containing a carousel or to a thickbox
 containing a carousel, in neither case do the images appear when that
 page/thickbox is visited via the link.

 However, if I refresh the page, the images/the carousel appears
 immediately.

 I'm trigger the plugin as...

 $(document).ready(function() {
$(.mixedContent .jCarouselLite).jCarouselLite({
  btnNext: .mixedContent .next,
  btnPrev: .mixedContent .prev,
  visible: 2,
  scroll: 2
  });
 });

 I'm sorry, but I just can see what it is that I'm doing
 wrong.  Suggestions?

 Thanks, Bruce




[jQuery] Re: jCarousel question

2007-08-03 Thread Ganeshji Marwaha
are u using 
jcarousellitehttp://www.gmarwaha.com/jquery/jcarousellite/index.php
, or jcarousel http://sorgalla.com/jcarousel/.

Can you post a test page somewhere so we can take a look?

-GTG


On 8/3/07, Fasita [EMAIL PROTECTED] wrote:


 Hi, quick question about jCarousel:

 I have 3 items in the carousel, showing only one at a time. What I'm
 trying to accomplish is have the middle item showing on start, so you
 can scroll one item left or right.

 When I set the 'start: 2' option, it does start on the middle item,
 but when scrolling left nothing appears, and when scrolling right the
 middle item repeats, even though the content for each item is
 different. This is repeated in all browsers. Am I doing something
 wrong or going about this the wrong way?

 Thanks in advance for the help!




[jQuery] Re: :eq vs :nth?

2007-08-03 Thread Klaus Hartl


Ganeshji Marwaha wrote:
meantime, is there any possibility to add le() and ge() (for lesser than 
or equal to and greater than or equal to).

I am under the assumption it is not already there.


these are gt() and lt()


--Klaus


[jQuery] Re: annoying newbie

2007-08-03 Thread Josh Nathanson


I haven't done it, but isn't the modal window just a div on the parent page? 
I would think you could add a function in the onHide callback that would 
select the appropriate modal window field and then populate your parent 
window field with the value.  Not tested, but something like this should 
suffice:


onHide: function() {
   $(#parentfilefield).val($(#modalfilefield));
}

-- Josh

- Original Message - 
From: jsmart [EMAIL PROTECTED]

To: jQuery (English) jquery-en@googlegroups.com
Sent: Friday, August 03, 2007 1:51 PM
Subject: [jQuery] annoying newbie




I have read through the site, and fear I am asking in the wrong place.
If I am, please accept my sincear apologies.

I use the modal pop up in many situations - it is fantastic! I am
forever indebted to the skills of the programmers, your skills make me
look clever!

I am trying to have the pop-up do something (upload an image in this
case) then when the image loads, pass the file name to a text box in
the form on the parent window. With the onload command I have been
able to make the window close automatically. My problem is passing the
data to the parent. I can do it if I make the child a seperate poop-up
window, but from modal, I get no - where. A huge amount of Googling
only led me to one related article which basically stated it was hard
to do, then gave some general ideas on how to do it.

Sadly, js is double dutch to me - I can php with the best of them,
html like a pro - css pretty darn well, but js? Not happening. I am
still studying, and trying to change this,

I do not expect you to do my work for me. Can you give me any clues
though? Maybe you know a working example I can peek at, maybe you know
a tutorial that will assist my plight?

Thank you so much for this wonderful code, and in advance for any
assistance you are able to give me.


Kindest regards,
John Smart





[jQuery] Re: :eq vs :nth?

2007-08-03 Thread Karl Swedberg

They're the same, so you can use whichever you prefer.

From jquery.js:

nth: m[3]-0==i,
eq: m[3]-0==i,



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:

I've searched the groups but I can't seem to find any related talk  
on this.


What, if any, is the difference between using :eq(n) and :nth(n)?

I'd like to know before I start standardizing on one or the other.

Thanks,
Matt Penner




[jQuery] Re: :eq vs :nth?

2007-08-03 Thread John Resig

Probably not since :le(3) is the same thing as :lt(4).

--John

On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 meantime, is there any possibility to add le() and ge() (for lesser than or
 equal to and greater than or equal to).
 I am under the assumption it is not already there.

 -GTG


 On 8/3/07, John Resig [EMAIL PROTECTED] wrote:
 
  Huh... I should probably nuke :nth().
 
  --John
 
  On 8/3/07, Karl Swedberg [EMAIL PROTECTED] wrote:
   They're the same, so you can use whichever you prefer.
  
   From jquery.js:
  
nth: m[3]-0==i,
eq: m[3]-0==i,
  
  
  
   --Karl
   _
   Karl Swedberg
   www.englishrules.com
   www.learningjquery.com
  
  
  
  
  
   On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
   I've searched the groups but I can't seem to find any related talk on
 this.
  
   What, if any, is the difference between using :eq(n) and :nth(n)?
  
   I'd like to know before I start standardizing on one or the other.
  
   Thanks,
   Matt Penner
  
  
 




[jQuery] :eq vs :nth?

2007-08-03 Thread Matt Penner
Ah, thanks for that.  I'll check the code next time.
Matt

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Friday, August 03, 2007 2:18 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: :eq vs :nth?

They're the same, so you can use whichever you prefer.

From jquery.js:

nth: m[3]-0==i,
eq: m[3]-0==i,




--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:


I've searched the groups but I can't seem to find any related talk on this.

What, if any, is the difference between using :eq(n) and :nth(n)?

I'd like to know before I start standardizing on one or the other.

Thanks,
Matt Penner


[jQuery] Re: :eq vs :nth?

2007-08-03 Thread Ganeshji Marwaha
cool, i will keep an eye on that

-GTG

On 8/3/07, John Resig [EMAIL PROTECTED] wrote:


 Well, it  should be noted that we're remove .lt() .gt() and .eq() in
 favor of a new .slice() method, which will be able to produce
 identical results (and even better).

 --John

 On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
  i agree, but i saw hasClass() in the roadMap for 1.2.
  So, i thought you were adding some convenience methods. So thought i
 would
  give my .02 coz, this sometimes had a tendency to increase my code and
  decrease legibility with a lot of .lt(var + 1) and .gt(var - 1).
 
  I, in particular don't have a problem with this, coz my version of
 jquery
  has these methods ;-).
 
 
  -GTG
 
  On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:
  
   Probably not since :le(3) is the same thing as :lt(4).
  
   --John
  
   On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
meantime, is there any possibility to add le() and ge() (for lesser
 than
  or
equal to and greater than or equal to).
I am under the assumption it is not already there.
   
-GTG
   
   
On 8/3/07, John Resig [EMAIL PROTECTED]  wrote:

 Huh... I should probably nuke :nth().

 --John

 On 8/3/07, Karl Swedberg [EMAIL PROTECTED]  wrote:
  They're the same, so you can use whichever you prefer.
 
  From jquery.js:
 
   nth: m[3]-0==i,
   eq: m[3]-0==i,
 
 
 
  --Karl
  _
  Karl Swedberg
  www.englishrules.com
  www.learningjquery.com
 
 
 
 
 
  On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
  I've searched the groups but I can't seem to find any related
 talk
  on
this.
 
  What, if any, is the difference between using :eq(n) and
 :nth(n)?
 
  I'd like to know before I start standardizing on one or the
 other.
 
  Thanks,
  Matt Penner
 
 

   
   
  
 
 



[jQuery] Best way to select a cell in a table?

2007-08-03 Thread Matt Penner
You're right GTG.

I found this out quickly after my post.  I'm using the following:
$('tr:eq(2) td:eq(3)')
which seems to get exactly the one cell I'm looking for.

Just for sake of argument this is a very simple example.  I use variables in
my code and I have only one table on the page.  If I had multiple tables
this would indeed return multiple elements unless I selected the individual
table as well.  At least this is my understanding.

Matt


From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ganeshji Marwaha
Sent: Friday, August 03, 2007 2:54 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Best way to select a cell in a table?

I don't think ur selector is right for selecting the 2nd row, 3rd column.
It most probably is returning you more elements depending on the number of
rows u have.
Eg: if you have 3 rows in your table, then it should return, 1 tr and 3 td's
each representing the 3rd column in every row.

I would use $(td:eq(2), $(tr:eq(1)))

-GTG
On 8/3/07, Matt Penner [EMAIL PROTECTED]  wrote:
I have a table that represents a matrix with various columns and rows.  I
use AJAX/JSON to populate the various cells with data.  Not every cell will
contain an item of data and some may have more than one item.

What's the best way to select a specific cell of the table?

If I wanted the 2nd row 3rd cell the following works:
$(tr:eq(1), td:eq(2))

This is a rather simplistic example but is this better than, say, giving
every cell its own id or is there a completely different method that others
prefer?

Thanks,
Matt Penner


[jQuery] Re: Best way to select a cell in a table?

2007-08-03 Thread Ganeshji Marwaha
oh ok... i guess, that is a good solution
overall. I would use that. I don't know what other prefer though.
But, i wouldn't give ids to each and every cell in the table just for the
purpose of selection. it increases markup size.

-GTG



On 8/3/07, Matt Penner [EMAIL PROTECTED] wrote:

 You're right GTG.

 I found this out quickly after my post.  I'm using the following:
 $('tr:eq(2) td:eq(3)')
 which seems to get exactly the one cell I'm looking for.

 Just for sake of argument this is a very simple example.  I use variables
 in my code and I have only one table on the page.  If I had multiple tables
 this would indeed return multiple elements unless I selected the individual
 table as well.  At least this is my understanding.

 Matt

 
 From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com ] On
 Behalf Of Ganeshji Marwaha
 Sent: Friday, August 03, 2007 2:54 PM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: Best way to select a cell in a table?

 I don't think ur selector is right for selecting the 2nd row, 3rd column.
 It most probably is returning you more elements depending on the number of
 rows u have.
 Eg: if you have 3 rows in your table, then it should return, 1 tr and 3
 td's each representing the 3rd column in every row.

 I would use $(td:eq(2), $(tr:eq(1)))

 -GTG
 On 8/3/07, Matt Penner [EMAIL PROTECTED]  wrote:
 I have a table that represents a matrix with various columns and rows.  I
 use AJAX/JSON to populate the various cells with data.  Not every cell will
 contain an item of data and some may have more than one item.

 What's the best way to select a specific cell of the table?

 If I wanted the 2nd row 3rd cell the following works:
 $(tr:eq(1), td:eq(2))

 This is a rather simplistic example but is this better than, say, giving
 every cell its own id or is there a completely different method that others
 prefer?

 Thanks,
 Matt Penner




[jQuery] Re: :eq vs :nth?

2007-08-03 Thread Ganeshji Marwaha
quick question... are the :eq() etal... selectors gonna stay? or are they
going to be removed as well.

-GTG

On 8/3/07, John Resig [EMAIL PROTECTED] wrote:


 Well, it  should be noted that we're remove .lt() .gt() and .eq() in
 favor of a new .slice() method, which will be able to produce
 identical results (and even better).

 --John

 On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
  i agree, but i saw hasClass() in the roadMap for 1.2.
  So, i thought you were adding some convenience methods. So thought i
 would
  give my .02 coz, this sometimes had a tendency to increase my code and
  decrease legibility with a lot of .lt(var + 1) and .gt(var - 1).
 
  I, in particular don't have a problem with this, coz my version of
 jquery
  has these methods ;-).
 
 
  -GTG
 
  On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:
  
   Probably not since :le(3) is the same thing as :lt(4).
  
   --John
  
   On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
meantime, is there any possibility to add le() and ge() (for lesser
 than
  or
equal to and greater than or equal to).
I am under the assumption it is not already there.
   
-GTG
   
   
On 8/3/07, John Resig [EMAIL PROTECTED]  wrote:

 Huh... I should probably nuke :nth().

 --John

 On 8/3/07, Karl Swedberg [EMAIL PROTECTED]  wrote:
  They're the same, so you can use whichever you prefer.
 
  From jquery.js:
 
   nth: m[3]-0==i,
   eq: m[3]-0==i,
 
 
 
  --Karl
  _
  Karl Swedberg
  www.englishrules.com
  www.learningjquery.com
 
 
 
 
 
  On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
  I've searched the groups but I can't seem to find any related
 talk
  on
this.
 
  What, if any, is the difference between using :eq(n) and
 :nth(n)?
 
  I'd like to know before I start standardizing on one or the
 other.
 
  Thanks,
  Matt Penner
 
 

   
   
  
 
 



[jQuery] Re: BlockUI fade out - Possible to disable for some instances?

2007-08-03 Thread Mike Alsup

Ok, it's fixed now!  v1.31 is what you want.

http://jqueryjs.googlecode.com/svn/trunk/plugins/blockUI/jquery.blockUI.js

Mike


On 8/3/07, Mike Alsup [EMAIL PROTECTED] wrote:
 Maggi,

 I just realized that I don't have this implemented correctly.  I'll
 post an updated version when I have it fixed (probably tonight).

 Mike


 On 8/2/07, Maggi [EMAIL PROTECTED] wrote:
 
  Great, thanks alot Mike!
 
  On Aug 2, 9:01 pm, Mike Alsup [EMAIL PROTECTED] wrote:
   Hi Magnus,
  
   You can disable the fade effect when you call the blocking function
   using the fadeOut option.  For example:
  
   $.blockUI( Please wait, null, { fadeOut: 0 } );
  
   You can also change the time it takes to fade via the fadeTime option.
  
   Cheers!
  
   Mike
  
   On 8/2/07, Maggi [EMAIL PROTECTED] wrote:
  
  
  
Hi everyone!
  
I was wondering, and this question is mainly pointed to Mike, if I
could disable the fade-out on the BlockUI within the BlockUI
function?  I am using it to display a confirmation box, and if it is
selected it displays another box, loads something with Ajax and then
displays a Hurray box if successful.  When the fade out is used the
old boxes can sometimes be shown in the background with the overlay.
  
Kind regards,
Magnus
 
 



[jQuery] Re: :eq vs :nth?

2007-08-03 Thread Josh Nathanson
 quick question... are the :eq() etal... selectors gonna stay? or are they 
 going to be removed as well.

They would have to be left in the API for backwards compatibility, correct?  Or 
would they become private methods only?

-- Josh


  - Original Message - 
  From: Ganeshji Marwaha 
  To: jquery-en@googlegroups.com 
  Sent: Friday, August 03, 2007 3:16 PM
  Subject: [jQuery] Re: :eq vs :nth?


  quick question... are the :eq() etal... selectors gonna stay? or are they 
going to be removed as well.

  -GTG


  On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:

Well, it  should be noted that we're remove .lt() .gt() and .eq() in
favor of a new .slice() method, which will be able to produce
identical results (and even better).

--John

On 8/3/07, Ganeshji Marwaha  [EMAIL PROTECTED] wrote:
 i agree, but i saw hasClass() in the roadMap for 1.2.
 So, i thought you were adding some convenience methods. So thought i would
 give my .02 coz, this sometimes had a tendency to increase my code and
 decrease legibility with a lot of .lt(var + 1) and .gt(var - 1).

 I, in particular don't have a problem with this, coz my version of jquery 
 has these methods ;-).


 -GTG

 On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:
 
  Probably not since :le(3) is the same thing as :lt(4). 
 
  --John
 
  On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
   meantime, is there any possibility to add le() and ge() (for lesser 
than 
 or
   equal to and greater than or equal to).
   I am under the assumption it is not already there.
  
   -GTG
  
  
   On 8/3/07, John Resig  [EMAIL PROTECTED]  wrote:
   
Huh... I should probably nuke :nth().
   
--John

On 8/3/07, Karl Swedberg [EMAIL PROTECTED]  wrote:
 They're the same, so you can use whichever you prefer.
 
 From jquery.js:

  nth: m[3]-0==i,
  eq: m[3]-0==i,

 

 --Karl
 _
 Karl Swedberg
 www.englishrules.com 
 www.learningjquery.com




 
 On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
 I've searched the groups but I can't seem to find any related talk
 on
   this.
 
 What, if any, is the difference between using :eq(n) and :nth(n)?

 I'd like to know before I start standardizing on one or the 
other. 

 Thanks,
 Matt Penner


   
  
  
 






[jQuery] Re: :eq vs :nth?

2007-08-03 Thread John Resig

Selectors are staying, the methods are going.

--John

On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 quick question... are the :eq() etal... selectors gonna stay? or are they
 going to be removed as well.


 -GTG

 On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:
 
  Well, it  should be noted that we're remove .lt() .gt() and .eq() in
  favor of a new .slice() method, which will be able to produce
  identical results (and even better).
 
  --John
 
  On 8/3/07, Ganeshji Marwaha  [EMAIL PROTECTED] wrote:
   i agree, but i saw hasClass() in the roadMap for 1.2.
   So, i thought you were adding some convenience methods. So thought i
 would
   give my .02 coz, this sometimes had a tendency to increase my code and
   decrease legibility with a lot of .lt(var + 1) and .gt(var - 1).
  
   I, in particular don't have a problem with this, coz my version of
 jquery
   has these methods ;-).
  
  
   -GTG
  
   On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:
   
Probably not since :le(3) is the same thing as :lt(4).
   
--John
   
On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 meantime, is there any possibility to add le() and ge() (for lesser
 than
   or
 equal to and greater than or equal to).
 I am under the assumption it is not already there.

 -GTG


 On 8/3/07, John Resig  [EMAIL PROTECTED]  wrote:
 
  Huh... I should probably nuke :nth().
 
  --John
 
  On 8/3/07, Karl Swedberg [EMAIL PROTECTED]  wrote:
   They're the same, so you can use whichever you prefer.
  
   From jquery.js:
  
nth: m[3]-0==i,
eq: m[3]-0==i,
  
  
  
   --Karl
   _
   Karl Swedberg
   www.englishrules.com
   www.learningjquery.com
  
  
  
  
  
   On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
   I've searched the groups but I can't seem to find any related
 talk
   on
 this.
  
   What, if any, is the difference between using :eq(n) and
 :nth(n)?
  
   I'd like to know before I start standardizing on one or the
 other.
  
   Thanks,
   Matt Penner
  
  
 


   
  
  
 




[jQuery] Re: :eq vs :nth?

2007-08-03 Thread Ganeshji Marwaha
thanks.

-GTG

On 8/3/07, John Resig [EMAIL PROTECTED] wrote:


 Selectors are staying, the methods are going.

 --John

 On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
  quick question... are the :eq() etal... selectors gonna stay? or are
 they
  going to be removed as well.
 
 
  -GTG
 
  On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:
  
   Well, it  should be noted that we're remove .lt() .gt() and .eq() in
   favor of a new .slice() method, which will be able to produce
   identical results (and even better).
  
   --John
  
   On 8/3/07, Ganeshji Marwaha  [EMAIL PROTECTED] wrote:
i agree, but i saw hasClass() in the roadMap for 1.2.
So, i thought you were adding some convenience methods. So thought i
  would
give my .02 coz, this sometimes had a tendency to increase my code
 and
decrease legibility with a lot of .lt(var + 1) and .gt(var - 1).
   
I, in particular don't have a problem with this, coz my version of
  jquery
has these methods ;-).
   
   
-GTG
   
On 8/3/07, John Resig  [EMAIL PROTECTED] wrote:

 Probably not since :le(3) is the same thing as :lt(4).

 --John

 On 8/3/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
  meantime, is there any possibility to add le() and ge() (for
 lesser
  than
or
  equal to and greater than or equal to).
  I am under the assumption it is not already there.
 
  -GTG
 
 
  On 8/3/07, John Resig  [EMAIL PROTECTED]  wrote:
  
   Huh... I should probably nuke :nth().
  
   --John
  
   On 8/3/07, Karl Swedberg [EMAIL PROTECTED]  wrote:
They're the same, so you can use whichever you prefer.
   
From jquery.js:
   
 nth: m[3]-0==i,
 eq: m[3]-0==i,
   
   
   
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com
   
   
   
   
   
On Aug 3, 2007, at 4:51 PM, Matt Penner wrote:
I've searched the groups but I can't seem to find any
 related
  talk
on
  this.
   
What, if any, is the difference between using :eq(n) and
  :nth(n)?
   
I'd like to know before I start standardizing on one or the
  other.
   
Thanks,
Matt Penner
   
   
  
 
 

   
   
  
 
 



[jQuery] Re: jQuery slowdowns on consecutive calls

2007-08-03 Thread Ganeshji Marwaha
In your attachBehavior method, u r attaching the click event every time.
This means that during each run, the same handler is run multiple times.
That is what is causing ur problem. Attach the click() event only once, and
u should see consistent results.

-GTG

On 8/2/07, offwhite [EMAIL PROTECTED] wrote:


 http://brennan.offwhite.net/fasterjquery/

 I put together a test to see how well jQuery would perform if I
 carefully chained multiple functions together or use the each
 function or completely break them up into separate calls. I was able
 to show the chaining is the fastest while the each function still
 performed alright.

 What I discovered was that when the functions are run again they take
 longer. And it adds up each time. I would like to know if there is
 something I should do or if there is something in jQuery that is
 causing this behavior.

 You can see the sample here...

 http://brennan.offwhite.net/fasterjquery/




[jQuery] animate navigation effect

2007-08-03 Thread adrianmak

Is it possible to make the animate navigation by jquery like below
site

http://www.cyberexpert.com.hk



[jQuery] can jquery handle onclick with mouseover

2007-08-03 Thread Frank

Can jquery handle mouseover, mouseout and onclick in one function.  I
need a mouseover to change the image.  I need to keep the image if the
image is clicked, and not, if the image is not clicked.  I need to
clear the function if another image is clicked.

I have tried this code structure but no success.  Any help would be
appreicated.

$(function() {
$(#fast).click(function(){linkOver('fast');view(hid1);
}).mouseover(function(){linkOver('fast')}).mouseout(function(){
if($(this)==click){
  linkOver('fast');
}else{
  linkOut('fast');
});
});

Frank



  1   2   >