[jQuery] Re: contents().height() in FF

2008-02-04 Thread Ariel Flesler

Hi Sebioff, I already reported it here: http://dev.jquery.com/ticket/2273

As for 'axis', the default is 'y', but in the demo
$.scrollTo.defaults.axis is set to 'xy'. That line is commented and I
expected it to be seen. I can add a message though, saying 'in this
case, axis is defaults to xy', will do it soon.
Using { top: ... } like that will work, as long as you don't set axis
to xy. I was just saying you can write it shorter.

Cheers
Ariel Flesler

On 2 feb, 19:28, Sebioff [EMAIL PROTECTED] wrote:
 @Olaf: Thanks, I'm doing it exactly like that now :)

 @Ariel:
 Well, what I do (not in this example, though) is using your scrollTo-
 Plugin in combination with the Mousehold-Plugin.
 As long as the link is clicked, the content of the div should be
 scrolled down.
 The scrolling looks a bit strange with a duration there because of the
 slow up/down of the scrolling animation...well, I didn't really check
 whether this slowing up/down can be disabled, since I got the effect I
 wanted anyway :)

 I guess I got the {top:'+=10px'} from the Relative position (hash)-
 example.
 I don't quite understand how axis:'y' can be the default...on the
 example page $(...).scrollTo( '+=100px', 800 ); scrolls both the x and
 the y axis?

 Now, what about the contents().height()-behaviour?
 Should it be reported as bug?

 On 2 Feb., 04:51, Ariel Flesler [EMAIL PROTECTED] wrote:



  Also... :)
  I checked the example, when using scrollTo.. if you don't specify
  duration, it scroll instantly (if that's what you want, then that's
  ok)
  Also, instead of {top:'+=10px'}, it is meant to be used as:
    $().scrollTo( '+=10px', duration, {axis:'y'})
  Now.. axis:'y' is the default, so you don't need to specify it. so:
    $().scrollTo( '+=10px', duration )//or no duration
  Will be enough.

  Cheers
  Ariel Flesler

  On 31 ene, 19:34,Sebioff[EMAIL PROTECTED] wrote:

   Uh, allright, I'm sorry...I guess I found a solution.
   The trick is to wrap the content in a span, and then retrieve the
   spans height.
   But still, I guess if contents().height() (which sounds so logical to
   retrieve the contents height, don't you think) works in Internet
   Explorer it should work in Firefox as well (or it shouldn't give any
   nasty exceptions, at least)...

   If someone got an even easier way than the span-wrapping I'd be glad
   to hear about!

   On 31 Jan., 22:14,Sebioff[EMAIL PROTECTED] wrote:

Hi,
i've got a div with overflow:auto.
I want to check whether the content of the div is higher than the div
itself (in order to know whether I need to show a scrolldown link
or not).

In Internet Explorer with jQuery 1.2.2. I can get the contents height
without any problem with:
$(#div).contents().height()

(I don't know if this is the best way to do it, but it's the only one
I found...)
The problem is, in Firefox it doesn't work and all I get is the
following error message:

Fehler: [Exception... Could not convert JavaScript argument
nsresult: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)  location: JS
frame ::http://www.rakuun.de/Stuff/Schasler/jquery-1.2.2.js::
anonymous :: line 853  data: no]
Quelldatei:http://www.rakuun.de/Stuff/Schasler/jquery-1.2.2.js
Zeile: 853

You can try it out yourself 
here:http://www.rakuun.de/Stuff/Schasler/content_height_test.html

Any idea how to fix this or how to get the contents height in a way
that works in both browsers?- Ocultar texto de la cita -

   - Mostrar texto de la cita -- Zitierten Text ausblenden -

  - Zitierten Text anzeigen -- Ocultar texto de la cita -

 - Mostrar texto de la cita -


[jQuery] Re: getting the ID number of a cloned table row

2008-02-04 Thread andrea varnier

On 4 Feb, 12:51, Bruce MacKay [EMAIL PROTECTED] wrote:
 The function I'm using is as follows.  Two questions:
 1. I get an error at the alert - intCurrentRowID is not
 defined.  What is my error here?

ParseInt() returns an integer if the number is at the beginning of the
string, and undefined otherwise.
You should use substr(-1,1) to get the last character of a string.


[jQuery] jCarousel - How do I hide the list before display

2008-02-04 Thread caroig

Hi,
Is there a way of hiding the list before the carousel is fully
generated.  I often get to see the list of images before the carousel
effect is produced.  I've tried setting display to none in my css and
then  executing jQuery .show after the carousel, but seems doesn't
work well.

many thanks


[jQuery] Viewport selectors

2008-02-04 Thread Mika Tuupola


http://www.appelsiini.net/projects/viewport

I recently needed to locate images inside and outside of viewport. So  
I extracted selectors I had in Lazy Load and added some new ones.  
Result is viewport selectors plugin. Gives you new jQuery selectors  
such as:


$(:in-viewport)
$(:below-the-fold)
$(:above-the-top)
$(:left-of-screen)
$(:right-of-screen)

They are not the fastest ones so if you have gazillion of images /  
elements to check it will weel sluggish. I tested with main browsers  
but any feedback, especially bug reports are welcome. Demo here:


http://www.appelsiini.net/projects/viewport/3x2.html

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



[jQuery] Re: work with what this.id gave me

2008-02-04 Thread marcus

that looks much better. thank you.

andrea varnier schrieb:
 On 3 Feb, 23:12, marcus [EMAIL PROTECTED] wrote:
  because i think this is somehow ugly i just wanted to know if there is
  maybe a better way to do this.

 you can put the object directly in the variable

 var chosen = $(this);

 and then

 chosen.empty();

 I prefer to put a dollar in the variable name, just to remind me how I
 got that object, like this
 var $chosen = $(this);
 $chosen.empty();


[jQuery] Detecting ctrl+click on an element

2008-02-04 Thread Giovanni Battista Lenoci


The subject says it all...

How I can detect a crtl+click on an element?

Thank you.

--
gianiaz.net - Giovanni Battista Lenoci 
P.le Bertacchi 66 
23100 Sondrio (SO) - Italy




[jQuery] Re: Cycle CountUp

2008-02-04 Thread Michael Price


caruso_g wrote:

Is it possible to set a time countdown but making it global, i.e. that
any visitor will see the remaining time?
Something like a countdown to a special offer, and so on.


I guess you could synchronise your countdown's start variable with the 
server side clock - say an offer starts at 4pm and it's 3pm now, your 
server-side code feeds a variable to your JS saying there's an hour to 
go and you take it from there?


Regards,
Michael Price



[jQuery] Re: How to bind to a dynamically created object

2008-02-04 Thread wyo

On Feb 3, 5:39 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
 Ugh ... large tables always needs lots of optimizations. First ...
 you'll want to minimize the number of .append()s. Concat all your HTML
 into an array and then append. Something like this:

 var html = [];
 ...

Thanks.

 cause issues of their own. Here is a new plugin that handles event
 delegation rather 
 elegantly:http://dev.jquery.com/browser/trunk/plugins/delegate/jquery.delegate.js

 You'd need to use it like this:

 $('#eintragsliste')
 .delegate('click', '.expanding', collapser_expand_all)
 .delegate('click', '.collapsing', collapser_collapse_all);

Well I've 2 issues, one is collapsing/expanding all entries at once
(as shown above), the second is collapsing/expanding each single entry
separately. Therefore I need to bind to each image in each entry
itself.

 'trtdtable id='+i+'tbody' +
 '  tr' +
 'tdimg class=expanding src=images/plus01.png/th' +
 'td.../td' +
 '  /trtr class=expanded' +
 'tdnbsp;/td' +
 'td.../td' +
 '  /tr' +
 '/tbody/table/td/tr');
 $('#eintragsliste')
 .delegate('click', '.expanding', '#'+i, collapser_expand(i))
 .delegate('click', '.collapsing', '#'+i, collapser_collapse(i));

IMO it would be best if I were able to access jquery functions
generally  in normal HTML through the onclick clause. This would
allow me to build a collapser plugin which could collapse/expand not
only tables but anything (e.g. forms, etc). All the user has to define
which collapse/expand class belongs to which collaping/expanding
event. Theres no need to have the collapsing/expanding object within
the collapsed/expanded object as long as they are linked somehow
through their id. So all what's needed is something like

  onclick=$(...).collapser_collapse (i)

where i is the id of the object containing all collapsing objects
(marked with class=expanded). Unfortunately I haven't been able to
figure that out so far so I tried it with bind/live query/etc. Besides
the onclick probably is faster at least with large tables.

O. Wyss


[jQuery] Re: [validate] validating dynamically created fields

2008-02-04 Thread Steffan A. Cline

on 2/2/08 3:33 PM, Steffan A. Cline at [EMAIL PROTECTED] wrote:

 
 on 2/1/08 1:49 PM, Jörn Zaefferer at [EMAIL PROTECTED] wrote:
 
 
 Steffan A. Cline schrieb:
 on 2/1/08 1:10 PM, Jörn Zaefferer at [EMAIL PROTECTED] wrote:
 
   
 Steffan A. Cline schrieb:
 
 I have a form in multiple sections. The validation declarations are in the
 head as the demos show. Problem is that I have a section where there are
 multiple groups of dynamically created file inputs. The IDs vary and the
 types of files for each group will vary. An Id may be like this
 id=cv_fi_1_2. They are coded this way so that on the server side I can
 handle the file types appropriately. Is there a trick where I could define
 each group with it's own class or something and then tell the validator to
 handle file inputs with a certain class attribute? Or to tell it to look
 for
 a specific div ID containing the file inputs and validate them accordingly
 to the group? Here is an example
 
 All of these are in the same form and are generated server side number
 will
 vary.
   
   
 Is having the rules in the head a requirement? If not, it would be easy
 to just add them as classes/attributes, an example is here:
 http://jquery.bassistance.de/validate/demo/dynamic-totals.html
 
 Though even then I'm not exactly sure if it would work, considering that
 all have the same name, which is currently not supported by the
 validation plugin.
 
 Jörn
 
 The names could all be made dynamic as well. Since they are file inputs,
 they are uniquely handled server side. I'll look at the examples and see how
 it works out.
   
 Okay, great. Let me know if the issue remains.
 
 Jörn
 Ok, question. On that demo link you gave me I see you have class=quantity
 required and class=required. Where is it that you are defining what the
 rules are for that class? For example, I pointed out that I needed
 validation for individual elements. One file input is PDF only while another
 is .mpg|.mov|.fla and the other is .jpg|.gif. This is interesting though.
 I'm curious to see how you suggest doing it.
 
 
 Thanks
 
 Steffan
 

Jörn,

Would it be something like this in the head?

jQuery.validator.addClassRules({
brochure: { accept: pdf },
movie: { accept: mov|mpg|mpeg|fla|mp4 },
photo: { accept: jpg|gif }
});


Then in the body?

input type=file name=somethingdynamic class=photo /
input type=file name=somethingdynamic class=movie /
input type=file name=somethingdynamic class=brochure /


Thanks

Steffan

---
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline  
[EMAIL PROTECTED] Phoenix, Az
http://www.ExecuChoice.net  USA
AIM : SteffanC  ICQ : 57234309
YAHOO : Steffan_Cline   MSN : [EMAIL PROTECTED]
GOOGLE: Steffan.Cline Lasso Partner Alliance Member
---





[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread andrea varnier

On 4 Feb, 14:38, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote:
 The subject says it all...

 How I can detect a crtl+click on an element?

try this, supposing #target is yout target

var clickFn = function(){
alert(ctrl + click);
$(this).unbind('click', clickFn);
}

$(document)
.keydown(function(event){
if (event.keyCode == 17){
$(#target).click(clickFn);
}
})
.keyup(function(event){
if (event.keyCode == 17){
$(#target).unbind('click', clickFn);
}
});


[jQuery] Re: Cycle CountUp

2008-02-04 Thread caruso_g

Is it possible to set a time countdown but making it global, i.e. that
any visitor will see the remaining time?
Something like a countdown to a special offer, and so on.

On Feb 3, 8:35 pm, Ken Gregg [EMAIL PROTECTED] wrote:
 Cool. I need to put a time display on an intranet page. This answers
 that also.

 On Feb 2, 5:12 pm, Glen Lipka [EMAIL PROTECTED] wrote:

  Interesting tidbit:
  I as looking at the questions on Experts-Exchange for 
  JavaScript.http://www.experts-exchange.com/Programming/Languages/Scripting/JavaS...

  *My discovery:* A big portion of the questions are easy to answer if you use
  jQuery.

  One of them turned into a neat demo I whipped 
  up:http://commadot.com/jquery/cyleNumber.php

  I never thought of using the Cycle plugin for a count-down or count-up, but
  there it is. :)  I think it makes a nice effect.

  Have a great day.

  Glen


[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread Giovanni Battista Lenoci


andrea varnier ha scritto:

try this, supposing #target is yout target

var clickFn = function(){
alert(ctrl + click);
$(this).unbind('click', clickFn);
}

$(document)
.keydown(function(event){
if (event.keyCode == 17){
$(#target).click(clickFn);
}
})
.keyup(function(event){
if (event.keyCode == 17){
$(#target).unbind('click', clickFn);
}
});

  

Thank you very much!



--
gianiaz.net - Giovanni Battista Lenoci 
P.le Bertacchi 66 
23100 Sondrio (SO) - Italy




[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread Giovanni Battista Lenoci


andrea varnier ha scritto:

try this, supposing #target is yout target

var clickFn = function(){
alert(ctrl + click);
$(this).unbind('click', clickFn);
}

$(document)
.keydown(function(event){
if (event.keyCode == 17){
$(#target).click(clickFn);
}
})
.keyup(function(event){
if (event.keyCode == 17){
$(#target).unbind('click', clickFn);
}
});

  

I was making some test, and I have little problem..

If I bind a function to an element with jquery style method:

$('#target').bind('click', function() { dosomething(this); ) });

in my dosomething function I can retrieve the element clicked.

With your syntax I can bind/unbind function but I can't call dosomething 
with this parameter.


Sorry, I'm using jquery for awhile, but in javascript I'm very newbie...

Thank you..


--
gianiaz.net - Giovanni Battista Lenoci 
P.le Bertacchi 66 
23100 Sondrio (SO) - Italy




[jQuery] set focus on change

2008-02-04 Thread Matt Williams

I want to run a validation function after a user enters data. If the
validation fails, I want do an alert telling them so and set the focus
back to that field. But even at the most basic level, I can't get the
focus to stay / go back to the field that was changed. Interesting
that it does seem to work in IE 7, but not FF.

$(document).ready(function(){
  $('#testField').change(function() { alert('wrong value');
this.focus(); });
});

Any ideas here? Or suggestions on how to reset focus back to the field
that changed?

Thanks,

Matt


[jQuery] Problems with $(document).height() and jQuery 1.2.2

2008-02-04 Thread rich

On most of my projects I have some js to push the footer to the bottom
on pages with little/no content (compares document height and viewport
height).  When I upgraded to jQuery 1.2.2 it stopped working. It seems
like I'm getting unexpected results from $(document).height().  Am I
missing something (newer syntax perhaps?), or is this a bug of some
sort?

Testing on the same page:
jQuery 1.2.1 (packed) -- This is how it should be:
IE (v6.0.2900.2180.xpsp_sp2_gdr.070227-2254)
$(document).height(): 423
$(window).height(): 613

Firefox (2.0.0.11)
$(document).height(): 405
$(window).height(): 609

jQuery 1.2.2 (packed):
IE
$(document).height(): 617
$(window).height(): 613

Firefox
$(document).height(): 609
$(window).height(): 609

Thanks guys,
-rich


[jQuery] Re: Cycle CountUp

2008-02-04 Thread Mike Alsup
Cool, Glen!  Thought maybe I had a bug though, since the transitions are
definitely not 3000ms apart.  But I see in the page source that your timeout
is 1000.  :-)

Mike


On Feb 2, 2008 8:12 PM, Glen Lipka [EMAIL PROTECTED] wrote:

 Interesting tidbit:
 I as looking at the questions on Experts-Exchange for JavaScript.

 http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/

 *My discovery:* A big portion of the questions are easy to answer if you
 use jQuery.

 One of them turned into a neat demo I whipped up:
 http://commadot.com/jquery/cyleNumber.php

 I never thought of using the Cycle plugin for a count-down or count-up,
 but there it is. :)  I think it makes a nice effect.

 Have a great day.

 Glen



[jQuery] ajaxSubmit and NiceJForms plugins

2008-02-04 Thread zorba

Hello.

The NiceJForms plugin is called like following:

 $.NiceJForms.build();

I build a form dinamically so that I have to call again NiceJForms to
apply it to the new elements.

Here is the problem, if I do:

var options = {
//some stuff
success: function() {
$.NiceJForms.build();
}
};
$('myform').submit(function() {
$(this).ajaxSubmit(options);
return false;
});

then NiceJForms is built twice, so that all elts appear twice.

How could I un-build and then build again NIceJform, or call it only
on the new elts?

Any idea is welcome.Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
jQuery (English) group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: jCarousel - How do I hide the list before display

2008-02-04 Thread rich

I had this problem once before. I ended setting a fixed height on the
parent div and setting overflow:hidden.

-rich

On Feb 4, 8:03 am, caroig [EMAIL PROTECTED] wrote:
 Hi,
 Is there a way of hiding the list before the carousel is fully
 generated.  I often get to see the list of images before the carousel
 effect is produced.  I've tried setting display to none in my css and
 then  executing jQuery .show after the carousel, but seems doesn't
 work well.

 many thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
jQuery (English) group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread andrea varnier

On 4 Feb, 17:20, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 Another way would be to use the ctrlKey property of the Click event:

 $('#element').click(function(e)
 {
 if (e.ctrlKey)
 {
 do_something();
 }
 });

 jQuery also normalizes this into the metaKey attribute which detects the CMD
 key on a Mac:

 $('#element').click(function(e)
 {
 if (e.metaKey)
 {
 do_something();
 }
 });

LOL!! much simpler.
thanks, I didn't know that :)


[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread Jeffrey Kretz

Another way would be to use the ctrlKey property of the Click event:

$('#element').click(function(e)
{
if (e.ctrlKey)
{
do_something();
}
});

jQuery also normalizes this into the metaKey attribute which detects the CMD
key on a Mac:

$('#element').click(function(e)
{
if (e.metaKey)
{
do_something();
}
});
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of andrea varnier
Sent: Monday, February 04, 2008 6:35 AM
To: jQuery (English)
Subject: [jQuery] Re: Detecting ctrl+click on an element


On 4 Feb, 14:38, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote:
 The subject says it all...

 How I can detect a crtl+click on an element?

try this, supposing #target is yout target

var clickFn = function(){
alert(ctrl + click);
$(this).unbind('click', clickFn);
}

$(document)
.keydown(function(event){
if (event.keyCode == 17){
$(#target).click(clickFn);
}
})
.keyup(function(event){
if (event.keyCode == 17){
$(#target).unbind('click', clickFn);
}
});



[jQuery] Help populating an array via JSON

2008-02-04 Thread Mike Miller

Hi,

I have a javascript function as follows:

function StateSuggestions() {

this.states =[];

$j.getJSON(client/ajax/getMedList.php, function(data){
alert(inside getJSON + data.length);

this.states = data;

alert(this.states.length); //Value says 10

for (i = 0; i  data.length; i++) {
alert(test + i);

}
});

alert(this.states.length); // Length here is 0

}

I want to populate the this.states array with data being retrieved by
the getJSON call...however it appears that the value of this.states is
different depending on whether or not you are inside the JSON call or
outside of it...not sure why...

M


[jQuery] Re: [validate] validating dynamically created fields

2008-02-04 Thread Jörn Zaefferer


Steffan A. Cline schrieb:

Would it be something like this in the head?

jQuery.validator.addClassRules({
brochure: { accept: pdf },
movie: { accept: mov|mpg|mpeg|fla|mp4 },
photo: { accept: jpg|gif }
});



Then in the body?

input type=file name=somethingdynamic class=photo /
input type=file name=somethingdynamic class=movie /
input type=file name=somethingdynamic class=brochure /
  
That looks good. Details for addClassRules are here, in case you haven't 
been there yet: 
http://docs.jquery.com/Plugins/Validation/Validator/addClassRules#rules


That is handy for reusing rule combinations, and much easier to setup 
then custom methods.


Your example looks like you're missing a few quotes. The parameter to 
accept should be a string that becomes part of a regular expression: 
http://docs.jquery.com/Plugins/Validation/Methods/accept


Jörn


[jQuery] Re: Author of UI-Tabs Plug-in?

2008-02-04 Thread Klaus Hartl

On Feb 4, 5:35 pm, Lion29 [EMAIL PROTECTED] wrote:
  That doesn't make sense to me. Each tab represents a section in the
  document (which is identified with a fragment identifier). Imagine you
  had in-pagetabs. It wouldn't make any sense if all thesetabswould
  point to a single fragment, e.g. div element.

 Your logic would be correct if we were talking ONLY for page
 seggments But why add ajax option to the tabs then if ajax loads
 the content after...
 So In my opinion having the ajax option it would be nice to have that
 option too... I am sure it will be usefull to others, not only to me

So I'm going to remove the Ajax option again? ;-)

Seriously - the plugin pretty much relies on different sections for
each tab panel - Ajax support has been added later to it. I would have
to rewrite quite a bit if I had to enable such an option and it would
also add more bloat to an already huge script. That said, I'm afraid
it won't happen, especially since such a feature hasn't been requested
a single time so far, so I consider it a rather rare use-case. Yes, it
may be useful, but I cannot include everything in the plugin that is
*potentially* useful.

--Klaus


[jQuery] Re: [Validation] v1.2.1pre - Validating an empty field and

2008-02-04 Thread Jörn Zaefferer


Rus Miller schrieb:

[...]
I moved up to your latest release and the issue of validating an empty
field is still there.

http://monovisiondesign.com/client/jquery/validate-url/form.php
  
Thanks for the testcase! I've missed a small change in the remote 
method, its now fixed: http://dev.jquery.com/changeset/4637


Let me know if that works for you.

Jörn


[jQuery] Re: Validation Plugin - Associate array naming with a single error label

2008-02-04 Thread Jörn Zaefferer


Dave Stewart schrieb:

Jorn,
I've done some work on selectors for groups, and it's actually quite
easy to select a group or sub group for validation, although I don't
know the details of your implementation, so I wont suppose to imply
anything.

As usual I've uploaded some demo code for you to take a look.

www.janepatrick.co.uk/admin/test/associative-select.php

Hopefully this will save you some thinking time!
  

Thanks, I'll take a look once 1.2.1 is out the door (and some other stuff).

Jörn


[jQuery] Re: [validate] Validation Plugin - how to remove a control form validation

2008-02-04 Thread Jörn Zaefferer


Dave Stewart schrieb:

What do you think?
  
That it took me quite some time to actually start thinking. The answer 
is rather easy: Custom method!


Actually implementing that custom method requires a bit boolean 
mangling, therefore I've created an example based on your form: 
http://dev.jquery.com/view/trunk/plugins/validate/demo/login/


Let me know if its okay to release your assets (CSS, images) as part of 
the validation plugin, otherwise I'll remove it before releasing 1.2.1.


Hope this helps.

Jörn


[jQuery] Re: Superfish - CSS questions ?

2008-02-04 Thread Simon

Hi Joel,

Thanks you VERY much for your answer (Much faster than mine, I'm
reading a lot of JS stuff for the moment ;-))

Superfish is really great, I've been looking a lot around, and it's
the best for me!

BUT, I still don't get some few things :-)

You can have a look here = http://ugo.celeonet.fr/testsimon/

And my CSS file is here = http://ugo.celeonet.fr/testsimon/css/nav2.css

By default, I highlight the main tab called item 4, no problem here,
it's easy, but when you try the submenu (item C, item D, etc.) you can
see one of my problems, the drop-down menu don't fade out after the
delay (default setting)...

Do you know what's I'm doing wrong ?

Also, I don't know why, but I would like to put the subnav item (item
C, item D, etc.) in bold (strong) when the drop-down menu is
activated, but then, all the drop-down menu is in bold as well, I've
tried everything, I don't know what I missing, again...

Tons of thanks in advance !!!

Simon


[jQuery] Re: yet another beginner's diary (pls review!)

2008-02-04 Thread [EMAIL PROTECTED]

Wow, you remembered!  Thanks, Rick :))

I think Daniel's point was fair - though I have no intention of
writing a jQuery manual! I'll try to organise it better.

It's good to know you only needed a couple of months to become less
confused about it ... here's hoping!

(sorry if this a double post, can't remember if I sent it before)
Thanks again for your message!
Cherry

On Feb 4, 3:52 pm, Rick Faircloth [EMAIL PROTECTED] wrote:
 Hi, Daniel...

 So that's what's she's done... written about what she knows as a beginner.


 I know.  I started only a couple of months ago with absolutely no Javascript
 experience, so for me, it was especially frustrating.  (And in some ways, 
 still is.)

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
  Rabbit
  Sent: Monday, February 04, 2008 6:56 AM
  To: jQuery (English)
  Subject: [jQuery] Re: yet another beginner's diary (pls review!)

  Reads like a confused monologue.

  On Feb 3, 8:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
  wrote:

  http://cherry.austin.googlepages.com/home



[jQuery] Re: How to prevent user from clicking links or buttons while submitting

2008-02-04 Thread brooke

Thanks all for your suggestions.  I am going to try them this morning
and will let you know how it goes!

On Feb 2, 6:42 pm, pedalpete [EMAIL PROTECTED] wrote:
 Hey klaus,

 I tried as you directed and placed it within the jquery form plugin,
 but it doesn't seem to be working, I am able to click the submit
 button multiple times.

 Any idea as to why this would not work with the plugin?
 [code]
  $('#addForm').submit(function() {
 // inside event callbacks 'this' is the DOM element so we
 first
 // wrap it in a jQuery object and then invoke ajaxSubmit
 $(this).ajaxSubmit(options);
 $(this).bind('submit', function(){return false; });

 // !!! Important !!!
 // always return false to prevent standard browser submit and
 page navigation
 return false;
 });
 [/code]

 On Jan 31, 12:06 pm, Klaus Hartl [EMAIL PROTECTED] wrote:

  First of all you should keep in mind that a user can always submit a
  form by hitting enter. Thus disabling the buttons only is more or less
  useless. You should just alter the forms submit event, this is where
  it all happens. That even works if you manually submit forms via
  links.

  Here's what I'd try - disable the form submit after the first submit
  took place:

  $('form').one('submit', function( ) {
  $(this).bind('submit', function() { return false; });

  });

  --Klaus

  On Jan 31, 4:33 pm, brooke [EMAIL PROTECTED] wrote:

   Here is the situation.  We have a form that has links and when the
   user clicks on them it will submit the form.  The problem is that
   sometimes the users were doubleclicking or clicking on different links
   while the form was submitting.  I am completely new to jQuery but one
   of the programmers implemented the solution below.  What it is doing
   is binding a function that clears the onClick event when the link is
   clicked.  It works great in firefox but it is causing IE to lock up.
   I was thinking that somehow the timing is off and it is clearing the
   current anchors onClick before it can process the whole thing..
   (maybe??)  Below is the code.. any suggestions??

   sak10625_disabler = function(){

  $(a, [EMAIL PROTECTED], [EMAIL PROTECTED]).attr(onClick,
   );

   }

   $(document).ready(function(){
   $(a).filter(function(){regexp=/submit\(\)/; return regexp.test($
   (this).attr(onclick));}).bind(click, sak10625_disabler);
  $([EMAIL PROTECTED], [EMAIL PROTECTED]).bind(click,
   sak10625_disabler);

   });


[jQuery] Re: [Validation] v1.2.1pre - Validating an empty field and

2008-02-04 Thread Rus Miller

Yep.  You got it.  Thanks for great work!

Is a spinner coming anytime soon?

On Feb 4, 12:50 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Rus Miller schrieb: [...]
  I moved up to your latest release and the issue of validating an empty
  field is still there.

 http://monovisiondesign.com/client/jquery/validate-url/form.php

 Thanks for the testcase! I've missed a small change in the remote
 method, its now fixed:http://dev.jquery.com/changeset/4637

 Let me know if that works for you.

 Jörn


[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread andrea varnier

On 4 Feb, 16:15, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote:
 I was making some test, and I have little problem..

 If I bind a function to an element with jquery style method:

 $('#target').bind('click', function() { dosomething(this); ) });

 in my dosomething function I can retrieve the element clicked.

 With your syntax I can bind/unbind function but I can't call dosomething
 with this parameter.

look at my code:

var clickFn = function(){
alert(ctrl + click);
$(this).unbind('click', clickFn);
}

you can still get what you need by using $(this) in the function
for example:

var $this = $(this);
dosomething($this);

naming the function is useful if your #target element has other
functions bound to a click event.
in that case doing a simple
$(#target).unbind('click');
would unbind even functions you may want to keep.

 Thank you..

figurati, you're welcome :)


[jQuery] JQuery takes 80% of my core2Duo proc on DOM element inserts

2008-02-04 Thread Ashish

Hi ,

I am very new to jquery. I am using jquery 1.2.2 . I use jquery
tablesorter to insert around 400 rows to a table. The data is
collected using an Ajax call.

When new rows are inserted to the table the CPU utilization shoots up
to 80%. All browsers freeze until the table is populated :(

I tried to insert 400 divs to a single div and faced the same problem.
This rules out a problem with tablesorter.

Does jquery attach a lot of handlers to dom events that make appends
very slow ?

Any suggestions would be much appreciated.

Thanks and regards,
 - Ashish


[jQuery] Re: Viewport selectors

2008-02-04 Thread Karl Swedberg


Great idea, Mika! Thanks for sharing this.


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



On Feb 4, 2008, at 8:13 AM, Mika Tuupola wrote:



http://www.appelsiini.net/projects/viewport

I recently needed to locate images inside and outside of viewport.  
So I extracted selectors I had in Lazy Load and added some new ones.  
Result is viewport selectors plugin. Gives you new jQuery selectors  
such as:


$(:in-viewport)
$(:below-the-fold)
$(:above-the-top)
$(:left-of-screen)
$(:right-of-screen)

They are not the fastest ones so if you have gazillion of images /  
elements to check it will weel sluggish. I tested with main browsers  
but any feedback, especially bug reports are welcome. Demo here:


http://www.appelsiini.net/projects/viewport/3x2.html

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





[jQuery] Re: Author of UI-Tabs Plug-in?

2008-02-04 Thread Lion29

@Klaus:

On Feb 3, 7:42 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 On Feb 2, 2:58 pm, Lion29 [EMAIL PROTECTED] wrote:

  1. Right now thetabsfunction that upon every ajax load the new
  content is ADDED to the DOM (even if the new loaded content is in
  conflict with already loaded - same ids for example)
  It would be nice to have the option to settabsto laod the content
  into the same placeholder... and to empty its content first (so to
  replace it's content and not just add it)..

 That doesn't make sense to me. Each tab represents a section in the
 document (which is identified with a fragment identifier). Imagine you
 had in-pagetabs. It wouldn't make any sense if all thesetabswould
 point to a single fragment, e.g. div element.



Your logic would be correct if we were talking ONLY for page
seggments But why add ajax option to the tabs then if ajax loads
the content after...
So In my opinion having the ajax option it would be nice to have that
option too... I am sure it will be usefull to others, not only to me


[jQuery] IE7 not adjusting width of select box

2008-02-04 Thread Kevin Thorpe

I'm having a spot of bother with select boxes in IE7. I have one select 
box which empties and refills a second when the
selected item changes using an AJAX call. This works fine in Opera and 
FireFox but IE7 doesn't adjust the width of the
second select box to match the new contents. There must be a simple 
workaround for this but for the life of me I can't
find it. I don't really want to fix the size in CSS. My code is below, 
the AJAX page just returns a list of val=text pairs to
populate the select box.

Thanks for any assistance.

  $(document).ready(function(){
$(#brandlist).focus().change(function(){
  $('#matches').empty();
  $.get(brand.map.helper.php,
{ code: $(this).val() },
function(data) {
  var matches = data.split(\n);
  $(#sql).html(matches[0] + br + matches[1]);
  for (var i=2; imatches.length-1; i++) {
var params = matches[i].split(=);
var o = new Option(params[1],params[0]);
$(#matches).append(o);
  }
});
});
});
  });



[jQuery] Re: jQuery Cycle Plugin delay problem

2008-02-04 Thread McEdonskiy

BIG Thanx Mike
I change code:
$(document).ready(function() {
$('#news').cycle({
fx:'scrollLeft',
slideExpr: 'p',
speed: 1000,
delay: 100,
timeout:15000,
pause: 1
});

The timeout option solved problem
The 'hover' fragment was unnecessary. I simple set 'Pause' option to 1


[jQuery] Use jQuery after a jQuery load

2008-02-04 Thread fufolewe

I've a little question maybe someone could give me a hint

My problem is:

i want to build a site with a navigation (with jQuery = no problem)
which loads some content in a main-div-field.
This is absolute no problem with e.g.

load( url, data, callback )

or

$.ajax(
{ type: POST,
 url: some.php,
data: name=Johnlocation=Boston,
success: function(msg){ alert( Data Saved:  + msg ); } });

and so on...

However, so i'm able to load some content in the div-container BUT
within the div field i would like to use jQuery AGAIN! And it doesn't
work :(

For exmple:

Inital start-site - navigation:

script

$(document).ready(function(){

$(a#start).click(function ()

{ load( url, data, callback ..


});

/script


so the content appears in the main div field...
And maybe the content looks like this:

div id=start


script

$(document).ready(function(){

$(a#test).click(function ()


});

/script


a href=# id=testtest/a

/div



so the main problem is: when i load a div field which also contains
jQuery statements - it doesn't work. I also tried, to load the jQuery
statements in the initial site, so it only have to load the new
content but not the jQuery stuff but this also didn't work...

Does anybody know how this could work???


[jQuery] Re: yet another beginner's diary (pls review!)

2008-02-04 Thread Rick Faircloth

I'm still trying to get the hang of the syntax.
I could spend more time doing tutorials, but I've been
able to ask simple questions and get good, timely answers
from the list.  They are a helpful, bunch!

jQuery is in a fast state of growth, with the core constantly
being updated, which is good, but can cause plug-ins to malfunction
with a new core, while other plug-ins won't function unless they
have the new core!  :oP

Also, plug-ins are flying everywhere!

It's a blessing and a curse that there are so many involved
with development for jQuery!  Just grab on tightly and hang on!

It's like a free-for-all!  But I have to say, it's worth it!

Rick



 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
 [EMAIL PROTECTED]
 Sent: Monday, February 04, 2008 2:02 PM
 To: jQuery (English)
 Subject: [jQuery] Re: yet another beginner's diary (pls review!)
 
 
 Wow, you remembered!  Thanks, Rick :))
 
 I think Daniel's point was fair - though I have no intention of
 writing a jQuery manual! I'll try to organise it better.
 
 It's good to know you only needed a couple of months to become less
 confused about it ... here's hoping!
 
 (sorry if this a double post, can't remember if I sent it before)
 Thanks again for your message!
 Cherry
 





[jQuery] ui accordian behaviour mods

2008-02-04 Thread Jay

Good morning all,

The default behavior for the accordion is to close all the open panels
when opening a new one. It would be much nicer to have an option for
this. It would be quite useful to peruse a list with many panels and
have the ability to open some of them and leave them open so you could
see/compare the content between panels of interest and close the
panels with no interesting content. I'd prefer to have a 'toggle'
option to open/close panels as desired.

Has anyone done this already?

Thanks


[jQuery] Validation 1.2 and UI Date Picker issue

2008-02-04 Thread Eridius


I think I found a bug in the validation 1.2 or ui datepicker plug-in.  I also
have the ui datepicker attacked to two of the form elements.  Now when I try
to validation a form and the fields that are calendars are not fielded in,
the calendar popped up for the first calendar element.  Now I am not sure if
this is an issue with the datepicker or the validation plug-in.  I don't
know how the calendar it triggered, i would assume a click event, but i
searched the validation plug-in for a trigger('click') and could not find
one(I could not find and trigger() for that matter).
-- 
View this message in context: 
http://www.nabble.com/Validation-1.2-and-UI-Date-Picker-issue-tp15274047s27240p15274047.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Help populating an array via JSON

2008-02-04 Thread Josh Nathanson


This is because of the asynchronicity...you will only have the correct 
data length within the callback function from the getJSON call.  Any code 
along the same block as the getJSON call will be executed without regard to 
the returned data.


What you can do is abstract the code where you are working with the 
this.states array into a separate function, and then call this abstracted 
function from the getJSON callback.


-- Josh


- Original Message - 
From: Mike Miller [EMAIL PROTECTED]

To: jQuery (English) jquery-en@googlegroups.com
Sent: Monday, February 04, 2008 9:00 AM
Subject: [jQuery] Help populating an array via JSON




Hi,

I have a javascript function as follows:

function StateSuggestions() {

this.states =[];

$j.getJSON(client/ajax/getMedList.php, function(data){
alert(inside getJSON + data.length);

this.states = data;

alert(this.states.length); //Value says 10

for (i = 0; i  data.length; i++) {
alert(test + i);

}
});

alert(this.states.length); // Length here is 0

}

I want to populate the this.states array with data being retrieved by
the getJSON call...however it appears that the value of this.states is
different depending on whether or not you are inside the JSON call or
outside of it...not sure why...

M 




[jQuery] getting the ID number of a cloned table row

2008-02-04 Thread Bruce MacKay

Hello folks,

I'm trying to duplicate a row of an existing table using a function 
adapted from 
http://www.nabble.com/Add-Table-row-to12989886s27240.html#a13300133


My problem is that I cannot identify the identifier of the last row 
(of the original table).


The last row of my table has the form:

tr class=smfont90tdinput name=correctans5 value=1 id=bc5 
type=checkbox/tdtdtextarea rows=3 name=answer5 
id=theans5 style=width: 250px;/textarea/tdtdtextarea 
rows=3 name=feedback5 id=fb5 style=width: 250px;/textarea/td/tr


The function I'm using is as follows.  Two questions:
1. I get an error at the alert - intCurrentRowID is not 
defined.  What is my error here?
2. Is there a more efficient way of writing the 4 lines starting at 
point 2 (I'm trying to re-name the feedback and answer IDs and NAMEs


function duplicateRow(){
// First, lets create the new row using the last one as template...
var clonedRow = $( #myTable tr:last ).clone();
// Take the current identifier, some number in the first 
cell of the row

intCurrentRowId = parseInt( $( #bc:last, clonedRow ).html() );
1.---  alert(intCurrentRowID);
// Set the new ID
intNewRowId = intCurrentRowId + 1;
// Change the current identifier of the row to the new one
$( #bc:last, clonedRow ).html( intNewRowId );
// Change the Id / Name or anything you want for the new attribs
2.---  $( #fb+ intCurrentRowId , clonedRow ).attr( { id : fb + 
intNewRowId} );
$( #bc+ intCurrentRowId , clonedRow ).attr( { id : bc 
+ intNewRowId} );
$( #feedback+ intCurrentRowId , clonedRow ).attr( { name 
: feedback + intNewRowId} );
$( #answer+ intCurrentRowId , clonedRow ).attr( { name : 
answer + intNewRowId} );


// Add to the new row to the original table
$( #myTable).append( clonedRow );
};


Thanks,

Bruce 

[jQuery] Re: Loading GIF Slideshow w/o Modal

2008-02-04 Thread Pickledegg

Thats clever, thanks Ange. So on mouse over the image tags 0207 are
loaded. It looks like I'll have to figure a way of loading various
additional images (ie the next 6 ) when they click again and so on,
and a way to get around loading the same images again when they click
back etc. Food for thought though.

On Feb 2, 9:09 pm, Ange [EMAIL PROTECTED] wrote:
 This method solves the preloading problem with the Cycle 
 plugin.http://www.circleatseven.com/portfolio.php

 $(div#gallerywrapper).one(mouseover, function() {
 $(div#gallery).append(
 'img src=02.jpg alt= /' +
 'img src=03.jpg alt= /' +
 'img src=04.jpg alt= /' +
 'img src=05.jpg alt= /' +
 'img src=06.jpg alt= /' +
 'img src=07.jpg alt= /' );
 $(div#slideswebbc).cycle({
   fx: 'fade',
   speed: 300,
   timeout: 0,
   next: '#next',
   prev: '#prev',
   pause: 1
 });
 });

 On Feb 1, 4:13 am, Pickledegg [EMAIL PROTECTED] wrote:

  Hi Ange

  It looks fantastic, but I take it you're like me, and are searching
  for a databased or 'non-preloaded' version?

  On Jan 31, 6:58 pm, Ange [EMAIL PROTECTED] wrote:

   Here's a link to the page working as I want it to, with the exception
   of the initial pageloadbeing over 
   4MB:http://www.circleatseven.com/test/portfolio.php

   On Jan 31, 12:05 pm, Pickledegg [EMAIL PROTECTED] wrote:

SEAN-O

The above link is what I found too, but you're missing the original
post slightly. He needs something that you can plug into adatabase,
as preloading theimagesis impractical with large files.

Does anyone know of adatabaseready version?

On Jan 31, 4:17 pm, Sean O [EMAIL PROTECTED] wrote:

 Ange,

 It sounds like the SlideViewer plugin might help 
 you:http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/i...

 SEAN O
 _www.sean-o.com

 Ange-6 wrote:

  I'm looking for a jQuery slideshow plugin, and I can't seem to fond
  one that does all I need. Cycle and jCarousel come close. But my
  problem is I have multiple galleries on one page, and they all have
  largeimages. So, since theyloadall theimagesin every gallery and
  then hide them, the page totals over 4000KB.

  I need something like Litebox or Thickbox that calls the next/prev
  image and loads it as needed, with a loading gif. But I don't want a
  pop-up modal. It would be nice if I could just put one image from 
  each
  gallery in the HTML and have the prev/next buttonsloadand fade to
  the prev/next image.

  Any suggestions?

 --
 View this message in 
 context:http://www.nabble.com/Loading-GIF-Slideshow-w-o-Modal-tp15194790s2724...
Ange,
   ent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: work with what this.id gave me

2008-02-04 Thread andrea varnier

On 3 Feb, 23:12, marcus [EMAIL PROTECTED] wrote:
 because i think this is somehow ugly i just wanted to know if there is
 maybe a better way to do this.

you can put the object directly in the variable

var chosen = $(this);

and then

chosen.empty();

I prefer to put a dollar in the variable name, just to remind me how I
got that object, like this
var $chosen = $(this);
$chosen.empty();


[jQuery] Re: IE won't change the 'name' attribute :|

2008-02-04 Thread andrea varnier

fixed.
I was working with a cloned element.
I was doing $(#something).clone().appendTo(#someone);
then selecting the freshly cloned element and modifying it.

I learned that it is way better to work with variables.
now my code looks like
var $cloned = $(#something).clone();

$cloned.find(what I need).attr(name, new_name);
...

$cloned.appendTo(#someone);

this works perfectly.
I know it may sound quite noobish, ma I just wanted to share.
And if you have further suggestions on optimization, they would be
more than welcome :)

thanks a lot to everybody
andrea


[jQuery] Re: Another jdMenu problem... IE specific...

2008-02-04 Thread Aceman3000

Hi Jonathan,

thank you again for the new version. It works nice, but I encountered
a small bug and a missing feature;

Bug (or feature):
You can´t click parent menulinks because in line 100 (in the binding
function) you return false;
I commented out this line, so it works fine for me now.
Maybe this could be an option, but i think users should be able to
click on the parent links!

Missing feature: Vertical Menus via parameters
I had to modify your script to get it working with vertical menus.
Changed line 33 from elementPos: 0 to elementPos: 2;
It would be nice if this is an parameter for jdmenu( {elemPos: x})



On Jan 31, 6:01 pm, Jonathan Sharp [EMAIL PROTECTED] wrote:
 Hi Chris,

 Just wanted to give you a heads up, I've released jdMenu 1.4.0 
 athttp://jdsharp.us/jQuery/plugins/jdMenu/1.4.0(though I haven't posted
 notice of this yet) It's been updated to work with jQuery 1.2.2 and the
 latest dimensions plugin.

 Cheers,
 -Jonathan

 On 1/24/08, Chris Jordan [EMAIL PROTECTED] wrote:



  Sorry, I'm just now getting back to this guys (I was sick yesterday). I
  appreciate all the suggestions. I'll bet it's malformed markup. I don't
  create it though. This is an osCommerce shopping cart. I'll see if I can
  find where the HTML is getting messed up.

  Thanks heaps!
  Chris

  On Jan 21, 2008 7:02 PM, Karl Swedberg [EMAIL PROTECTED] wrote:

   Hi Chris,

   Sorry, I was looking in Firefox. I see now that the problem exists in IE
   only. It might have something to do with the fact that the page is running
   in quirks mode and that the markup is invalid. Try running it through an
   HTML validator ( 
   e.g.http://validator.w3.org/)http://validator.w3.org/%29.
   In particular, you have two extra DOCTYPE declarations throughout the 
   page.
   And if you want to stick with HTML 4.01 transitional, replace this ...

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN

   with this ...

!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
  http://www.w3.org/TR/html4/loose.dtd;

   If cleaning up the HTML doesn't help, we can look at some other stuff.
   In the meantime, I'll poke around the plugin code and the stylesheets a 
   bit
   to see how the positioning is being done.

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

On Jan 21, 2008, at 4:08 PM, Chris Jordan wrote:

   You said it was positioning correctly for you? What version of IE was
   that in? For me, in IE6 it shows up in the top left (0,0) of the view
   port... it's supposed to show just below the top-level menu choice.

   Also, I know there are broken images. Ignore those and look mostly at
   the ones that do have images. I'm still waiting on my graphic artist guy 
   to
   get me the rest of the images. I also don't see anywhere (unless I'm just
   missing it) where the sub-menus are being positioned. You can check out 
   all
   the css if you have the Web Developer extension for FF.

   Thanks again,
   Chris

   On Jan 21, 2008 1:01 PM, Chris Jordan [EMAIL PROTECTED] wrote:

going to lunch. I'd like to exchange emails with you about this. I'll
be back in about an hour or so. Thanks so much Karl.

Chris

On Jan 21, 2008 12:52 PM, Karl Swedberg  [EMAIL PROTECTED]
wrote:

 It looked to me like it was being positioned correctly. Also looks
 like you have a broken link to a rollover image for the top-level nav 
 items.
 I'm guessing that the sub-menus are using position:absolute for their
 positioning, so you'll need to have a parent element given 
 position:relative
 in order for the submenus to be positioned relative to those parent 
 elements
 rather than the body element.

 Hope that helps.

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

  On Jan 21, 2008, at 1:42 PM, Chris Jordan wrote:

 Hi folks.

 I'm having another problem with the jdMenu plug-in. In IE when I
 hover over the top-level menu the sub-menu appears in the absolute 
 top left
 of the view-port! Bah! I don't know what I've done wrong. I've used 
 jdMenu
 at another client of mine, and it works great in both FF and IE. This 
 time
 around however, I *am* customizing the css file quite a bit to better 
 suit
 my needs.

 The problem can be seen herehttp://seidal.com/dev/furniturehotspot/
 .

 This is causing me much aggravation, and more time at this one
 particular client that I should really be spending.

 I would *really* appreciate anyone's help on this problem. Of
 course, I'll keep working on finding a solution, but if someone knows 
 what
 I'm going through, or can offer suggestions, that'd be great.

 Thanks,

 Chris

 --
http://cjordan.us

--
   http://cjordan.us

   --
  http://cjordan.us

  --
 http://cjordan.us


[jQuery] Re: yet another beginner's diary (pls review!)

2008-02-04 Thread [EMAIL PROTECTED]

Oh dear!
Thank you for taking the trouble to read  reply, Daniel.

learn it, then write about it.
Precisely what I have been doing! Not very well, it seems 

Fail enough times and eventually you'll have a foundation to write
about and share with others.
My intention was never to write a jQuery textbook; more to communicate
the specific difficulties of using it for the first time, and the
solutions I've found.
I do find it confusing. Perhaps I'm communicating too much of my own
confusion!!

I'll try rewriting it  using my own html this time, instead of
Google's silly templates (which only confused things further!)

Cheers,
Cherry.

On Feb 4, 11:55 am, Rabbit [EMAIL PROTECTED] wrote:
 Reads like a confused monologue.

 Before you start writing, really think about what you want to convey.
 If someone reads your blog, will they come away with anything new or
 useful?

 I find it often helps to explicitly answer my own questions when I
 write. In other words, write to learn. If you don't know something,
 learn it, then write about it. Writing about it will reinforce your
 understanding of the subject and probably be in a format that other
 people will readily enjoy, precisely because you set out to answer a
 very specific question.

 If you find you don't have a specific question, chances are you need
 to think about what _your_ personal goals are with jQuery (or
 anything). Do you want to create an image gallery? Do you want to make
 more usable forms? Do you want to learn how to create a modal window
 from scratch? Maybe you want to learn better ways to organize your
 code (I gleaned this as being true from your blog).

 Most often, the best teacher, and often enough, the only teacher, is
 personal experience. Fail enough times and eventually you'll have a
 foundation to write about and share with others.

 I wish you the best of luck with your blog, and hope you have a lot of
 fun with jQuery; I know I have!

 - Daniel

 ---

 On Feb 3, 8:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:

  Seriously, I beg for your opinions/corrections/suggestions ...

 http://cherry.austin.googlepages.com/home

  Cherry


[jQuery] Re: yet another beginner's diary (pls review!)

2008-02-04 Thread Rabbit

Reads like a confused monologue.

Before you start writing, really think about what you want to convey.
If someone reads your blog, will they come away with anything new or
useful?

I find it often helps to explicitly answer my own questions when I
write. In other words, write to learn. If you don't know something,
learn it, then write about it. Writing about it will reinforce your
understanding of the subject and probably be in a format that other
people will readily enjoy, precisely because you set out to answer a
very specific question.

If you find you don't have a specific question, chances are you need
to think about what _your_ personal goals are with jQuery (or
anything). Do you want to create an image gallery? Do you want to make
more usable forms? Do you want to learn how to create a modal window
from scratch? Maybe you want to learn better ways to organize your
code (I gleaned this as being true from your blog).

Most often, the best teacher, and often enough, the only teacher, is
personal experience. Fail enough times and eventually you'll have a
foundation to write about and share with others.

I wish you the best of luck with your blog, and hope you have a lot of
fun with jQuery; I know I have!

- Daniel

---

On Feb 3, 8:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Seriously, I beg for your opinions/corrections/suggestions ...

 http://cherry.austin.googlepages.com/home

 Cherry


[jQuery] Re: JQuery takes 80% of my core2Duo proc on DOM element inserts

2008-02-04 Thread Jake McGraw

Perhaps you could set up a queue using window.setInterval() and limit
your appends to  40 or so rows every couple of seconds? Also, do you
have an example page where your script can be viewed?

- jake

On Feb 4, 2008 1:57 PM, Ashish [EMAIL PROTECTED] wrote:

 Hi ,

 I am very new to jquery. I am using jquery 1.2.2 . I use jquery
 tablesorter to insert around 400 rows to a table. The data is
 collected using an Ajax call.

 When new rows are inserted to the table the CPU utilization shoots up
 to 80%. All browsers freeze until the table is populated :(

 I tried to insert 400 divs to a single div and faced the same problem.
 This rules out a problem with tablesorter.

 Does jquery attach a lot of handlers to dom events that make appends
 very slow ?

 Any suggestions would be much appreciated.

 Thanks and regards,
  - Ashish



[jQuery] Re: Another jdMenu problem... IE specific...

2008-02-04 Thread Jonathan Sharp
Gah! That doesn't sound like much fun! Get better! (I hear reading a jQuery
book or two does wonders for the recovery!)

Cheers,
-Jonathan


On 2/4/08, Chris Jordan [EMAIL PROTECTED] wrote:

 Jonathan,

 Thanks for the update! Sorry I didn't see it until now. I've been in the
 hospital (just had gastric bypass surgery), and I'm finally at home
 recovering. Again, thanks for the wonderful plug-in!

 Chris

 On Jan 31, 2008 11:01 AM, Jonathan Sharp [EMAIL PROTECTED] wrote:

  Hi Chris,
 
  Just wanted to give you a heads up, I've released jdMenu 1.4.0 at
  http://jdsharp.us/jQuery/plugins/jdMenu/1.4.0 (though I haven't posted
  notice of this yet) It's been updated to work with jQuery 1.2.2 and the
  latest dimensions plugin.
 
  Cheers,
  -Jonathan
 
 
On 1/24/08, Chris Jordan [EMAIL PROTECTED] wrote:
  
   Sorry, I'm just now getting back to this guys (I was sick yesterday).
   I appreciate all the suggestions. I'll bet it's malformed markup. I don't
   create it though. This is an osCommerce shopping cart. I'll see if I can
   find where the HTML is getting messed up.
  
   Thanks heaps!
   Chris
  
   On Jan 21, 2008 7:02 PM, Karl Swedberg [EMAIL PROTECTED] wrote:
  
Hi Chris,
   
Sorry, I was looking in Firefox. I see now that the problem exists
in IE only. It might have something to do with the fact that the page is
running in quirks mode and that the markup is invalid. Try running it
through an HTML validator ( e.g. 
http://validator.w3.org/)http://validator.w3.org/%29.
In particular, you have two extra DOCTYPE declarations throughout the 
page.
And if you want to stick with HTML 4.01 transitional, replace this
...
   
   
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
   
   
with this ...
   
   
 !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
   http://www.w3.org/TR/html4/loose.dtd 
   
If cleaning up the HTML doesn't help, we can look at some other
stuff. In the meantime, I'll poke around the plugin code and the 
stylesheets
a bit to see how the positioning is being done.
   
   
   
   
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com
   
   
   
   
   
 On Jan 21, 2008, at 4:08 PM, Chris Jordan wrote:
   
You said it was positioning correctly for you? What version of IE
was that in? For me, in IE6 it shows up in the top left (0,0) of the 
view
port... it's supposed to show just below the top-level menu choice.
   
Also, I know there are broken images. Ignore those and look mostly
at the ones that do have images. I'm still waiting on my graphic artist 
guy
to get me the rest of the images. I also don't see anywhere (unless I'm 
just
missing it) where the sub-menus are being positioned. You can check out 
all
the css if you have the Web Developer extension for FF.
   
Thanks again,
Chris
   
On Jan 21, 2008 1:01 PM, Chris Jordan [EMAIL PROTECTED]
wrote:
   
 going to lunch. I'd like to exchange emails with you about this.
 I'll be back in about an hour or so. Thanks so much Karl.

 Chris


 On Jan 21, 2008 12:52 PM, Karl Swedberg  [EMAIL PROTECTED]
 wrote:

  It looked to me like it was being positioned correctly. Also
  looks like you have a broken link to a rollover image for the 
  top-level nav
  items. I'm guessing that the sub-menus are using position:absolute 
  for their
  positioning, so you'll need to have a parent element given 
  position:relative
  in order for the submenus to be positioned relative to those parent 
  elements
  rather than the body element.
 
  Hope that helps.
 
 
 
  --Karl
  _
  Karl Swedberg
  www.englishrules.com
  www.learningjquery.com
 
 
 
 
   On Jan 21, 2008, at 1:42 PM, Chris Jordan wrote:
 
  Hi folks.
 
  I'm having another problem with the jdMenu plug-in. In IE when I
  hover over the top-level menu the sub-menu appears in the absolute 
  top left
  of the view-port! Bah! I don't know what I've done wrong. I've used 
  jdMenu
  at another client of mine, and it works great in both FF and IE. 
  This time
  around however, I *am* customizing the css file quite a bit to 
  better suit
  my needs.
 
  The problem can be seen 
  herehttp://seidal.com/dev/furniturehotspot/
  .
 
  This is causing me much aggravation, and more time at this one
  particular client that I should really be spending.
 
  I would *really* appreciate anyone's help on this problem. Of
  course, I'll keep working on finding a solution, but if someone 
  knows what
  I'm going through, or can offer suggestions, that'd be great.
 
  Thanks,
 
  Chris
 
 
  --
  http://cjordan.us
 

[jQuery] Re: Another jdMenu problem... IE specific...

2008-02-04 Thread Chris Jordan
Jonathan,

Thanks for the update! Sorry I didn't see it until now. I've been in the
hospital (just had gastric bypass surgery), and I'm finally at home
recovering. Again, thanks for the wonderful plug-in!

Chris

On Jan 31, 2008 11:01 AM, Jonathan Sharp [EMAIL PROTECTED] wrote:

 Hi Chris,

 Just wanted to give you a heads up, I've released jdMenu 1.4.0 at
 http://jdsharp.us/jQuery/plugins/jdMenu/1.4.0 (though I haven't posted
 notice of this yet) It's been updated to work with jQuery 1.2.2 and the
 latest dimensions plugin.

 Cheers,
 -Jonathan


 On 1/24/08, Chris Jordan [EMAIL PROTECTED] wrote:
 
  Sorry, I'm just now getting back to this guys (I was sick yesterday). I
  appreciate all the suggestions. I'll bet it's malformed markup. I don't
  create it though. This is an osCommerce shopping cart. I'll see if I can
  find where the HTML is getting messed up.
 
  Thanks heaps!
  Chris
 
  On Jan 21, 2008 7:02 PM, Karl Swedberg [EMAIL PROTECTED] wrote:
 
   Hi Chris,
  
   Sorry, I was looking in Firefox. I see now that the problem exists in
   IE only. It might have something to do with the fact that the page is
   running in quirks mode and that the markup is invalid. Try running it
   through an HTML validator ( e.g. 
   http://validator.w3.org/)http://validator.w3.org/%29.
   In particular, you have two extra DOCTYPE declarations throughout the 
   page.
   And if you want to stick with HTML 4.01 transitional, replace this ...
  
  
  
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
  
  
   with this ...
  
  
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
  http://www.w3.org/TR/html4/loose.dtd 
  
   If cleaning up the HTML doesn't help, we can look at some other stuff.
   In the meantime, I'll poke around the plugin code and the stylesheets a 
   bit
   to see how the positioning is being done.
  
  
  
  
   --Karl
   _
   Karl Swedberg
   www.englishrules.com
   www.learningjquery.com
  
  
  
  
  
On Jan 21, 2008, at 4:08 PM, Chris Jordan wrote:
  
   You said it was positioning correctly for you? What version of IE was
   that in? For me, in IE6 it shows up in the top left (0,0) of the view
   port... it's supposed to show just below the top-level menu choice.
  
   Also, I know there are broken images. Ignore those and look mostly at
   the ones that do have images. I'm still waiting on my graphic artist guy 
   to
   get me the rest of the images. I also don't see anywhere (unless I'm just
   missing it) where the sub-menus are being positioned. You can check out 
   all
   the css if you have the Web Developer extension for FF.
  
   Thanks again,
   Chris
  
   On Jan 21, 2008 1:01 PM, Chris Jordan [EMAIL PROTECTED]
   wrote:
  
going to lunch. I'd like to exchange emails with you about this.
I'll be back in about an hour or so. Thanks so much Karl.
   
Chris
   
   
On Jan 21, 2008 12:52 PM, Karl Swedberg  [EMAIL PROTECTED]
wrote:
   
 It looked to me like it was being positioned correctly. Also looks
 like you have a broken link to a rollover image for the top-level nav 
 items.
 I'm guessing that the sub-menus are using position:absolute for their
 positioning, so you'll need to have a parent element given 
 position:relative
 in order for the submenus to be positioned relative to those parent 
 elements
 rather than the body element.

 Hope that helps.



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




  On Jan 21, 2008, at 1:42 PM, Chris Jordan wrote:

 Hi folks.

 I'm having another problem with the jdMenu plug-in. In IE when I
 hover over the top-level menu the sub-menu appears in the absolute 
 top left
 of the view-port! Bah! I don't know what I've done wrong. I've used 
 jdMenu
 at another client of mine, and it works great in both FF and IE. This 
 time
 around however, I *am* customizing the css file quite a bit to better 
 suit
 my needs.

 The problem can be seen herehttp://seidal.com/dev/furniturehotspot/
 .

 This is causing me much aggravation, and more time at this one
 particular client that I should really be spending.

 I would *really* appreciate anyone's help on this problem. Of
 course, I'll keep working on finding a solution, but if someone knows 
 what
 I'm going through, or can offer suggestions, that'd be great.

 Thanks,

 Chris


 --
 http://cjordan.us




   
   
   
   
--
http://cjordan.us
  
  
  
  
   --
   http://cjordan.us
  
  
  
  
 
 
 
  --
  http://cjordan.us





-- 
http://cjordan.us


[jQuery] Re: set focus on change

2008-02-04 Thread Scott Trudeau
Well, in that specific code, you should be able to just
$('#testField').focus(); because you are only working with a single field.

That said, I think maybe $(this).focus() is what you want for the generic
case? (can't recall what $(this) is inside an event callback).

Scott

On Feb 4, 2008 10:26 AM, Matt Williams [EMAIL PROTECTED] wrote:


 I want to run a validation function after a user enters data. If the
 validation fails, I want do an alert telling them so and set the focus
 back to that field. But even at the most basic level, I can't get the
 focus to stay / go back to the field that was changed. Interesting
 that it does seem to work in IE 7, but not FF.

 $(document).ready(function(){
  $('#testField').change(function() { alert('wrong value');
 this.focus(); });
 });

 Any ideas here? Or suggestions on how to reset focus back to the field
 that changed?

 Thanks,

 Matt




-- 
--
Scott Trudeau
scott.trudeau AT gmail DOT com
http://sstrudeau.com/
AIM: sodthestreets


[jQuery] Re: yet another beginner's diary (pls review!)

2008-02-04 Thread Rick Faircloth

Hi, Daniel...

You're telling Cherry almost the opposite of what she (she?) was told by
someone on the list yesterday.

She was complaining that there wasn't enough info out there from her
perspective to accomplish simple tasks.  There's documentation and plug-in
usage, but she said she was frustrated trying to do simple tasks.

So, someone recommended that she write about jQuery based on what she
already knew... don't worry about whether is completely accurate, thorough,
or a best-practice... someone will come along and correct any problems.

So that's what's she's done... written about what she knows as a beginner.

It's probably very helpful to those who are trying to get started with jQuery
and want to learn by doing simple tasks, rather than reading documentation.
Better to learn by doing rather than studying theory.

Anyway, I'm not sure if you've familiar with the thread yesterday.  I just
don't want Cherry to think she's being jerked around by people on the list
telling her one thing one day and something else the next.  It's frustrating
enough trying to get started with jQuery enough, as it is.

I know.  I started only a couple of months ago with absolutely no Javascript
experience, so for me, it was especially frustrating.  (And in some ways, still 
is.)

Not trying to bust your chops on this, but trying to make sure Cherry doesn't
get too frustrated.

Also... reading monologues can be *very* beneficial...

Rick

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rabbit
 Sent: Monday, February 04, 2008 6:56 AM
 To: jQuery (English)
 Subject: [jQuery] Re: yet another beginner's diary (pls review!)
 
 
 Reads like a confused monologue.
 
 Before you start writing, really think about what you want to convey.
 If someone reads your blog, will they come away with anything new or
 useful?
 
 I find it often helps to explicitly answer my own questions when I
 write. In other words, write to learn. If you don't know something,
 learn it, then write about it. Writing about it will reinforce your
 understanding of the subject and probably be in a format that other
 people will readily enjoy, precisely because you set out to answer a
 very specific question.
 
 If you find you don't have a specific question, chances are you need
 to think about what _your_ personal goals are with jQuery (or
 anything). Do you want to create an image gallery? Do you want to make
 more usable forms? Do you want to learn how to create a modal window
 from scratch? Maybe you want to learn better ways to organize your
 code (I gleaned this as being true from your blog).
 
 Most often, the best teacher, and often enough, the only teacher, is
 personal experience. Fail enough times and eventually you'll have a
 foundation to write about and share with others.
 
 I wish you the best of luck with your blog, and hope you have a lot of
 fun with jQuery; I know I have!
 
 - Daniel
 
 ---
 
 On Feb 3, 8:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
  Seriously, I beg for your opinions/corrections/suggestions ...
 
  http://cherry.austin.googlepages.com/home
 
  Cherry




[jQuery] Re: set focus on change

2008-02-04 Thread Matt Williams

I should clarify a bit more. The real implementation will be on
multiple fields and is for date validation / correction (i.e., changes
dashes to slashes).
$('#myDateField').change(function() { $.DateCorrection(this) });

If the date errors in this function, I have (function takes el as
parameter and sets error flag as it goes...)

if(error) {
alert(An invalid date was provided.);
el.value = '';
el.focus();
return false;
}

So this works in IE, but not FF. Same as the basic example. The
following works in IE, but not FF (forgot to add return false in orig.
post):
$('#testField').change(function() { alert('wrong value'); $
(this).focus(); return false;});

Matt

On Feb 4, 9:35 am, Scott Trudeau [EMAIL PROTECTED] wrote:
 Well, in that specific code, you should be able to just
 $('#testField').focus(); because you are only working with a single field.

 That said, I think maybe $(this).focus() is what you want for the generic
 case? (can't recall what $(this) is inside an event callback).

 Scott

 On Feb 4, 2008 10:26 AM, Matt Williams [EMAIL PROTECTED] wrote:





  I want to run a validation function after a user enters data. If the
  validation fails, I want do an alert telling them so and set the focus
  back to that field. But even at the most basic level, I can't get the
  focus to stay / go back to the field that was changed. Interesting
  that it does seem to work in IE 7, but not FF.

  $(document).ready(function(){
   $('#testField').change(function() { alert('wrong value');
  this.focus(); });
  });

  Any ideas here? Or suggestions on how to reset focus back to the field
  that changed?

  Thanks,

  Matt

 --
 --
 Scott Trudeau
 scott.trudeau AT gmail DOT comhttp://sstrudeau.com/
 AIM: sodthestreets


[jQuery] Re: Help populating an array via JSON

2008-02-04 Thread Mike Miller

Thanks for the tip.

I have now added the following 2 functions to my code:

function setStates(obj) {
  this.states = obj;
}

function getStates() {
  return this.states;
}

function StateSuggestions() {

$j.getJSON(client/ajax/getMedList.php, function(data){

setStates(data);

  });

}

And things are now working beautifully.

M

On Feb 4, 10:36 am, Josh Nathanson [EMAIL PROTECTED] wrote:
 This is because of the asynchronicity...you will only have the correct
 data length within the callback function from the getJSON call.  Any code
 along the same block as the getJSON call will be executed without regard to
 the returned data.

 What you can do is abstract the code where you are working with the
 this.states array into a separate function, and then call this abstracted
 function from the getJSON callback.

 -- Josh

 - Original Message -
 From: Mike Miller [EMAIL PROTECTED]
 To: jQuery (English) jquery-en@googlegroups.com
 Sent: Monday, February 04, 2008 9:00 AM
 Subject: [jQuery] Help populating an array via JSON

  Hi,

  I have a javascript function as follows:

  function StateSuggestions() {

  this.states =[];

  $j.getJSON(client/ajax/getMedList.php, function(data){
  alert(inside getJSON + data.length);

  this.states = data;

  alert(this.states.length); //Value says 10

  for (i = 0; i  data.length; i++) {
  alert(test + i);

  }
  });

  alert(this.states.length); // Length here is 0

  }

  I want to populate the this.states array with data being retrieved by
  the getJSON call...however it appears that the value of this.states is
  different depending on whether or not you are inside the JSON call or
  outside of it...not sure why...

  M


[jQuery] ajaxSubmit and NiceJForms plugins

2008-02-04 Thread zorba

Hello.

The NiceJForms plugin is called like following:

 $.NiceJForms.build();

I build a form dinamically so that I have to call again NiceJForms to
apply it to the new elements.

Here is the problem, if I do:

var options = {
//some stuff
success: function() {
$.NiceJForms.build();
}
};
$('myform').submit(function() {
$(this).ajaxSubmit(options);
return false;
});

then NiceJForms is built twice, so that all elts appear twice.

How could I un-build and then build again NIceJform, or call it only
on the new elts?

Any idea is welcome.Thanks.


[jQuery] Re: yet another beginner's diary (pls review!)

2008-02-04 Thread [EMAIL PROTECTED]

Wow, Rick, you remembered! Thank you :))

Daniel's point was fair enough I think, although there is absolutely
no sense in my trying to write an authoritative guide to jQuery ...
obviously ;)

I'll try and reorganise it. And thank you VERY much for your message!

Cherry

On Feb 4, 3:52 pm, Rick Faircloth [EMAIL PROTECTED] wrote:
 Hi, Daniel...

 You're telling Cherry almost the opposite of what she (she?) was told by
 someone on the list yesterday.

 She was complaining that there wasn't enough info out there from her
 perspective to accomplish simple tasks.  There's documentation and plug-in
 usage, but she said she was frustrated trying to do simple tasks.

 So, someone recommended that she write about jQuery based on what she
 already knew... don't worry about whether is completely accurate, thorough,
 or a best-practice... someone will come along and correct any problems.

 So that's what's she's done... written about what she knows as a beginner.

 It's probably very helpful to those who are trying to get started with jQuery
 and want to learn by doing simple tasks, rather than reading documentation.
 Better to learn by doing rather than studying theory.

 Anyway, I'm not sure if you've familiar with the thread yesterday.  I just
 don't want Cherry to think she's being jerked around by people on the list
 telling her one thing one day and something else the next.  It's frustrating
 enough trying to get started with jQuery enough, as it is.

 I know.  I started only a couple of months ago with absolutely no Javascript
 experience, so for me, it was especially frustrating.  (And in some ways, 
 still is.)

 Not trying to bust your chops on this, but trying to make sure Cherry doesn't
 get too frustrated.

 Also... reading monologues can be *very* beneficial...

 Rick

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
  Rabbit

  Reads like a confused monologue.


  On Feb 3, 8:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
  wrote:
   Seriously, I beg for your opinions/corrections/suggestions ...

  http://cherry.austin.googlepages.com/home

   Cherry


[jQuery] Re: Author of UI-Tabs Plug-in?

2008-02-04 Thread Klaus Hartl

In addition, I'm not sure if you really need the tabs plugin if you
just need to load content into a single div...:

var $a = $('ul a').bind('click', funtion() {
$a.removeClass('selected');
$(this).addClass('selected');
$('#load-here').load(this.href);
return false;
});


--Klaus


On Feb 4, 5:35 pm, Lion29 [EMAIL PROTECTED] wrote:
 @Klaus:

 On Feb 3, 7:42 pm, Klaus Hartl [EMAIL PROTECTED] wrote:

  On Feb 2, 2:58 pm, Lion29 [EMAIL PROTECTED] wrote:

   1. Right now thetabsfunction that upon every ajax load the new
   content is ADDED to the DOM (even if the new loaded content is in
   conflict with already loaded - same ids for example)
   It would be nice to have the option to settabsto laod the content
   into the same placeholder... and to empty its content first (so to
   replace it's content and not just add it)..

  That doesn't make sense to me. Each tab represents a section in the
  document (which is identified with a fragment identifier). Imagine you
  had in-pagetabs. It wouldn't make any sense if all thesetabswould
  point to a single fragment, e.g. div element.

 Your logic would be correct if we were talking ONLY for page
 seggments But why add ajax option to the tabs then if ajax loads
 the content after...
 So In my opinion having the ajax option it would be nice to have that
 option too... I am sure it will be usefull to others, not only to me


[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread Giovanni Battista Lenoci


Jeffrey Kretz ha scritto:

Another way would be to use the ctrlKey property of the Click event:

$('#element').click(function(e)
{
if (e.ctrlKey)
{
do_something();
}
});

jQuery also normalizes this into the metaKey attribute which detects the CMD
key on a Mac:

$('#element').click(function(e)
{
if (e.metaKey)
{
do_something();
}
});
  

Very cool, thank you all.

--
gianiaz.net - Giovanni Battista Lenoci 
P.le Bertacchi 66 
23100 Sondrio (SO) - Italy




[jQuery] Re: jCarousel - How do I hide the list before display

2008-02-04 Thread caroig

Ok thank Rich - I'll give that a try - I'd hoped I could hide it all
until it's built.

On Feb 4, 4:23 pm, rich [EMAIL PROTECTED] wrote:
 I had this problem once before. I ended setting a fixed height on the
 parent div and setting overflow:hidden.

 -rich

 On Feb 4, 8:03 am, caroig [EMAIL PROTECTED] wrote:

  Hi,
  Is there a way of hiding the list before the carousel is fully
  generated.  I often get to see the list of images before the carousel
  effect is produced.  I've tried setting display to none in my css and
  then  executing jQuery .show after the carousel, but seems doesn't
  work well.

  many thanks


[jQuery] Re: set focus on change

2008-02-04 Thread Matt Williams

Just to follow up and hopefully help anyone else with this problem.
The issue is not jQuery or FF really, but just how javascript is
handled. Basically onBlur happens after the code is executed, meaning
that after this.focus(), it is still blurred.
So the solution is this:
setTimeout(function () { obj.focus() }, 50);

Googling this phrase led me to find this solution: javascript focus
after onchange

Matt



[jQuery] Re: [validate] Validation Plugin - how to remove a control form validation

2008-02-04 Thread Dave Stewart

Hey Jorn,

Actually the main form image are part of the Art and Science of CSS
book (hell, they published it, so I guess you can) but you could just
specify no bg image and have coloured blocks instead.

The highlight code is mine, but I've updated the first line to cleaner
jQuery to read

var elements = $(input[type!='submit'], textarea, select)

And also, change the page title!

Just checked the code. Looks pretty good, however if the user decides
halfway through that he does remember his password, and clicks
Login, he then has to click it a second time to get the password
validation to kick in. Is there a solution for this?

Looking good though!

:D


[jQuery] Zebra striping in tables

2008-02-04 Thread Snef

Hi,

I know how to do some 'zebra-striping' on tables with jQ, but i have a
little problem.

I have some (unknown amount) tables om a page and I want to 'stripe'
the tables seperately, so that all striping is the same in each table.

With a simple:

$(table tr:even).css(background, #cc) the rows are counted
over all the tables and I want to start counting (for even and odd
rows) for every table, so i tought:

$(table).each(function() {
 // how to get the rows here???
})

How do I do this? (I do not know on forehand how many or which tables
are on the page)


[jQuery] replacement image to fade in + out again - how?

2008-02-04 Thread [EMAIL PROTECTED]

Me again :/

OK, I accessibly replaced my h1 with this clunky snip:

   $('h1').append('img src=\/images/headertext.gif\ alt=\alt
text\ title=\title text\ longdesc=\http://something.com/
fullinfo.html /');

There's a visible lag pre-loading on this machine (220kb connection)
so I'd appreciate advice 

Now I want an alternative image to fade in  fade out again,
simulating a 'glow' effect. I only want this to happen once.

Is there a way to achieve it without putting a hidden div on top of
the headline? I want to avoid that, if possible, because it will wreck
my accessibility standards.

Sorry if this should have been obvious: I've just been reading up on
liveQuery and loQuery and am about to check my brain into a repair
shop!!

Cherry.


[jQuery] Re: [Validation] v1.2.1pre - Validating an empty field and

2008-02-04 Thread Rus Miller
Great.  Thanks.

[subliminal message] Spinner!  Spinner! [/subliminal message]



On Feb 4, 2008 5:36 PM, Jörn Zaefferer [EMAIL PROTECTED] wrote:


 Rus Miller schrieb:
  Yep.  You got it.  Thanks for great work!
 
  Is a spinner coming anytime soon?
 
 Not in the 1.2.1 release, I don't yet have a schedule for further
 releases. I'll keep it in mind.

 And by the way, 1.2.1 bundles both the delegate plugin and the necessary
 part of the ajaxQueue plugin, so you don't need to include those anymore.

 Jörn

 



[jQuery] Re: Firefox: how to center the selected text in textarea

2008-02-04 Thread [EMAIL PROTECTED]

On Feb 1, 10:29 pm, Ariel Flesler [EMAIL PROTECTED] wrote:
 Hi lihao

 Is there any method under Firefox that the caret and the selected text
 can automatically jump to the center of the textarea so that people
 dont need to scroll down/up to find it??

 Not that I know of, but you could force the scroll with jQuery, if you
 want, this plugin can save you some troubles:
 jQuery.ScrollTo:http://flesler.blogspot.com/2007/10/jqueryscrollto.html

 Is the textarea bigger than a regular screen ? ( 600px ? ) If it's
 not, you could just center the screen on the textarea.
 If it's even bigger, then you need some implement some sort of wise
 scrolling, based in the position of the caret

 Cheers
 Ariel Flesler

Hi, Ariel:

Thank you so much for your link.. have to say, your work is so cool
and I will definitely give it a try. :- )

Best regards,
lihao




[jQuery] copy li values to an array

2008-02-04 Thread Paul Jones

I know the following would work if I wanted to copy the values of *each*
li
to a separate array element.

html
head
title/title

script type = text/javascript src=jquery.js/script

 script type = text/javascript
 var array1 = new Array() ;
 $(document).ready(function()
 {
 $('li').each(function(i) {  array1[i] = this.innerHTML )  })
 })
 /script

/head

body

ul
lia/li
lib/li
lic/li

lid/li
lie/li
lif/li

lig/li
lih/li
lii/li
/ul

/body

/html

However, I would like like to copy the *concatenated* values of each group
of
3 li's to 1 array element.
(eg) the 1st array element would have a value of 'abc', the 2nd array
element would have a value of 'def', and the 3rd array element would have a
value of 'ghi' etc.

What is the best way to do this?

TIA


[jQuery] An Eclipse Plugin for JQuery, other than jQueryWTP ?

2008-02-04 Thread kozEfx

anyone using  jQueryWTP in eclipse?

the install directions destroyed my eclipse environ and i had to re-
install--even though i replaced the modified plugin with a copy of the
original.  it was odd.

I'll settle for a dreamweaver plugin, if anyone knows of one, but
would rather have eclipse one.

Thx.


[jQuery] Re: jCarousel infinite loop problem w/ multiple carousels on display: none

2008-02-04 Thread Josh V

todd, how are you building two carousels on the same page? are you
using the same css file to build them? how can i build two carousels
with while referencing their own stylesheets.

On Jan 31, 4:17 pm, Todd [EMAIL PROTECTED] wrote:
 I actually was able to figure out what the issue was.

 Since this error was happening on resize, I commented out

 $(window).bind('resize', function() { self.reload(); });

 and for good measure, also commented out

 alert('jCarousel: No width/height set for items. This will cause an
 infinite loop. Aborting...');

 That seemed to do the trick.  Now I can swap out carousels using show/
 hide with an onclick and when I resize the browser window, no alert.

 Once the page is up, I will post a link so others may benefit from how
 it was built and use it for their own platforms.

 - Todd


[jQuery] Re: Drag n Drop

2008-02-04 Thread Richard D. Worth
Are you using Interface or jQuery UI? If Interface, it's no longer supported
(could explain your question going unanswered). If jQuery UI, you'll want to
ask on the jQuery UI mailing list:

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

- Richard

On Feb 2, 2008 3:58 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 I have a draggable div, and a droppable div.
 How can i make something like this

 If drop outside droppable revert to initial position
 else update

 ?



[jQuery] Re: copy li values to an array

2008-02-04 Thread Jonathan Sharp
Hi Paul,

This should do the trick:

$('li').each(function(i){
array1[ Math.floor( i / 3 ) ] = $(this).html();
});

Cheers,
-Jonathan


On 2/4/08, Paul Jones [EMAIL PROTECTED] wrote:


 I know the following would work if I wanted to copy the values of *each*
 li
 to a separate array element.

 html
 head
 title/title

 script type = text/javascript src=jquery.js/script

 script type = text/javascript
 var array1 = new Array() ;
 $(document).ready(function()
 {
 $('li').each(function(i) {  array1[i] = this.innerHTML )  })
 })
 /script

 /head

 body

 ul
lia/li
lib/li
lic/li

lid/li
lie/li
lif/li

lig/li
lih/li
lii/li
 /ul

 /body

 /html

 However, I would like like to copy the *concatenated* values of each group
 of
 3 li's to 1 array element.
 (eg) the 1st array element would have a value of 'abc', the 2nd array
 element would have a value of 'def', and the 3rd array element would have
 a
 value of 'ghi' etc.

 What is the best way to do this?

 TIA



[jQuery] Re: Zebra striping in tables

2008-02-04 Thread Smith, Allex

Couldn't you just use $(this) and then do whatever selector?

$(table).each(function() {
$(this).find('tr:even').css(background-color, #ff);
});

Maybe I don't understand the question.

Allex

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Snef
Sent: Monday, February 04, 2008 2:38 PM
To: jQuery (English)
Subject: [jQuery] Zebra striping in tables



Hi,

I know how to do some 'zebra-striping' on tables with jQ, but i have a
little problem.

I have some (unknown amount) tables om a page and I want to 'stripe' the
tables seperately, so that all striping is the same in each table.

With a simple:

$(table tr:even).css(background, #cc) the rows are counted
over all the tables and I want to start counting (for even and odd
rows) for every table, so i tought:

$(table).each(function() {
 // how to get the rows here???
})

How do I do this? (I do not know on forehand how many or which tables
are on the page)


[jQuery] Passing dyanamic parameters

2008-02-04 Thread mermer

I'm trying to work out the best ways to pass parameters to JQuery AJAX
functions if I don't know the value of the parameters in advance,
because the web page has been created dynamically.

Take the example, where a user wants to search for details on a range
of books.   They enter a serarch term and a list of books is
provided.   Then the user clicks on the 3rd item in the list - which
needs to tell the server to get the details for this particular.

Cheers

MerMer


[jQuery] Re: Generating a Mousedown event programmatically - similar to click() generation..

2008-02-04 Thread B

Hi,

I am having the same problem with triggering the draggable from a
javascript function. If possible could you please share your source
hack?

Thanks

On Jan 29, 2:49 pm, edwardbaafi [EMAIL PROTECTED] wrote:
 http://docs.jquery.com/Eventshas mousedown, mouseup, mousemove, etc

 Yes, you are able to trigger these events using trigger( type,
 data ), but what about setting the event properties?

 In my case, when an element is draggable and it's mousedown event
 fires, the
 click function in ui.mouse.js is called..  A number of properties of
 the event, like e.which, e.target, e.srcElement, e.pageX, e.pageY are
 needed but at least some of these properties are undefined..

 Is it possible to set these properties when calling
 trigger('mousedown') or with some other unpublished way?

 Thanks,

 Ed


[jQuery] Re: Could JQuery or Thickbox be eating my image onerror and onload events?

2008-02-04 Thread [EMAIL PROTECTED]

I ran into something very similar...turned out to be an order-of-
operations problem...yours could be the same.  Try binding the event
from your script, and make sure you set the load before the src.

The following does not work in IE when the image is in the browser
cache (but it works in FF), because the load event fires immediately
after setting src, before my handler gets attached to the load event:

$(#someimg)
  .attr({ src: some/url.jpg })
  .load(function(){ /* whatever */ });

The following works in both FF and IE...it sets the load handler
before the src attribute:

$(#someimg)
  .load(function(){ /* whatever */ })
  .attr({ src: some/url.jpg });


On Feb 3, 2:55 pm, RH [EMAIL PROTECTED] wrote:
 From the html running inside of a Thickbox iframe I've discovered that
 something is causing the onerror and onload events for my images to
 not get triggered when running in Firefox 2. This issues does NOT
 occur in IE 7.

 For example, try putting this into content that is loaded within a
 Thickbox iframe:
 img src=http://someotherdomain.com/file.gif?rand=xxx; ID=myid
 onerror=alert('img onerr'); onload=alert('img onload');

 When the content loads in IE the img onload alert is displayed as
 soon as the file.gif is loaded. However in Firefox 2 the onerror and
 onload events never fire at all, as determined by seeing no alerts at
 all. Likewise the JS error log is empty (no warnings or errors). I
 have also verified using debugging tools that the file.gif is being
 retrieved just find with a 200 status.

 I also tried with new Image() by setting its .onload and .onerror
 properties that way, and it makes no difference - does not fire in
 Firefox but does fire just fine in IE.

 Now if f I run the page that contains this img code in FF 2 directly
 (outside of Thickbox) then it works perfectly. So in some way either
 Thickbox or JQuery is eating/interfering with the events on the image
 load.

 Can someone shed some light on what may be causing this, and what
 possible work arounds or code tweaks I can try? I would be extremely
 grateful for any advice. Thank you!


[jQuery] Re: [validate] Validation Plugin - how to remove a control form validation

2008-02-04 Thread Jörn Zaefferer


Dave Stewart schrieb:

Hey Jorn,

Actually the main form image are part of the Art and Science of CSS
book (hell, they published it, so I guess you can) but you could just
specify no bg image and have coloured blocks instead.

The highlight code is mine, but I've updated the first line to cleaner
jQuery to read

var elements = $(input[type!='submit'], textarea, select)

And also, change the page title!
  
Changed the title, improved the highlight code and removed those 
background images.

Just checked the code. Looks pretty good, however if the user decides
halfway through that he does remember his password, and clicks
Login, he then has to click it a second time to get the password
validation to kick in. Is there a solution for this?
  

Not sure yet what you mean, could go through the steps to reproduce?

Thanks
Jörn


[jQuery] Re: inArray inst working in my script

2008-02-04 Thread Karl Rudd
inArray doesn't return a boolean, it returns an index and -1 if the
value is not in the array.

jQuery.inArray( value, array )
Determine the index of the first parameter in the Array (-1 if not found).

from: http://docs.jquery.com/Utilities/jQuery.inArray#valuearray

So you need to change:

if ( ! $.inArray(nuevo_estilo[0].href, estilos_href) ) {

To:

if ( $.inArray(nuevo_estilo[0].href, estilos_href) == -1 )

Karl Rudd

On Feb 5, 2008 10:31 AM, Sebastián Würtz [EMAIL PROTECTED] wrote:

 Sebastián Würtz escribió:
 
  jQuery.getCSS = function(url, media, rel, title) {
 estilos_href = new Array();
 $.each( document.styleSheets, function(i, n){
 estilos_href[i] = n.href;
 });
 nuevo_estilo = jQuery(document.createElement('link')).attr({
 href: url,
 media: media || 'screen',
 type: 'text/css',
 title: title || '',
 rel: rel || 'stylesheet'
 });
 
 if ( ! $.inArray(nuevo_estilo[0].href, estilos_href) ) {
 nuevo_estilo.appendTo('head');
 }
  };
 
  what im doing wrong?
 
 pls some hand?



[jQuery] filter vs find

2008-02-04 Thread Kynn Jones
Could someone explain to me the difference between filter and find.  Their
descriptions sound very similar to me.  What are the criteria to choose one
over the other?

TIA!

kynn


[jQuery] Re: copy li values to an array

2008-02-04 Thread Karl Swedberg

Hi Paul,

 I may have misunderstood what you were going for, but here is a  
different approach, just in case you were looking for an array like  
['abc', 'def', 'ghi']:


var txt = '', array1 = [];
$('ul:first li').each(function(i){
txt = txt + $(this).html();
if (i % 3 == 2) {
array1.push(txt);
txt = '';
}
});


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



On Feb 4, 2008, at 5:00 PM, Jonathan Sharp wrote:


Hi Paul,

This should do the trick:

$('li').each(function(i){
array1[ Math.floor( i / 3 ) ] = $(this).html();
});

Cheers,
-Jonathan


On 2/4/08, Paul Jones [EMAIL PROTECTED] wrote:

I know the following would work if I wanted to copy the values of  
*each*

li
to a separate array element.

html
head
title/title

script type = text/javascript src=jquery.js/script

script type = text/javascript
var array1 = new Array() ;
$(document).ready(function()
{
$('li').each(function(i) {  array1[i] = this.innerHTML )  })
})
/script

/head

body

ul
   lia/li
   lib/li
   lic/li

   lid/li
   lie/li
   lif/li

   lig/li
   lih/li
   lii/li
/ul

/body

/html

However, I would like like to copy the *concatenated* values of each  
group

of
3 li's to 1 array element.
(eg) the 1st array element would have a value of 'abc', the 2nd array
element would have a value of 'def', and the 3rd array element would  
have a

value of 'ghi' etc.

What is the best way to do this?

TIA





[jQuery] Re: inArray inst working in my script

2008-02-04 Thread Sebastián Würtz


Sebastián Würtz escribió:


jQuery.getCSS = function(url, media, rel, title) {
   estilos_href = new Array();
   $.each( document.styleSheets, function(i, n){
   estilos_href[i] = n.href;
   });
   nuevo_estilo = jQuery(document.createElement('link')).attr({
   href: url,
   media: media || 'screen',
   type: 'text/css',
   title: title || '',
   rel: rel || 'stylesheet'
   });

   if ( ! $.inArray(nuevo_estilo[0].href, estilos_href) ) {
   nuevo_estilo.appendTo('head');
   }
};

what im doing wrong?


pls some hand?


[jQuery] Re: Validation 1.2 and UI Date Picker issue

2008-02-04 Thread Jörn Zaefferer


Eridius schrieb:

I think I found a bug in the validation 1.2 or ui datepicker plug-in.  I also
have the ui datepicker attacked to two of the form elements.  Now when I try
to validation a form and the fields that are calendars are not fielded in,
the calendar popped up for the first calendar element.  Now I am not sure if
this is an issue with the datepicker or the validation plug-in.  I don't
know how the calendar it triggered, i would assume a click event, but i
searched the validation plug-in for a trigger('click') and could not find
one(I could not find and trigger() for that matter).
  
The validation plugin gives focus to first invalid element on submit - 
or the one that had focus when the form was submitted. I guess the 
datepicker is triggered by that focus event. You can disable it in the 
validation plugin via focusInvalid:false. See 
http://docs.jquery.com/Plugins/Validation/validate for details.


Jörn


[jQuery] Re: [Validation] v1.2.1pre - Validating an empty field and

2008-02-04 Thread Jörn Zaefferer


Rus Miller schrieb:

Yep.  You got it.  Thanks for great work!

Is a spinner coming anytime soon?
  
Not in the 1.2.1 release, I don't yet have a schedule for further 
releases. I'll keep it in mind.


And by the way, 1.2.1 bundles both the delegate plugin and the necessary 
part of the ajaxQueue plugin, so you don't need to include those anymore.


Jörn


[jQuery] Re: Email validation broken in plugin v1.2?!

2008-02-04 Thread Seth - TA

Jörn -

Thanks for doing that. Is 1.2.1 out? I saw in the trunk that the
validate.js says 1.2.1pre. Is it usable? Thanks.

Seth

On Jan 31, 6:27 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Scott González schrieb: Please, don't do that.  The modified regex you 
 provided is way over
  simplified.  I'll try to produce the regex you want, it should be as
  easy as making the domain label required in the host name.

 1.2.1 will includeemailvalidation that requires the tld, providing the
 current implementation via additional methods. Same goes for the url
 validation.

 Jörn


[jQuery] Re: Generating a Mousedown event programmatically - similar to click() generation..

2008-02-04 Thread B

Hi,
I am trying to also trigger the draggable from within a javascript
function. If possible can you please share your source hack.

Thanks


On Jan 29, 2:49 pm, edwardbaafi [EMAIL PROTECTED] wrote:
 http://docs.jquery.com/Eventshas mousedown, mouseup, mousemove, etc

 Yes, you are able to trigger these events using trigger( type,
 data ), but what about setting the event properties?

 In my case, when an element is draggable and it's mousedown event
 fires, the
 click function in ui.mouse.js is called..  A number of properties of
 the event, like e.which, e.target, e.srcElement, e.pageX, e.pageY are
 needed but at least some of these properties are undefined..

 Is it possible to set these properties when calling
 trigger('mousedown') or with some other unpublished way?

 Thanks,

 Ed


[jQuery] Re: An Eclipse Plugin for JQuery, other than jQueryWTP ?

2008-02-04 Thread Smith, Allex

What about Aptana? Community Edition is free.

http://www.aptana.com/studio

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of kozEfx
Sent: Monday, February 04, 2008 12:03 PM
To: jQuery (English)
Subject: [jQuery] An Eclipse Plugin for JQuery, other than jQueryWTP ?



anyone using  jQueryWTP in eclipse?

the install directions destroyed my eclipse environ and i had to re-
install--even though i replaced the modified plugin with a copy of the
original.  it was odd.

I'll settle for a dreamweaver plugin, if anyone knows of one, but would
rather have eclipse one.

Thx.


[jQuery] UPDATER

2008-02-04 Thread [EMAIL PROTECTED]

Is there any function like AJAX.UPDATER in Prototype ??

Or how can I automaticly do AJAX.req in time interval for.ex. 2
minutes ?


[jQuery] Re: filter vs find

2008-02-04 Thread Karl Swedberg


filter will select a certain subset (zero or more) of the already  
selected elements.


find will select a set of (zero or more) elements that are descendants  
of the already selected elements.


Here is an example:

div class=peanuts
p class=elephants/p
/div
div class=elephants
p/p
/div


$('div').filter('.elephants'); // -- selects the second div, because  
it has class=elephants


$('div').find('.elephants'); // -- selects the first paragraph,  
because it has class=elephants


* Note that these two examples are very simple and would probably be  
better written as ...


$('div.elephants');

 ... and ...

$('div .elephants');


You can find some more complex examples here:

http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2



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



On Feb 4, 2008, at 7:04 PM, Kynn Jones wrote:

Could someone explain to me the difference between filter and find.   
Their descriptions sound very similar to me.  What are the criteria  
to choose one over the other?


TIA!

kynn






[jQuery] Re: jquery newbie test

2008-02-04 Thread Josh Nathanson
Access...confirmed.  =]
  - Original Message - 
  From: CFMike 
  To: jquery-en@googlegroups.com 
  Sent: Monday, February 04, 2008 4:00 PM
  Subject: [jQuery] jquery newbie test


  Please ignore. I am new to the jquery list. I am just testing my access. 
Thank you for your patience.


[jQuery] Re: jquery newbie test

2008-02-04 Thread Aaron Heimlich
Your test has succeeded!

On Feb 4, 2008 6:00 PM, CFMike [EMAIL PROTECTED] wrote:

  Please ignore. I am new to the jquery list. I am just testing my access.
 Thank you for your patience.




-- 
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com


[jQuery] Re: filter vs find

2008-02-04 Thread Jeffrey Kretz
Filter applies the current selection, while Find searches child elements.

 

$('td').filter(expr) will remove any TDs that don't match the filter
criteria.

 

$('td').find('span') will find spans inside tds.  This is functionally
similar to $('td span');

 

JK

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kynn Jones
Sent: Monday, February 04, 2008 4:04 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] filter vs find

 

Could someone explain to me the difference between filter and find.  Their
descriptions sound very similar to me.  What are the criteria to choose one
over the other?

 

TIA!

 

kynn

 



[jQuery] Re: Generating a Mousedown event programmatically - similar to click() generation..

2008-02-04 Thread edwardbaafi

Hi B,

I would think this is an important feature so the fact that you are
looking to do the same thing means I am not alone..  I'd like to
submit this as a feature but am still trying to figure out the state
of trigger's undocumented parameter fn:
http://groups.google.com/group/jquery-en/browse_thread/thread/ace02e1b78894fc2/1be5003cc4cd690c#1be5003cc4cd690c


The change is trivial but you have to change both the public trigger
function and the helper function (you'll find two trigger functions in
the jquery source)..  Because I don't know where the undocumented fn
param is used, I put my new eventsParam after that:

/* helper trigger function */
trigger: function(type, data, elem, donative, extra, eventParams) {
// Clone the incoming data, if any
data = jQuery.makeArray(data || []);

// Handle a global trigger
if ( !elem ) {
// Only trigger if we've ever bound an event for it
if ( this.global[type] )
jQuery(*).add([window, 
document]).trigger(type, data);

// Handle triggering a single element
} else {
// don't do events on text and comment nodes
if ( elem.nodeType == 3 || elem.nodeType == 8 )
return undefined;

var val, ret, fn = jQuery.isFunction( elem[ type ] || 
null ),
// Check to see if we need to provide a fake 
event, or not
event = !data[0] || !data[0].preventDefault;

// Pass along a fake event
if ( event ){
if(eventParams!=null){
eventParams.type = type;
eventParams.target= elem;
   data.unshift( this.fix(eventParams) );
}
else
   data.unshift( this.fix({ type: type,
target: elem }) );
   }
// Enforce the right trigger type
data[0].type = type;

// Trigger the event
if ( jQuery.isFunction( jQuery.data(elem, handle) ) )
val = jQuery.data(elem, handle).apply( elem, 
data );

// Handle triggering native .onfoo handlers
if ( !fn  elem[on+type]  elem[on+type].apply( 
elem, data )
=== false )
val = false;

// Extra functions don't get the custom event object
if ( event )
data.shift();

// Handle triggering of extra function
if ( extra  jQuery.isFunction( extra ) ) {
// call the extra function and tack the current 
return value on
the end for possible inspection
ret = extra.apply( elem, val == null ? data :
data.concat( val ) );
// if anything is returned, give it precedence 
and have it
overwrite the previous value
if (ret !== undefined)
val = ret;
}

// Trigger the native events (except for clicks on 
links)
if ( fn  donative !== false  val !== false  !
(jQuery.nodeName(elem, 'a')  type == click) ) {
this.triggered = true;
try {
elem[ type ]();
// prevent IE from throwing an error for some 
hidden elements
} catch (e) {}
}

this.triggered = false;
}

return val;
},


/* public trigger function*/
trigger: function( type, data, fn ,eventParams) {
return this.each(function(){
jQuery.event.trigger( type, data, this, true, 
fn,eventParams );
});
},



On Feb 4, 5:03 pm, B [EMAIL PROTECTED] wrote:
 Hi,
 I am trying to also trigger the draggable from within a javascript
 function. If possible can you please share your source hack.

 Thanks

 On Jan 29, 2:49 pm, edwardbaafi [EMAIL PROTECTED] wrote:

  http://docs.jquery.com/Eventshasmousedown, mouseup, mousemove, etc

  Yes, you are able to trigger these events using trigger( type,
  data ), but what about setting the event properties?

  In my case, when an element is draggable and it's mousedown event
  fires, the
  click function in ui.mouse.js is called..  A number of properties of
  the event, like e.which, e.target, e.srcElement, 

[jQuery] Re: Generating a Mousedown event programmatically - similar to click() generation..

2008-02-04 Thread edwardbaafi

Here's an example using the hacked source that starts dragging one
element when you click (mousedown) on another element. Notice the null
value passed as the undocumented fn parameter:

html xmlns=http://www.w3.org/1999/xhtml;head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
titleProgrammatic Draggable/title
script type=text/javascript src=../js/jquery.js/script
script type=text/javascript src=../js/jquery.ui-1.0/
jquery.dimensions.js/script
script type=text/javascript src=../js/jquery.ui-1.0/ui.mouse.js/
script
script type=text/javascript src=../js/jquery.ui-1.0/
ui.draggable.js/script
script type=text/javascript src=../js/jquery.ui-1.0/
ui.draggable.ext.js/script
script type=text/javascript

   $(document).ready(function(){

  //bind event for one fire
  $(#programmatic).one(mousedown,
  function(e){
//make draggable element draggable
$(#draggable).draggable();
//trigger a mousedown to start a drag
$(#draggable).trigger(mousedown,
[],null,{srcElement:$
(#draggable),which:e.which,pageX:e.pageX,pageY:e.pageY});
});
  });

/script
style type=text/css
#draggable{

width:100px;
height:100px;
background-color:#aa;
}
#programmatic{

width:100px;
height:100px;
background-color:#00aa00;
}
/style
/head
body
div id=draggabledraggable/div
div id=programmaticby dragging here/div
/body
/html

On Feb 4, 5:03 pm, B [EMAIL PROTECTED] wrote:
 Hi,
 I am trying to also trigger the draggable from within a javascript
 function. If possible can you please share your source hack.

 Thanks

 On Jan 29, 2:49 pm, edwardbaafi [EMAIL PROTECTED] wrote:

  http://docs.jquery.com/Eventshasmousedown, mouseup, mousemove, etc

  Yes, you are able to trigger these events using trigger( type,
  data ), but what about setting the event properties?

  In my case, when an element is draggable and it's mousedown event
  fires, the
  click function in ui.mouse.js is called..  A number of properties of
  the event, like e.which, e.target, e.srcElement, e.pageX, e.pageY are
  needed but at least some of these properties are undefined..

  Is it possible to set these properties when calling
  trigger('mousedown') or with some other unpublished way?

  Thanks,

  Ed


[jQuery] jquery newbie test

2008-02-04 Thread CFMike
Please ignore. I am new to the jquery list. I am just testing my access.
Thank you for your patience.



[jQuery] Re: copy li values to an array

2008-02-04 Thread Karl Swedberg
Oops. I forgot to take out the ul:first  part of the selector. I had  
put that in there when I was testing on a random page in Firebug, so  
you can safely take it out. Also, if your LIs just have text in them,  
you can use $(this).text() instead of $(this).html()



--Karl



On Feb 4, 2008, at 7:10 PM, Karl Swedberg wrote:


Hi Paul,

 I may have misunderstood what you were going for, but here is a  
different approach, just in case you were looking for an array like  
['abc', 'def', 'ghi']:


var txt = '', array1 = [];
$('ul:first li').each(function(i){
txt = txt + $(this).html();
if (i % 3 == 2) {
array1.push(txt);
txt = '';
}
});


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



On Feb 4, 2008, at 5:00 PM, Jonathan Sharp wrote:


Hi Paul,

This should do the trick:

$('li').each(function(i){
array1[ Math.floor( i / 3 ) ] = $(this).html();
});

Cheers,
-Jonathan


On 2/4/08, Paul Jones [EMAIL PROTECTED] wrote:

I know the following would work if I wanted to copy the values of  
*each*

li
to a separate array element.

html
head
title/title

script type = text/javascript src=jquery.js/script

script type = text/javascript
var array1 = new Array() ;
$(document).ready(function()
{
$('li').each(function(i) {  array1[i] = this.innerHTML )  })
})
/script

/head

body

ul
   lia/li
   lib/li
   lic/li

   lid/li
   lie/li
   lif/li

   lig/li
   lih/li
   lii/li
/ul

/body

/html

However, I would like like to copy the *concatenated* values of  
each group

of
3 li's to 1 array element.
(eg) the 1st array element would have a value of 'abc', the 2nd array
element would have a value of 'def', and the 3rd array element  
would have a

value of 'ghi' etc.

What is the best way to do this?

TIA







[jQuery] Re: Zebra striping in tables

2008-02-04 Thread Karl Swedberg


One way to solve your dilemma is to use tr:nth-child(even). That will  
select all table rows that are an even child of their parent  
element. This should work:


$(table tr:nth-child(even)).css(background, #cc);


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



On Feb 4, 2008, at 5:38 PM, Snef wrote:



Hi,

I know how to do some 'zebra-striping' on tables with jQ, but i have a
little problem.

I have some (unknown amount) tables om a page and I want to 'stripe'
the tables seperately, so that all striping is the same in each table.

With a simple:

$(table tr:even).css(background, #cc) the rows are counted
over all the tables and I want to start counting (for even and odd
rows) for every table, so i tought:

$(table).each(function() {
// how to get the rows here???
})

How do I do this? (I do not know on forehand how many or which tables
are on the page)




[jQuery] Re: JQuery Size YUI Compressor mod_deflate/GZIP

2008-02-04 Thread Geoff Millikan

Joel,

Wow, I had no idea that packed JavaScript had to be unpacked on each
page load!  Ouch!

So if I'm reading the data right on the JavaScript Library Performance
Test Roundup it seems as though the way to go is defiantly the Yahoo
minified script with GZIP at 131ms cached (731ms uncached).  (Note to
self: trust the Jquery folks because the Jquery homepage says to use
the minified script if you have GZIP.  Stop double testing everything
and just do what *they* say.)

Our site has only 250K visitors a month but 7.5 million hits.  It's
like 20 hits per page.  I've got to start using CSS sprites.
Ar.


[jQuery] Re: jCarousel - How do I hide the list before display

2008-02-04 Thread rich

Ah, ok. I thought you were looking to hide that quick flash of the
image list before they 'stack' up.


On Feb 4, 3:01 pm, caroig [EMAIL PROTECTED] wrote:
 Ok thank Rich - I'll give that a try - I'd hoped I could hide it all
 until it's built.

 On Feb 4, 4:23 pm, rich [EMAIL PROTECTED] wrote:

  I had this problem once before. I ended setting a fixed height on the
  parent div and setting overflow:hidden.

  -rich

  On Feb 4, 8:03 am, caroig [EMAIL PROTECTED] wrote:

   Hi,
   Is there a way of hiding the list before the carousel is fully
   generated.  I often get to see the list of images before the carousel
   effect is produced.  I've tried setting display to none in my css and
   then  executing jQuery .show after the carousel, but seems doesn't
   work well.

   many thanks


[jQuery] Re: replacement image to fade in + out again - how?

2008-02-04 Thread [EMAIL PROTECTED]

I gave up and made an animated image [shrugs].

On Feb 4, 11:17 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Me again :/

 OK, I accessibly replaced my h1 with this clunky snip:

$('h1').append('img src=\/images/headertext.gif\ alt=\alt
 text\ title=\title text\ longdesc=\http://something.com/
 fullinfo.html /');

 There's a visible lag pre-loading on this machine (220kb connection)
 so I'd appreciate advice 

 Now I want an alternative image to fade in  fade out again,
 simulating a 'glow' effect. I only want this to happen once.

 Is there a way to achieve it without putting a hidden div on top of
 the headline? I want to avoid that, if possible, because it will wreck
 my accessibility standards.

 Sorry if this should have been obvious: I've just been reading up on
 liveQuery and loQuery and am about to check my brain into a repair
 shop!!

 Cherry.


[jQuery] dynamic classes

2008-02-04 Thread jg

I'm trying to trigger a form to show below a given comment in a list
of comments but because I'm using a collection, the classes need to be
dynamic. I'm not sure how to target a given comment. Right now, when I
click on any of the buttons, the forms show for all the comments.

Hope that makes sense. Any thoughts?

Thanks.


[jQuery] Re: how to bind one action to multiple events?

2008-02-04 Thread [EMAIL PROTECTED]

Update: A more accessible hover function.
I did my homework, then did this:

// a more accessible hover function
jQuery.fn.extend({
hover: function(fnOver, fnOut) {
return this.bind('mouseenter mouseover focus',
fnOver).bind('mouseleave mouseout blur', fnOut);
}
});

(Works with the built-in .hover event). Only tested in IE7 and
FF2.0.0.11

Cherry.

  On Feb 4, 7:31 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
  wrote:
   Trying to do a simple a: rollover - but, being a perfectionist, I want
   the rollover behaviour triggered by mouseover OR focus. And then, of
   course, on mouseout OR blur.


  1   2   >