[jQuery] Re: trigger "$(document).ready" manually

2007-05-29 Thread MathiasBank

Ok, it's quite easy to recall ready:

Don't register your ready functions like this:

$(document).ready(...);

Register it like this:

$(document).bind("ready",...);

Now, trigger the ready event:

$(document).trigger("ready");

This works. I think, it's a bit confusing, because $(document).ready
is an event (at least in the api). So, I expect, that it can be called
like an event.

Mathias



[jQuery] Re: trigger "$(document).ready" manually

2007-05-29 Thread MathiasBank

Well, I have an ajax call to the server. The sever decides what to do.
Normally, there is just one small part of the page, which will be
changed per json. But there is one possibility, which needs to refresh
nearly the complete page. No I have to recall ready. There are three
possibilites:

1. I can send a special state which will reload the complete page.
This method is stupid, because I need an additional server request (I
can send the data with the first response).
2. I can write a special function, which will be called in $
(ducument).ready(). But this is just a workaround
3. ready can be called. I think, that's the most obvious way, the
problem can be solved. And it is the easiest. If it is not possible
yet, it's a feature request ;)

Mathias



[jQuery] Re: tableFilter Beta 2 is now live

2007-05-29 Thread Daemach

I posted a zip this evening that contains the source code and support
files for tableFilter.  You can find it here:

http://ideamill.synaptrixgroup.com/?p=17



On May 29, 11:30 am, Daemach <[EMAIL PROTECTED]> wrote:
> The short answer is absolutely.  If you're not in a serious rush I
> would appreciate you giving me a day to let me get the code cleaned up
> - I decided to rebuild my domain over the weekend, so I'm still coming
> up to speed.  There is a lot of cruft there now from trial-and-
> erroring IE performance improvements and I would rather you not have
> to fight through all of that.
>
> On May 28, 10:52 am, "Michael Haggerty" <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to get a straight up download oftableFilter? I realize it is
> > in beta but would like to use what's there now in an internal project. I
> > have tried pulling scripts out of the demo page, but the scripts are
> > erroring out when I try to put them in my project. Using jquery 1.1.2.
>
> > Thank you,
> > Michael Haggerty
> > Managing Partner
> > Trellon, LLChttp://www.trellon.com
> > (p) 301-577-6162
> > (c) 240-643-6561
> > (f) 413-691-9114
> > (aim) haggerty321
>
> > > -Original Message-
> > > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> > > Behalf Of Daemach
> > > Sent: Friday, May 18, 2007 3:32 PM
> > > To: jQuery (English)
> > > Subject: [jQuery]tableFilterBeta 2 is now live
>
> > > For those of you who are interested, I just uploaded another beta of
> > > mytableFilterplugin.  New features include performance improvements,
> > > saving (some..more later) settings in a cookie, support for plugins,
> > > and an increased number of "I hate IE" comments in the code.
>
> > > I did two plugins to test the architecture - one is called
> > > "Aggregator", creatively enough, and it automatically aggregates data
> > > for numeric columns based on your filters.  (sum/avg/min/max)
>
> > > The second is called "ColumnStyles" which is the best I could come up
> > > with at the time.  It allows you to apply CSS styles to entire columns
> > > instantly.  bold, italic, underline, and alignment at the moment.
> > > Again, these were proof-of-concepts, so they aren't that cool yet.
>
> > > For those of you that haven't heard of this plugin, it allows you to
> > > do automatic paging, and sorting/filtering on multiple table columns
> > > simultaneously.  All of this with one line of code: $
> > > ('table').tableFilter();
>
> > > More info and demos here:  http://ideamill.synaptrixgroup.com/?p=13
>
> > > (plugins are disabled by default - enable them using the menu in the
> > > bottom row...)



[jQuery] jQuery featured POTM

2007-05-29 Thread Larry Garfield

Please forgive the self-advertisement, but I just wanted to share that I've 
added jQuery to the list of featured projects I've been coordinating this 
year:

http://www.garfieldtech.com/blog/potm-jquery

For the rest of the featured projects, see here:

http://www.garfieldtech.com/potm
http://www.garfieldtech.com/blog/project-of-the-month

Thanks John and everyone for an awesome project!

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


[jQuery] Re: Finding first text element

2007-05-29 Thread RobG



On May 30, 5:48 am, DaveG <[EMAIL PROTECTED]> wrote:
> How do I find the first text-node of a given DOM object?
>
> Input: here is some text
> Output: " some text"
>
> Input: Header 1
> Output: "Header 1"

I'm not sure what you are really after.  If you are after the text
content of an element, then something like the following will do the
trick:

 function getText(el) {
   if (typeof el.textContent == 'string') return el.textContent;
   if (typeof el.innerHTML == 'string') return el.innerHTML;
 }

However, if you really are after the first text node that is child of
the element, loop over the child nodes:

 function getFirstTextNode(el) {
   var kids = el.childNodes;
   for (var i=0, len=kids.length; i

[jQuery] Dragging from a Drupal block to tinyMCE

2007-05-29 Thread Phil Glatz

I'm using Drupal 5.1 and jquery to build a site where members can
create content. I wrote a module to display a list of available images
and videos in a list in a block. I'd like to be able to select an item
from the list and drag it into the article body textarea, and
wondering if this can be done without modification of core Dupal
functions. If drag&drop is not possible, could this be done by
selecting an item and clicking in the textarea?

I'd appreciate any example or tutorials on how this could be done.
thanks



[jQuery] Re: getting DOM values

2007-05-29 Thread Brandon Aaron


Here are the docs for .get( Number )
http://jquery.bassistance.de/api-browser/#getNumber

--
Brandon Aaron

On 5/29/07, pd <[EMAIL PROTECTED]> wrote:


Thanks guys, super-fast reply :)

Is this documented anywhere? I've scanned through the API and didn't
see anything for what seems to be a pretty fundamental requirement
from a JS library, don't you think?

I understand if people haven't had the time to include this in the
doco though.




[jQuery] Re: getting DOM values

2007-05-29 Thread pd

Thanks guys, super-fast reply :)

Is this documented anywhere? I've scanned through the API and didn't
see anything for what seems to be a pretty fundamental requirement
from a JS library, don't you think?

I understand if people haven't had the time to include this in the
doco though.



[jQuery] Re: getting DOM values

2007-05-29 Thread Brandon Aaron


You can access the regular dom properties/methods by extracting the
element from the jQuery collection.

$('#foo').get(0).clientWidth

You can also just use bracket notation.

$('#foo')[0].clientWidth

You could also use the Dimensions plugin which helps abstract some
cross browser issues with widths, heights and offsets.
http://jquery.com/plugins/project/dimensions

--
Brandon Aaron

On 5/29/07, pd <[EMAIL PROTECTED]> wrote:



Hi

BjQ (before jQuery) I can do this:

document.getElementById('foo').clientWidth

to get a DOM value that Firebug tells me is set to something other
than 'undefined'.

I can't figure out how to the do same in AjQ (after jQuery). I've
tried the following:

$('#foo').attr('clientWidth')

but keep getting undefined.

Am I trying the wrong syntax? If so, what syntax will achieve the
results I'm after?




[jQuery] Re: getting DOM values

2007-05-29 Thread Ⓙⓐⓚⓔ

$('#foo')[0].clientWidth

On 5/29/07, pd <[EMAIL PROTECTED]> wrote:




Hi

BjQ (before jQuery) I can do this:

document.getElementById('foo').clientWidth

to get a DOM value that Firebug tells me is set to something other
than 'undefined'.

I can't figure out how to the do same in AjQ (after jQuery). I've
tried the following:

$('#foo').attr('clientWidth')

but keep getting undefined.

Am I trying the wrong syntax? If so, what syntax will achieve the
results I'm after?





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] getting DOM values

2007-05-29 Thread pd


Hi

BjQ (before jQuery) I can do this:

document.getElementById('foo').clientWidth

to get a DOM value that Firebug tells me is set to something other
than 'undefined'.

I can't figure out how to the do same in AjQ (after jQuery). I've
tried the following:

$('#foo').attr('clientWidth')

but keep getting undefined.

Am I trying the wrong syntax? If so, what syntax will achieve the
results I'm after?



[jQuery] Re: jQuery on Rails-related

2007-05-29 Thread DaveG


Is there a post which has more details somewhere?

Yehuda Katz wrote:

Hey guys,

Great news! Hpricot has accepted my patches to make hpricot compatible 
with jQuery, which means you'll only need to checkout the latest hpricot 
from svn to use jQuery on Rails.


--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325


[jQuery] Re: Finding first text element

2007-05-29 Thread Ⓙⓐⓚⓔ

tested.

http://www.w3.org/1999/xhtml"; xml:lang="en">
   
   
   plainText()
   
   
   
   
   $(function(){
   $("div,h1").each(function(){
   alert ($(this).plainText().join(""))
   })
   });
   
   
   
   here is some text
   niceHeader 1
   




On 5/29/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:


something like this (untested) returns an array of all the plain text
nodes in a jQuery object.

jQuery.fn.plainText = function() {
var text=[];
this.each(function(){
var children =this.childNodes;
for (var i = 0; i < children.length; i++){
var child = children[i];
if (child.nodeType == 3)
  text[text.length] = $.trim(child.nodeValue);
}
})
return text;
};


On 5/29/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:
>
> Dave, I was shocked when you got the first answer. I don't think there
> is any way to get just the text using jQuery core functions.
>
> If you get .html() you can use regexps to remove the complete nodes, it
> seems messy.
>
> if you write a plugin (there may already be one) it can go thru the dom
> nodes and return the concatenation of the simple text nodes.
>
> jQuery likes to shield us from the nastiness of the real dom objects and
> incompatibilities of lesser browser.
>
>
>
> On 5/29/07, DaveG < [EMAIL PROTECTED]> wrote:
> >
> >
> >
> > I didn't find a way to do this yet, but I did discover a way to crash
> > my browser:
> >
> > Warning: locks up FF2
> >Input: here is some text
> >jQ: $("#id1<").text()
> >
> > I also discovered a way to get the text of the first element:
> >Input: here is some text
> >jQ: $("#id1>").text()
> >Output: "here is"
> >
> > ~ ~ Dave
> >
> > On Tue, 29 May 2007 15:48:30 -0400, DaveG <[EMAIL PROTECTED]>
> > wrote:
> > >
> > >
> > > How do I find the first text-node of a given DOM object?
> > >
> > > Input: here is some text
> > > Output: " some text"
> > >
> > > Input: Header 1
> > > Output: "Header 1"
> > >
> > >  ~ ~ Dave
> >
> >
>
>
> --
> Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ




--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: .load issue with IE7

2007-05-29 Thread Wizzud


Have you tried putting the second load into the callback of the first load?
eg.
$(document).ready(function(){
   $("div#payments").load('account_rec_load.html',function(){
  $("div#paytotal").load("payment_total_load.html");
   });



John W wrote:
> 
> 
> Ok so I have payment page.  When the page loads I fill in a list of
> payments within a div using .load, and within the page being loaded in
> the div, I have another .load that feeds in a total box. This all
> works great in FF2, but for some reason in IE7 the paybox doesnt not
> display.
> 
> So in the main page I load the list page using .load like so and it
> works fine in both IE7 and FF2.
> 
> 
> $(document).ready(function(){
>$("div#payments").load('account_rec_load.html',function(){
>return false;
>});
> });
> 
> 
> Then in the 'account_rec_load.html' page I have a similiar load
> function that just loads in a totals box using .load as well. This
> works in FF but not IE7. I'm assuming its because the ajax loaded page
> isnt actually being seen as loaded in IE7? Sorry Im not quite the
> javascript guru. Any ideas why IE7 is treating this differently.
> 
> $(document).ready(function(){
>$("div#paytotal").load("payment_total_load.html",function(){
>return false;
>});
> });
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/.load-issue-with-IE7-tf3833063s15494.html#a10865399
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Metadata plugin

2007-05-29 Thread Will Arp


Hi all, any idea?
thank you!
-will

On 29-mag-07, at 06:51:07, Will Arp wrote:



having an issue with svn metadata plugin if compressed with
packer 3.0 beta 8 or beta 9. code below will return undefined,
works fine with uncompressed version.

This is a p

$.meta.setType("attr", "data");
alert( $("#one").eq(0).item_label );


thank you, have a great day!
-will


[jQuery] Re: .parents(expr)

2007-05-29 Thread Wizzud


parents(expr) is equivalent to parents().filter(expr)


SamCKayak wrote:
> 
> 
> I could do a test, but discussion seemed like it might turn up
> something else...
> 
> .parents(expr) supports an expression to filter parent elements,
> e.g.,
> 
> .parents('.getme') // returns all parents with class getme
> 
> the $(expr) in general allows any css (or xml) selector.  Does expr
> extend this way in parent(expr) to retrieve  all  children under a
> parent? e.g.,
> 
> .parents('.getme > li')
> 
> as a shortcut for
> 
> .parents('.getme').children('li')
> 
> Sam
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/.parents%28expr%29-tf3834650s15494.html#a10865050
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: jQuery on Rails-related

2007-05-29 Thread Alex Brem

Hey Yehuda,

that's really great news! :)

Many thanks!

Alex


Yehuda Katz wrote:
> Hey guys,
> 
> Great news! Hpricot has accepted my patches to make hpricot compatible with
> jQuery, which means you'll only need to checkout the latest hpricot from
> svn
> to use jQuery on Rails.
> 


[jQuery] menuing recommendation?

2007-05-29 Thread Jack Killpatrick


Hi All,

I'm looking for a jquery based menuing plugin ala:

http://jdsharp.us/jQuery/plugins/jdMenu/

It has to be able to do the following:

1. allow on/off images for top level menu items: either background 
images or both foreground and background images (for typeset foregrounds)


2. have a means to style the "current" (currently selected) top level 
menu item, also allowing images (back/fore). I can hack up something for 
"current" items, but it'd be nice if it was natively supported. Must 
allow images, though.


3. work in ie6+, ff 1.x+, safari: including hovers and SELECT (see 
through) blocking


Does such a critter exist?

TIA,
Jack



[jQuery] Re: Forcing a select box to "select" a specified option

2007-05-29 Thread Dan G. Switzer, II

Andy,

>$('#RedMakeSelect:first-child [EMAIL PROTECTED]')

I believe IE always has the value attribute defined--even if it's not
defined in your markup (ie. it essentially adds a value="" to your tag.) If
you know the 2nd element should have a value attribute if it's present, then
I'd just do:

$('#RedMakeSelect:first-child option:nth-child(1)')

-Dan



[jQuery] Re: Finding first text element

2007-05-29 Thread Ⓙⓐⓚⓔ

Dave, I was shocked when you got the first answer. I don't think there is
any way to get just the text using jQuery core functions.

If you get .html() you can use regexps to remove the complete nodes, it
seems messy.

if you write a plugin (there may already be one) it can go thru the dom
nodes and return the concatenation of the simple text nodes.

jQuery likes to shield us from the nastiness of the real dom objects and
incompatibilities of lesser browser.



On 5/29/07, DaveG <[EMAIL PROTECTED]> wrote:




I didn't find a way to do this yet, but I did discover a way to crash my
browser:

Warning: locks up FF2
   Input: here is some text
   jQ: $("#id1<").text()

I also discovered a way to get the text of the first element:
   Input: here is some text
   jQ: $("#id1>").text()
   Output: "here is"

~ ~ Dave

On Tue, 29 May 2007 15:48:30 -0400, DaveG <[EMAIL PROTECTED]> wrote:
>
>
> How do I find the first text-node of a given DOM object?
>
> Input: here is some text
> Output: " some text"
>
> Input: Header 1
> Output: "Header 1"
>
>  ~ ~ Dave





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: Forcing a select box to "select" a specified option

2007-05-29 Thread Jeffrey Kretz
I've done it this way:

 

$('#selectid')[0].options[1].selected = true;

 

JK

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Andy Matthews
Sent: Tuesday, May 29, 2007 2:46 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Forcing a select box to "select" a specified option

 

I'm doing a related select dropdown here (bottom middle of the page):

http://w3.normreeveshonda.com/pages/page.cfm?pageid=80976
 &pagetype=26&featureid=-1

 

In FF, under New vehicles, the Make dropdown defaults to HONDA as desired.
In IE though, it stays on "select a make". Here's the code that I'm passing
back to the page for that select box:

 

select a makeHONDA

 

Ideally, I'd just do this:

select a makeHONDA

 

but that doesn't work for some odd reason. So I'd like to default it to the
first dropdown that has a value attribute. How would I go about that?

 

$('#RedMakeSelect:first-child [EMAIL PROTECTED]')

 

or something like that?



 

Andy Matthews
Senior Coldfusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249

[EMAIL PROTECTED]
www.dealerskins.com  

 

<>

[jQuery] Forcing a select box to "select" a specified option

2007-05-29 Thread Andy Matthews
I'm doing a related select dropdown here (bottom middle of the page):
http://w3.normreeveshonda.com/pages/page.cfm?pageid=80976
 &pagetype=26&featureid=-1
 
In FF, under New vehicles, the Make dropdown defaults to HONDA as desired.
In IE though, it stays on "select a make". Here's the code that I'm passing
back to the page for that select box:
 
select a makeHONDA
 
Ideally, I'd just do this:
select a makeHONDA
 
but that doesn't work for some odd reason. So I'd like to default it to the
first dropdown that has a value attribute. How would I go about that?
 
$('#RedMakeSelect:first-child [EMAIL PROTECTED]')
 
or something like that?

 
Andy Matthews
Senior Coldfusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249
[EMAIL PROTECTED]
www.dealerskins.com  
 
<>

[jQuery] Help with form plugin and tabs in a same page

2007-05-29 Thread Web Specialist

Hi all

I have a very basic form with Jorn Form Validation and Tabs plugins inside.
Looks very simple like:


   
   
   Personal data
   Family data
   Professional data
   References
   
   
. form content for personal data

and so on...


Is it possible after validation to change the color for tabs title when
occurs any error inside? For example:

- user fills family data and after submit that form occurs an error based in
Family data. I'll want to change that Family data(tabs title) to red.

What do you think about? How to know the error context and tab context?

Cheers


[jQuery] Re: trigger "$(document).ready" manually

2007-05-29 Thread Ⓙⓐⓚⓔ

don't use an anonymous function with ready. use a named one, and then just
call it again (and again).

On 5/29/07, Brandon Aaron <[EMAIL PROTECTED]> wrote:



ready() is just a special method that handles the DOM Ready event. I
can't think of a use-case where one would need to force the call to
ready but you can do so by calling jQuery.ready(). Once the function
runs, it won't run again.

I'm not sure what, if any, the consequences of doing this are. Perhaps
the problem can be solved in a better way?

--
Brandon Aaron

On 5/29/07, MathiasBank <[EMAIL PROTECTED]> wrote:
>
> Good evening,
>
> It is possible to call
>
> 1. $('#field').trigger("click");
> 2. $(document).trigger("myOwnEvent");
>
> But it seems, that this is not possible to call
>
> $(ducument).trigger("ready");
>
> Is "ready" not an event? (Yes, I mean ready from $
> (document).ready(function() {...})). I need to recall this event,
> because I have changed a big part of my page.
>
> Mathias
>
>





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: trigger "$(document).ready" manually

2007-05-29 Thread Sean Catchpole


Mathias,

The solution is simplier than it seems.

function foo(){...}

$(document).ready(foo);

//someplace where you want to call the document.ready again
foo();

By wrapping the code that you want to call from document.ready inside
a function it is easy to call again at any time.

Of course if you don't have control of all the code that runs at
document.ready, then we must become more clever in our solution, but
hopefully that is not the case.

~Sean


[jQuery] Re: Finding first text element

2007-05-29 Thread Sean Catchpole


I'm writing this off the top of my head, but it should be at least
close to functional.

jQ: $("#id1").children().filter(function(){return
$(this).text()!="";}).filter(":eq(0)").text()


Or if you intend to use this a lot, you could write a small plugin:
(function($){
$.fn.textNode(index){
 index = index || 0;
 return this.children().filter(function(){return
$(this).text()!="";}).filter(":eq("+index+")").text();
})(jQuery);

jQ: $("#id1").textNode(); //same as $("id1").textNode(0);

~Sean


[jQuery] Re: Finding first text element

2007-05-29 Thread Ⓙⓐⓚⓔ

something like this (untested) returns an array of all the plain text nodes
in a jQuery object.

jQuery.fn.plainText = function() {
   var text=[];
   this.each(function(){
   var children =this.childNodes;
   for (var i = 0; i < children.length; i++){
   var child = children[i];
   if (child.nodeType == 3)
 text[text.length] = $.trim(child.nodeValue);
   }
   })
   return text;
};


On 5/29/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:


Dave, I was shocked when you got the first answer. I don't think there is
any way to get just the text using jQuery core functions.

If you get .html() you can use regexps to remove the complete nodes, it
seems messy.

if you write a plugin (there may already be one) it can go thru the dom
nodes and return the concatenation of the simple text nodes.

jQuery likes to shield us from the nastiness of the real dom objects and
incompatibilities of lesser browser.



On 5/29/07, DaveG <[EMAIL PROTECTED]> wrote:
>
>
>
> I didn't find a way to do this yet, but I did discover a way to crash my
> browser:
>
> Warning: locks up FF2
>Input: here is some text
>jQ: $("#id1<").text()
>
> I also discovered a way to get the text of the first element:
>Input: here is some text
>jQ: $("#id1>").text()
>Output: "here is"
>
> ~ ~ Dave
>
> On Tue, 29 May 2007 15:48:30 -0400, DaveG <[EMAIL PROTECTED]> wrote:
> >
> >
> > How do I find the first text-node of a given DOM object?
> >
> > Input: here is some text
> > Output: " some text"
> >
> > Input: Header 1
> > Output: "Header 1"
> >
> >  ~ ~ Dave
>
>


--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: trigger "$(document).ready" manually

2007-05-29 Thread Brandon Aaron


ready() is just a special method that handles the DOM Ready event. I
can't think of a use-case where one would need to force the call to
ready but you can do so by calling jQuery.ready(). Once the function
runs, it won't run again.

I'm not sure what, if any, the consequences of doing this are. Perhaps
the problem can be solved in a better way?

--
Brandon Aaron

On 5/29/07, MathiasBank <[EMAIL PROTECTED]> wrote:


Good evening,

It is possible to call

1. $('#field').trigger("click");
2. $(document).trigger("myOwnEvent");

But it seems, that this is not possible to call

$(ducument).trigger("ready");

Is "ready" not an event? (Yes, I mean ready from $
(document).ready(function() {...})). I need to recall this event,
because I have changed a big part of my page.

Mathias




[jQuery] Re: object detection in jQuery

2007-05-29 Thread besh

> One of the great things about jQuery, however, is the basic concept.
> If it doesn't find the element it doesn't do anything so there is no
> need for conditional logic ;)

That's really great, thanks for making it clear for me...jQuery is
goodness, the more I know it, the more I love it :)

Bohdan

On May 29, 9:32 pm, Daemach <[EMAIL PROTECTED]> wrote:
> You can use a selector such as $('#myElem') to get an element by ID.  $
> ('#myElem').size() gives you the size of the matched set - you can use
> that in an if statement if you want.
>
> One of the great things about jQuery, however, is the basic concept.
> If it doesn't find the element it doesn't do anything so there is no
> need for conditional logic ;)
>
> On May 29, 12:22 pm, besh <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> > before jQuery, I was used to check for existence of certain elements
> > like this:
>
> > if (!document.getElementById('myElem')) {
> >   return false;
>
> > } else {
> >   doSomething();
> > }
>
> > Is there some jQuery way of doing this, or should I use the old DOM
> > one?
>
> > Thanks!
>
> > Bohdan



[jQuery] trigger "$(document).ready" manually

2007-05-29 Thread MathiasBank

Good evening,

It is possible to call

1. $('#field').trigger("click");
2. $(document).trigger("myOwnEvent");

But it seems, that this is not possible to call

$(ducument).trigger("ready");

Is "ready" not an event? (Yes, I mean ready from $
(document).ready(function() {...})). I need to recall this event,
because I have changed a big part of my page.

Mathias



[jQuery] Re: Finding first text element

2007-05-29 Thread DaveG


I didn't find a way to do this yet, but I did discover a way to crash my 
browser:

Warning: locks up FF2
   Input: here is some text
   jQ: $("#id1<").text()

I also discovered a way to get the text of the first element:
   Input: here is some text
   jQ: $("#id1>").text()
   Output: "here is"

 ~ ~ Dave

On Tue, 29 May 2007 15:48:30 -0400, DaveG <[EMAIL PROTECTED]> wrote:
> 
> 
> How do I find the first text-node of a given DOM object?
> 
> Input: here is some text
> Output: " some text"
> 
> Input: Header 1
> Output: "Header 1"
> 
>  ~ ~ Dave



[jQuery] Re: Finding first text element

2007-05-29 Thread DaveG


Actually, I withdraw that. .text() returns the text of all nodes combined (in 
example 1: "here is some text").

 ~ ~ Dave

On Tue, 29 May 2007 15:57:55 -0400, DaveG <[EMAIL PROTECTED]> wrote:
> 
> 
> Indeed it is, thanks. I worked that out after posting -- I figured it had
> to be something incredibly complicated ;)
> 
>  ~ ~ Dave
> 
> 
> On Tue, 29 May 2007 14:56:58 -0500, "Jonathan Sharp" <[EMAIL PROTECTED]>
> wrote:
>> I believe it's something like $('div').text();
>>
>> -js
>>
>>
>> On 5/29/07, DaveG <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>
>>> How do I find the first text-node of a given DOM object?
>>>
>>> Input: here is some text
>>> Output: " some text"
>>>
>>> Input: Header 1
>>> Output: "Header 1"
>>>
>>> ~ ~ Dave
>>>
>>>
>>
>>



[jQuery] Re: Dev and plugins lists

2007-05-29 Thread Brandon Aaron


No I believe they are in the process of being transitioned to Google
Groups. Feel free the post anything to this list for now.

--
Brandon Aaron

On 5/29/07, Mika Tuupola <[EMAIL PROTECTED]> wrote:


Are the dev and plugins lists up at the moment?

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






[jQuery] Re: Finding first text element

2007-05-29 Thread DaveG


Indeed it is, thanks. I worked that out after posting -- I figured it had to be 
something incredibly complicated ;)

 ~ ~ Dave


On Tue, 29 May 2007 14:56:58 -0500, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> I believe it's something like $('div').text();
> 
> -js
> 
> 
> On 5/29/07, DaveG <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> How do I find the first text-node of a given DOM object?
>>
>> Input: here is some text
>> Output: " some text"
>>
>> Input: Header 1
>> Output: "Header 1"
>>
>> ~ ~ Dave
>>
>>
> 
> 



[jQuery] Re: Finding first text element

2007-05-29 Thread Jonathan Sharp

I believe it's something like $('div').text();

-js


On 5/29/07, DaveG <[EMAIL PROTECTED]> wrote:




How do I find the first text-node of a given DOM object?

Input: here is some text
Output: " some text"

Input: Header 1
Output: "Header 1"

~ ~ Dave




[jQuery] Finding first text element

2007-05-29 Thread DaveG


How do I find the first text-node of a given DOM object?

Input: here is some text
Output: " some text"

Input: Header 1
Output: "Header 1"

 ~ ~ Dave



[jQuery] Re: jQuery on Rails-related

2007-05-29 Thread Matt Stith

Its a mod of Ruby On Rails that replaces the default Prototype/Scriptaculus
with jQuery.

On 5/29/07, Daemach <[EMAIL PROTECTED]> wrote:



What is jQuery on Rails?  ;)

On May 29, 9:52 am, "Yehuda Katz" <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> Great news! Hpricot has accepted my patches to make hpricot compatible
with
> jQuery, which means you'll only need to checkout the latest hpricot from
svn
> to use jQuery on Rails.
>
> --
> Yehuda Katz
> Web Developer | Wycats Designs
> (ph)  718.877.1325




[jQuery] Re: .parents(expr)

2007-05-29 Thread Sean Catchpole


It would appear that you idea does not work.

Just as a note about testing. Open any jQuery page and Firebug, and
viola, you have little playground to try quick jQuery lines.

~Sean

P.S. I wrote a plugin to find jQuery pages: http://www.sunsean.com/jquerydetect/


[jQuery] Dev and plugins lists

2007-05-29 Thread Mika Tuupola


Are the dev and plugins lists up at the moment?

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





[jQuery] Re: object detection in jQuery

2007-05-29 Thread Sean Catchpole


Hi Bohdan,


Is there some jQuery way of doing this, or should I use the old DOM
one?


You bet, try this (or something similar):
if( $('#myElem').length > 0 )doSomething();
else return false;

~Sean


[jQuery] Re: object detection in jQuery

2007-05-29 Thread Daemach

You can use a selector such as $('#myElem') to get an element by ID.  $
('#myElem').size() gives you the size of the matched set - you can use
that in an if statement if you want.

One of the great things about jQuery, however, is the basic concept.
If it doesn't find the element it doesn't do anything so there is no
need for conditional logic ;)

On May 29, 12:22 pm, besh <[EMAIL PROTECTED]> wrote:
> Hi all,
> before jQuery, I was used to check for existence of certain elements
> like this:
>
> if (!document.getElementById('myElem')) {
>   return false;
>
> } else {
>   doSomething();
> }
>
> Is there some jQuery way of doing this, or should I use the old DOM
> one?
>
> Thanks!
>
> Bohdan



[jQuery] Re: jQuery on Rails-related

2007-05-29 Thread Daemach

What is jQuery on Rails?  ;)

On May 29, 9:52 am, "Yehuda Katz" <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> Great news! Hpricot has accepted my patches to make hpricot compatible with
> jQuery, which means you'll only need to checkout the latest hpricot from svn
> to use jQuery on Rails.
>
> --
> Yehuda Katz
> Web Developer | Wycats Designs
> (ph)  718.877.1325



[jQuery] object detection in jQuery

2007-05-29 Thread besh

Hi all,
before jQuery, I was used to check for existence of certain elements
like this:

if (!document.getElementById('myElem')) {
  return false;
} else {
  doSomething();
}

Is there some jQuery way of doing this, or should I use the old DOM
one?

Thanks!

Bohdan



[jQuery] Re: jQuery'zed Ext.Template

2007-05-29 Thread Rodrigo Moraes


Hi,
Sorry to reply to myself. :)
I've updated the Template plugin to use $.extend() in a new
$.extendClass() function. This is probably Javascript 101, but I
couldn't go ahead from this point. If somebody can point me an example
of a extended class/constructor/prototype in jQuery, maybe I can take
a look and try to follow it.

I know how to override a class prototype using $.extend(), but not how
to provide a inheritance mechanism so a class can, for example, call
its parent constructor. Well, I saw some mechanisms like
YAHOO.extend() or Ext.extend(), but I would like to make the plugin as
jQuery'zed as I can, so any help would be appreciated.

Here's the updated code:

http://dev.tipos.org/browser/javascript/jquery/template/jquery.template.js?format=txt

thanks,
-- rodrigo


[jQuery] Re: Help Test jQuery 1.1.3

2007-05-29 Thread Brian Cherne

Hi John, I quickly tested jQuery 1.1.3a with my jVariations plug-in and it
crashed Safari (immediately). I'm going to take a look into it this week and
will hopefully be able to provide more information. The page I was testing
it on was quite complex and Safari was already struggling (taking a few
seconds to update) with jQuery 1.1.2... so I'm hoping it's just bad/sloppy
code on my end. Firefox and WinIE6/7 had no performance problems.

There's a lot going on in that little plug-in, so it's hard to tell exactly
where it's failing in Safari. Is there a list of what's changed in jQuery
1.1.3a ? Has anyone run into Safari-specific performance issues?

The code that is killing Safari is for a client project, so I cannot share
it at this time. I'll try to simplify the code for testing, remove all
client-specific references, and share my findings with the list (and enter a
ticket if necessary).

My other plug-in, hoverIntent, showed no problems with 1.1.3a in my limited
testing.

Brian.

On 5/25/07, Volker Mische <[EMAIL PROTECTED]> wrote:



Hi,

> > I have to admit that I haven't found a faster solution.
> > removeAttribute() just takes to much time. So perhaps the serializer
> > should be "fixed". This would mean a slow down for Internet Explorer
> > on html(), but this seems ok for me, as this is a Internet Explorer
> > bug.
>
> That's absolutely a possibility - could you add that as a comment to
> the bug? I could definitely work with that as a valid solution.

I've added a patch for this at the ticket. In my tests it wasn't as
slow as I expected it to be.

Cu,
  Volker.




[jQuery] Re: tableFilter Beta 2 is now live

2007-05-29 Thread Daemach

The short answer is absolutely.  If you're not in a serious rush I
would appreciate you giving me a day to let me get the code cleaned up
- I decided to rebuild my domain over the weekend, so I'm still coming
up to speed.  There is a lot of cruft there now from trial-and-
erroring IE performance improvements and I would rather you not have
to fight through all of that.

On May 28, 10:52 am, "Michael Haggerty" <[EMAIL PROTECTED]> wrote:
> Is there a way to get a straight up download oftableFilter? I realize it is
> in beta but would like to use what's there now in an internal project. I
> have tried pulling scripts out of the demo page, but the scripts are
> erroring out when I try to put them in my project. Using jquery 1.1.2.
>
> Thank you,
> Michael Haggerty
> Managing Partner
> Trellon, LLChttp://www.trellon.com
> (p) 301-577-6162
> (c) 240-643-6561
> (f) 413-691-9114
> (aim) haggerty321
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> > Behalf Of Daemach
> > Sent: Friday, May 18, 2007 3:32 PM
> > To: jQuery (English)
> > Subject: [jQuery]tableFilterBeta 2 is now live
>
> > For those of you who are interested, I just uploaded another beta of
> > mytableFilterplugin.  New features include performance improvements,
> > saving (some..more later) settings in a cookie, support for plugins,
> > and an increased number of "I hate IE" comments in the code.
>
> > I did two plugins to test the architecture - one is called
> > "Aggregator", creatively enough, and it automatically aggregates data
> > for numeric columns based on your filters.  (sum/avg/min/max)
>
> > The second is called "ColumnStyles" which is the best I could come up
> > with at the time.  It allows you to apply CSS styles to entire columns
> > instantly.  bold, italic, underline, and alignment at the moment.
> > Again, these were proof-of-concepts, so they aren't that cool yet.
>
> > For those of you that haven't heard of this plugin, it allows you to
> > do automatic paging, and sorting/filtering on multiple table columns
> > simultaneously.  All of this with one line of code: $
> > ('table').tableFilter();
>
> > More info and demos here:  http://ideamill.synaptrixgroup.com/?p=13
>
> > (plugins are disabled by default - enable them using the menu in the
> > bottom row...)



[jQuery] Re: Select box change event infinite loop in ASP.NET

2007-05-29 Thread Mike Chabot


The error was caused by using a $ instead of a # in the selector string.

-Mike

On 5/24/07, Roger Roelofs <[EMAIL PROTECTED]> wrote:


Mike,

On May 22, 2007, at 1:17 PM, Mike Chabot wrote:

> I have a simple function to capture the OnChange event of a drop-down
> select box. In MSIE, it works as expected, but Firefox gets caught in
> an infinite loop. Has anyone else seen this problem? I have a counter
> to track the problem. In MSIE, the counter goes up by 1 for every
> change. In Firefox, the counter jumps by 21 with every change. I guess
> 21 is some recursive limit inside of Firefox.
>
> jQuery 1.1.2 and ASP.NET 2.0.
>
> var count=0;
> $(document).ready(function() {
>   var selectBox = "$<%= Me.FormView1.ClientId %>_ddlTestList";
>   $(selectBox).change(
>   function() {
> count = count + 1;
> $("#countId").text("count: " + count);
>   }
>   );
> });

Are you using your scroll wheel or arrow keys to select from the
menu?  I've noticed that ie doesn't fire the change event until you
tab out of the select while firefox fires the onchange event every
time you make a new selection (at least on my mac)  You can save
yourself a lot of debugging time by using the firebug firefox extension.

hth

Roger,
--
Roger Roelofs
[EMAIL PROTECTED]






[jQuery] Re: index of an element

2007-05-29 Thread Sean Catchpole



I'm trying to get this working:
jQuery('#accordion [EMAIL PROTECTED]').click(function(){
   var rank = jQuery('#accordion
p').index(function(){jQuery(this).parent('p').eq(0)});
});


I'm not sure why you would want to do this, but the following should
get the effect your desire.

jQuery('#accordion [EMAIL PROTECTED]').click(function(){
 var parent = this.parentNode;
 var rank = jQuery('#accordion p').index(parent);
});


~Sean


[jQuery] Re: Block UI when user submits a slow page

2007-05-29 Thread Jonathan Sharp

You can't block across requests. You may achieve your desired effect if your
page is within an iframe and the blockui is in the parent document.

In short you can block when the user clicks submit but at an arbitrary point
in time the browser will clear the screen as it receives the response. So
there isn't really a way to do what you want.

Cheers,
-js


On 5/29/07, Web Specialist <[EMAIL PROTECTED]> wrote:


Hi all

do you know any example using BlockUI with "normal" form(otherwise Ajax)?

I have a very slow form(processing text files). I'll want to block UI when
user submits that form and, after execute that page, unblock again.

Cheers



[jQuery] Re: How do i remove an event?

2007-05-29 Thread Erik Beeson


Alternatively, instead of unbinding the event, you could have your
event handler check for some condition:

$('div#topLineHover').bind('mouseover', function() {
   if($('#topLine').is(':hidden')) {
$('#topLine').slideDown('slow');
   }
});

Also, when selecting by ID, no need to specify a tag name. So
div#topLineHover should be #topLineHover.

--Erik


On 5/29/07, Gordon <[EMAIL PROTECTED]> wrote:


Yeah, you have to repeat the code.  You could put the code in a
function though.

function doSlide ()
{
$('#myLine').slideDown ('slow');
}

$('div#topLineHover').bind('mouseover', doSlide);

On May 29, 11:03 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Does that mean i have to repeat the code or is there a way to do it without?
>
> Gordon wrote:
> > The same way you bound it in the first place.
>
> > On May 29, 8:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> >> Thanks Erik,
>
> >> But how do i rebind something which has been unbound?
>
> >> Erik Beeson wrote:
>
> >>> How about:
>
> >>> $('div#topLineHover').one('mouseover', function() {
> >>>  $('#topLine').slideDown('slow');
> >>> });
>
> >>> Or:
> >>> $('div#topLineHover').bind('mouseover', function() {
> >>>  $('#topLine').slideDown('slow');
> >>> });
> >>> And:
> >>> $('div#topLineHover').unbind('mouseover');
>
> >>> --Erik
>
> >>> On 5/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>   Hi all,
>
>   I'm struggling to understand how to remove an event listener in jquery.
>
>   I have this basic code:
>
>   $('div#topLineHover').hover(function()
>   {
>   $('#topLine').slideDown('slow');
>   });
>
>   Now, once the topLine div has appeared, i want to stop this code from
>  working any more.
>
>   At a later point, upon another event being triggered, i'd like to
>  reactivate this code
>
>   I'm really at a loss on this and i've searched high and low! Any
>  help would
>  be greatly appreciated.
>
>   Thanks




[jQuery] jQuery on Rails-related

2007-05-29 Thread Yehuda Katz

Hey guys,

Great news! Hpricot has accepted my patches to make hpricot compatible with
jQuery, which means you'll only need to checkout the latest hpricot from svn
to use jQuery on Rails.

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325


[jQuery] Re: A demo and an optimization question

2007-05-29 Thread Jörn Zaefferer


Dan G. Switzer, II wrote:

$(document).bind("click", function (e){
// get the target element (srcElement for IE, originalTarget for
W3C)
var el = e.srcElement || e.originalTarget;
if( el.tagName == "A" && el.className == "icon" ){
alert("Hey, I'm an a.icon element!!!");
return false;
}
});



A couple of more notes on this.

1) Instead of attaching the event to the document, you could attach it to
the a specific parent element (i.e. $("ol.icons") instead of $(document).)
This would obviously save some processing.

2) The other benefit of this method, is that you won't need to "reattach"
the behavior if you replace the inner contents of "ol.icons". This means you
can repopulate the images with a different subset loaded dynamically,
without having to re-parse the elements on each dynamic load.
  
Another note: Using event.target should be good enough, as jQuery 
normalizes target in IE (srcElement) and Safari (fix textnodes).


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Improved timePicker, time/datePicker demo

2007-05-29 Thread Jörn Zaefferer


Anders wrote:



It does have more features than mine (although I have added scrolling
to the entered time). It also uses another plugin (below) I did for
positioning, so there is no requirement to have the dimensions plugin.


I didn't know you had continued to develop the list version (which
I've been calling "original"), must have missed that (or you put it up
recently). I wouldn't feel bad if it was made into one version again,
as much of my work is based around your code anyway. Bright future for
timePickers it seems!
I would welcome to see only a single timepicker at the end of this, as 
long as the quality is the best match.


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: .load issue with IE7

2007-05-29 Thread JimD

Well no luck with .get either.  Guess Ill have to output the div as
the page is generated. So much for IE.

On May 29, 9:09 am, JimD <[EMAIL PROTECTED]> wrote:
> Hi Olive thanks for the suggestion.
>
> Usually I dont have a problem with .load in IE7, but I assume this is
> because Im doing a .load within another file that was requested via
> ajax.
>
> On May 29, 5:00 am, Olive <[EMAIL PROTECTED]> wrote:
>
>
>
> > Jim,
>
> > there is a problem using load in IE when you have to load inside a
> > HTML table.
>
> > You should use $.get instead.
>
> > HTH,
>
> > Olive.- Hide quoted text -
>
> - Show quoted text -



[jQuery] Re: .load issue with IE7

2007-05-29 Thread JimD

Hi Olive thanks for the suggestion.

Usually I dont have a problem with .load in IE7, but I assume this is
because Im doing a .load within another file that was requested via
ajax.

On May 29, 5:00 am, Olive <[EMAIL PROTECTED]> wrote:
> Jim,
>
> there is a problem using load in IE when you have to load inside a
> HTML table.
>
> You should use $.get instead.
>
> HTH,
>
> Olive.



[jQuery] Re: Automatic scrolling?

2007-05-29 Thread Dan G. Switzer, II

>I have a web page with a user-selectable number of quiz questions.
>Each question is in a list element.  Sometimes users select 250 quiz
>questions which is a lot...
>
>I wanted to solicit thoughts about automatically scrolling to the next
>question when a choice is made (when a radio button is selected)...
>Is there any support in jQuery which would allow me to get the next
>list element object (that's easy), then scroll the window so that the
>next list element is positioned neatly at the top of the window?

If it makes sense w/in your application, I'd be tempted to show just one
question at time instead of scrolling them around. You could still attach
this behavior at runtime...

-Dan



[jQuery] Re: Automatic scrolling?

2007-05-29 Thread Karl Swedberg
I think the ScrollTo or ScrollToAnchors functions in the Interface FX  
module would work well for what you're trying to achieve:


You can check out the documentation for them here:

http://interface.eyecon.ro/docs/fx


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



On May 29, 2007, at 11:23 AM, Jonathan Sharp wrote:


What is the HTML structure of your document?

Yes, it is possible though.

Cheers,
-js


On 5/29/07, SamCKayak <[EMAIL PROTECTED]> wrote:

I have a web page with a user-selectable number of quiz questions.
Each question is in a list element.  Sometimes users select 250 quiz
questions which is a lot...

I wanted to solicit thoughts about automatically scrolling to the next
question when a choice is made (when a radio button is selected)...
Is there any support in jQuery which would allow me to get the next
list element object (that's easy), then scroll the window so that the
next list element is positioned neatly at the top of the window?

Sam






[jQuery] Re: Automatic scrolling?

2007-05-29 Thread Jonathan Sharp

What is the HTML structure of your document?

Yes, it is possible though.

Cheers,
-js


On 5/29/07, SamCKayak <[EMAIL PROTECTED]> wrote:



I have a web page with a user-selectable number of quiz questions.
Each question is in a list element.  Sometimes users select 250 quiz
questions which is a lot...

I wanted to solicit thoughts about automatically scrolling to the next
question when a choice is made (when a radio button is selected)...
Is there any support in jQuery which would allow me to get the next
list element object (that's easy), then scroll the window so that the
next list element is positioned neatly at the top of the window?

Sam




[jQuery] .parents(expr)

2007-05-29 Thread SamCKayak

I could do a test, but discussion seemed like it might turn up
something else...

.parents(expr) supports an expression to filter parent elements,
e.g.,

.parents('.getme') // returns all parents with class getme

the $(expr) in general allows any css (or xml) selector.  Does expr
extend this way in parent(expr) to retrieve  all  children under a
parent? e.g.,

.parents('.getme > li')

as a shortcut for

.parents('.getme').children('li')

Sam



[jQuery] Re: massive jquery memory leak in firefox 2.x: load() or empty()?

2007-05-29 Thread Jonathan Sharp

Can you provide an online example? The issue may be in your callback method.

Cheers,
-Jonathan


On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:



I assume this is a memory leak:

$(#id).empty();
$(#id).load(url, params, callback)

increases more and more the memory usage of firefox even if the
content is replaced (in my case about 0.5mb per request). since the
dev mailinglist did not work for me I
post it in here.

any sugestions? is this problme related to .empty() or to .load()?

-- mot




[jQuery] Automatic scrolling?

2007-05-29 Thread SamCKayak

I have a web page with a user-selectable number of quiz questions.
Each question is in a list element.  Sometimes users select 250 quiz
questions which is a lot...

I wanted to solicit thoughts about automatically scrolling to the next
question when a choice is made (when a radio button is selected)...
Is there any support in jQuery which would allow me to get the next
list element object (that's easy), then scroll the window so that the
next list element is positioned neatly at the top of the window?

Sam



[jQuery] Re: click on IE won't work in multiple frame application along with other inconsistancies

2007-05-29 Thread [EMAIL PROTECTED]

Can someone answer this question about frame and jQuery?
Thanks

On May 24, 11:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I have an html page with two frames named: A and B. All javascript
> functions are in top object.
>
> document A has an element "sample test", I'm
> trying to attach an click event to it from top object like this:
>
> var obj = top.A.document.getElementById('sample');
> $(obj).click(function(){
>   alert('test');
>
> });
>
> Same code works in Safari, but not in IE.
>
> Another issue is with ".html" method.  When I do use $('#id',
> window.document) format to retrieve an element in a different frame, I
> can set that #id's html as empty by doing $('#id',
> window.document).html(""). However, if I use $("#id",
> window.document).html("insert this part as html"), it failes.
>
> Can someone help me?
>
> Thanks
>
> Y



[jQuery] Re: jQuery'zed Ext.Template

2007-05-29 Thread Rodrigo Moraes


On 5/29/07, John Resig wrote:

You mean like jQuery.extend()? You just pass in two objects and the
first one is extended with the second.

http://docs.jquery.com/JavaScript#.24.extend.28_target.2C_prop1.2C_propN_.29


Thanks, John. I tried it first, but it doesn't seem appropriate in
this case. I can't use superclass in the extended class (Error:
$.MasterTemplate.superclass has no properties), and uh, I don't
understand this completelly.

So I've duplicated Ext.extend() [1] (similar to YAHOO.extend() [2]) to
get it working. I wonder if I could use something that's already used
by other plugins / core to extend a class in such way, to avoiding
including the function and instead use an existing solution.

-- rodrigo

[1] http://localhost/ext-1.0.1/docs/output/Ext.html#extend
[2] http://developer.yahoo.com/yui/docs/YAHOO.html


[jQuery] Block UI when user submits a slow page

2007-05-29 Thread Web Specialist

Hi all

do you know any example using BlockUI with "normal" form(otherwise Ajax)?

I have a very slow form(processing text files). I'll want to block UI when
user submits that form and, after execute that page, unblock again.

Cheers


[jQuery] Re: How to pass variable from link

2007-05-29 Thread MikeR

http://docs.jquery.com/Ajax would be a good start =).

You'll want to make an Ajax call ($.ajax, $.get, $.post... whichever)
and use "data" to pass back data to PHP.

qt wrote:
> Hello list
>
> Let's say I have a list of items (retrieved from a mysql-db with PHP).
>
> To edit the records, one has to click a link (item 1 a>) which opens a form (achieved with the show/hide jquery).
>
> How can I pass the id of an item back to php.
>
> I guess I have to use the $.get or $.post function, but I am stuck on
> this.
>
> All help is highly appreciated!
>
> Thanks.
> QT



[jQuery] Re: jQuery'zed Ext.Template

2007-05-29 Thread John Resig



I still have three global functions while I'm looking for alternatives
in the jQuery world. I'm looking for something that helps extending
classes / overriding class members in jQuery or any jQuery
plugin/utility. Something like the extend() function in YUI or Ext. Is
there any?


You mean like jQuery.extend()? You just pass in two objects and the
first one is extended with the second.

http://docs.jquery.com/JavaScript#.24.extend.28_target.2C_prop1.2C_propN_.29

--John


[jQuery] Re: < id=__ie_init defer=true src=//:>

2007-05-29 Thread Diego A.

Hi John/Michael,

FOUND THE PROBLEM.

And John, I'm sure you'll be glad to know it's not a bug in jQuery.

I compress (remove white space and pointless concatinations) and re-
pack my scripts into one file with jQuery and all the plugins I use.
This error happened when I compressed and re-packed the
'packed' (compressed) version of jQuery - ie.: compressed it twice.

In the process,
document.write("<\/
script>");

Became...
document.write("<\/
script>");

I just played around with my JS compressor and I've got it working
now.

Hope this helps anyone who has the same problem.

Diego A.

On May 29, 5:49 am, "John Resig" <[EMAIL PROTECTED]> wrote:
> Do you think you could find a test case for this? We were under the
> assumption that this method was fairly rock-solid, but what you
> describe sounds like a reproducible flaw. If you can make one, please
> post it to the bug tracker.
>
> --John
>
> On 5/28/07, Michael Geary <[EMAIL PROTECTED]> wrote:
>
>
>
> > > From: Diego A.
>
> > > In IE (6 and 7) the compressed version of jQuery is adding
> > > the following text to the document:
> > > < id=__ie_init defer=true src=//:>
>
> > > I know it's related to the following code (from line 1493):
> > >   // Only works if you document.write() it
> > >   document.write(" > >   "src=//:><\/script>");
>
> > > I found this related topic...
>
> >http://groups.google.com/group/jquery-en/browse_thread/thread/105ccbd...
> > b2
> > > ...but it doesn't actually mention a solution.
>
> > > Mike Alsup suggested removing the 'defer' attribute from the
> > > script tag, but it doesn't apply to my case (I'm not using defer).
>
> > > Any ideas why this is happening?
>
> > Hmm... Removing the 'defer' from this script tag would cause
> > $(document).ready() to fire prematurely - a very bad thing.
>
> > I don't know what the solution is for you, but this defer attribute also
> > gave me a lot of grief recently. One of our newspaper partner sites had some
> > JavaScript code that was setting .innerHTML of a DOM element *while the page
> > was loading*. This caused that special script tag to execute immediately,
> > also causing $(document).ready() to fire prematurely.
>
> > Fortunately, I was able to change their code to use document.write instead
> > of .innerHTML, but clearly the defer attribute is not very robust. I wonder
> > if there is a usable alternative for IE?
>
> > -Mike



[jQuery] Re: A demo and an optimization question

2007-05-29 Thread Dan G. Switzer, II

>$(document).bind("click", function (e){
>   // get the target element (srcElement for IE, originalTarget for
>W3C)
>   var el = e.srcElement || e.originalTarget;
>   if( el.tagName == "A" && el.className == "icon" ){
>   alert("Hey, I'm an a.icon element!!!");
>   return false;
>   }
>});

A couple of more notes on this.

1) Instead of attaching the event to the document, you could attach it to
the a specific parent element (i.e. $("ol.icons") instead of $(document).)
This would obviously save some processing.

2) The other benefit of this method, is that you won't need to "reattach"
the behavior if you replace the inner contents of "ol.icons". This means you
can repopulate the images with a different subset loaded dynamically,
without having to re-parse the elements on each dynamic load.

-Dan



[jQuery] Re: jQuery'zed Ext.Template

2007-05-29 Thread Rodrigo Moraes


On 5/29/07, Diego A. wrote:

It's not only great for saving code, but it will come in handy for
customizing the html output of plugins...
much easier than having a bunch of individual options.


I thought that too! :) I'm using it in a plugin I'm writing to make
the output customizable. Also I think that it is much more readable
and easy to maintain a template than a function with a lot of + and
vars to build a complex html structure.

The code came entirely from Ext - the brilliant work was made by Jack
Slocum. As I've used it for a while, I missed the template class a lot
when I moved to jQuery. And so I adapted/simplified it to use on
plugins.

-- rodrigo


[jQuery] Re: A demo and an optimization question

2007-05-29 Thread Dan G. Switzer, II

David,

>I've been using jquery to build an icon picker for FAMFAMFAM's Silk
>icon set. I've got a working version (at http://dsingleton.co.uk/code/icon-
>selector/),
>but with 1000 images on the page everything is a little slow, i'm
>wondering what I can do to optomize the JS make it a little snappier?

[... clip ...]

>   // All the icons, we'll be using this a lot
>   var icons = $('ol.icons li a');

Quite frankly, searching over thousands of elements is just slow. Generally
always has been. It's not so much a jQuery issue as parsing thousands of DOM
elements generally is a performance hog.

As already stated by someone else, I'd recommend trying to simplify the
selector as much as possible. I'd probably give each anchor tag a class that
indicates it's for an icon:

var icons = $('ol.icons a.icon');

This will do a little less work.

However, you're best option for speed may to be to just add a onmouseclick
event to the document and then just have that event handler look to see if
you click on a a.icon element.

This prevents needing to parse through the DOM looking for thousands of
matches, and instead you just do some parsing on each mouse click. You could
also even just check the  element directly. 

For example:

$(document).bind("click", function (e){
// get the target element (srcElement for IE, originalTarget for
W3C)
var el = e.srcElement || e.originalTarget;
if( el.tagName == "A" && el.className == "icon" ){
alert("Hey, I'm an a.icon element!!!");
return false;
}
});

The above code will monitor each mouse click event. If you click on the an
 tag with a class name of "icon", the alert() will be triggered.

This code allow you to very efficient add the behavior you're looking
for--without having attach the behavior to each and every  tag. 

This should be extremely fast and efficient...

-Dan



[jQuery] Re: jQuery'zed Ext.Template

2007-05-29 Thread Diego A.

I love it. I think it's brilliant.
It's not only great for saving code, but it will come in handy for
customizing the html output of plugins...
much easier than having a bunch of individual options.

On May 29, 1:42 pm, "Rodrigo Moraes" <[EMAIL PROTECTED]> wrote:
> Hi,
> I made a simple port of Ext.Template [1] / Ext.MasterTemplate [2] to
> be used with jQuery, removing Ext dependencies and so. The result is
> tiny - 2,4KB packed, and given that it can make other codes smaller, I
> think it is worth. Here's the code (feedback appreciated, I'm not a
> javascript master! ;):
>
> http://dev.tipos.org/browser/javascript/jquery/template/jquery.templa...
>
> I still have three global functions while I'm looking for alternatives
> in the jQuery world. I'm looking for something that helps extending
> classes / overriding class members in jQuery or any jQuery
> plugin/utility. Something like the extend() function in YUI or Ext. Is
> there any?
>
> thanks,
> rodrigo
>
> [1]http://extjs.com/deploy/ext/docs/output/Ext.Template.html
> [2]http://extjs.com/deploy/ext/docs/output/Ext.MasterTemplate.html
>
> ---
>
> Usage (based on Ext.MasterTemplate docs):
>
> var t = new $.MasterTemplate(
> '',
> ' value="{value}">{text}',
> ''
> );
> t.add('options', {value: 'foo', text: 'bar'});
>
> // or you can add multiple child elements in one shot
> t.fill('options', [
> {value: 'foo', text: 'bar'},
> {value: 'foo2', text: 'bar2'},
> {value: 'foo3', text: 'bar3'}
> ]);
>
> // then append applying the master template values
> $(document.body).append(t.apply({name: 'my-select'}));



[jQuery] How to pass variable from link

2007-05-29 Thread qt

Hello list

Let's say I have a list of items (retrieved from a mysql-db with PHP).

To edit the records, one has to click a link (item 1) which opens a form (achieved with the show/hide jquery).

How can I pass the id of an item back to php.

I guess I have to use the $.get or $.post function, but I am stuck on
this.

All help is highly appreciated!

Thanks.
QT



[jQuery] Getting ThickBox to work with other libraries

2007-05-29 Thread [EMAIL PROTECTED]

Hi guys.

I have developed a web app and am making various AJAX popups using
Thickbox. However some of these popups use other JS libraries (eg:
scriptaculous). I have tried to implement the suggestions in this
link: http://docs.jquery.com/Using_jQuery_with_Other_Libraries  but
didn't help, I tried all three ways and had no success.

So basically my webpage has a few links and on one of the links once
its clicked it opens a popup (meant to) and there you can use
scriptaculous to edit some text. Now if I open the page with the
scriptaculuos stuff in directly (IE: not via popup) it all works fine.
If I try open it with the link it gives me a blank page and shows the
page is still loading but it never does, it also gives me JS errors
such as:

jQuery is not defined, AjaX is not defined etc...

Here is a brief peice of code to try clairify the situation:

">
">






jQuery.noConflict();


the paths are all correct but there is some sort of conflict that
doesnt allow the page to load.

Please can anyone advise as to what the problem is and how to solve
it, anything would be welcome as its getting critical .

Thanks in advance.



[jQuery] Re: massive jquery memory leak in firefox 2.x: load() or empty()?

2007-05-29 Thread [EMAIL PROTECTED]

If I reload, close the Tab or navigate somewhere else, it is not given
back. If I close the Browser and Re-open it, yes.

I checked out some tweaks from a firefox memory leak discussion
( http://www.freerepublic.com/focus/f-bloggers/1327586/posts ) but
nothing works so far. I'm using Process Explorer to monitor Private
Bytes. I disabled firebug and webdeveloper toolbar.

This is about 0.5 to 1mb per operation and the requested data is about
50kb.

Firefox is taking so much memory and the more it takes the longer the
scripts need to execute rendering the whole javscript/jQuery stuff
useless. I mean how do you handle that? It's just simply not working
any longer after a hundred clicks. Even Reload gives me Messageboxes
telling me that a script is taking long and wether I want to stop,
debug or continue that. Is there something like freeing jQuery
objects, resetting something or similar? Resetting the whole
javascript engine maybe? I only need that for Firefox.

Thanks for your help so far!

On 29 Mai, 14:32, "Brandon Aaron" <[EMAIL PROTECTED]> wrote:
> Is the memory given back after a refresh?
>
> --
> Brandon Aaron
>
> On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > I assume this is a memory leak:
>
> > $(#id).empty();
> > $(#id).load(url, params, callback)
>
> > increases more and more the memory usage of firefox even if the
> > content is replaced (in my case about 0.5mb per request). since the
> > dev mailinglist did not work for me I
> > post it in here.
>
> > any sugestions? is this problme related to .empty() or to .load()?
>
> > -- mot



[jQuery] jQuery'zed Ext.Template

2007-05-29 Thread Rodrigo Moraes


Hi,
I made a simple port of Ext.Template [1] / Ext.MasterTemplate [2] to
be used with jQuery, removing Ext dependencies and so. The result is
tiny - 2,4KB packed, and given that it can make other codes smaller, I
think it is worth. Here's the code (feedback appreciated, I'm not a
javascript master! ;):

http://dev.tipos.org/browser/javascript/jquery/template/jquery.template.js?format=txt

I still have three global functions while I'm looking for alternatives
in the jQuery world. I'm looking for something that helps extending
classes / overriding class members in jQuery or any jQuery
plugin/utility. Something like the extend() function in YUI or Ext. Is
there any?

thanks,
rodrigo

[1] http://extjs.com/deploy/ext/docs/output/Ext.Template.html
[2] http://extjs.com/deploy/ext/docs/output/Ext.MasterTemplate.html

---

Usage (based on Ext.MasterTemplate docs):

   var t = new $.MasterTemplate(
   '',
   '{text}',
   ''
   );
   t.add('options', {value: 'foo', text: 'bar'});

   // or you can add multiple child elements in one shot
   t.fill('options', [
   {value: 'foo', text: 'bar'},
   {value: 'foo2', text: 'bar2'},
   {value: 'foo3', text: 'bar3'}
   ]);

   // then append applying the master template values
   $(document.body).append(t.apply({name: 'my-select'}));


[jQuery] Re: massive jquery memory leak in firefox 2.x: load() or empty()?

2007-05-29 Thread Brandon Aaron

Is the memory given back after a refresh?

--
Brandon Aaron

On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I assume this is a memory leak:
>
> $(#id).empty();
> $(#id).load(url, params, callback)
>
> increases more and more the memory usage of firefox even if the
> content is replaced (in my case about 0.5mb per request). since the
> dev mailinglist did not work for me I
> post it in here.
>
> any sugestions? is this problme related to .empty() or to .load()?
>
> -- mot
>
>

--~--~-~--~~~---~--~~
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] massive jquery memory leak in firefox 2.x: load() or empty()?

2007-05-29 Thread [EMAIL PROTECTED]

I assume this is a memory leak:

$(#id).empty();
$(#id).load(url, params, callback)

increases more and more the memory usage of firefox even if the
content is replaced (in my case about 0.5mb per request). since the
dev mailinglist did not work for me I
post it in here.

any sugestions? is this problme related to .empty() or to .load()?

-- mot



[jQuery] Re: .load issue with IE7

2007-05-29 Thread Olive

Jim,

there is a problem using load in IE when you have to load inside a
HTML table.

You should use $.get instead.

HTH,

Olive.



[jQuery] Re: jQuery innerfade on safari Problem

2007-05-29 Thread tlob

no one can help me a little bit? sigh

On 25 Mai, 10:15, tlob <[EMAIL PROTECTED]> wrote:
> Hi there
>
> I work on a photographers site. She wants a slide show of her
> photographs.http://www.siggibucher.com/preview/test.php
> I used the innerfade plugin fromhttp://medienfreunde.com/lab/innerfade/
> It's very beautiful. Everything is fine except two thing.
>
> My fading is not working on Safari Mac. It should, because the
> original innerfade is also working on safari.
>
> The slideshow off button is blinking. It's very ugly this way.
>
> THX in advance
> thomas l from zürich



[jQuery] Re: Improved timePicker, time/datePicker demo

2007-05-29 Thread Anders



It does have more features than mine (although I have added scrolling
to the entered time). It also uses another plugin (below) I did for
positioning, so there is no requirement to have the dimensions plugin.


I didn't know you had continued to develop the list version (which
I've been calling "original"), must have missed that (or you put it up
recently). I wouldn't feel bad if it was made into one version again,
as much of my work is based around your code anyway. Bright future for
timePickers it seems!


[jQuery] .load issue with IE7

2007-05-29 Thread JimD

Ok so I have payment page.  When the page loads I fill in a list of
payments within a div using .load, and within the page being loaded in
the div, I have another .load that feeds in a total box. This all
works great in FF2, but for some reason in IE7 the paybox doesnt not
display.

So in the main page I load the list page using .load like so and it
works fine in both IE7 and FF2.


$(document).ready(function(){
   $("div#payments").load('account_rec_load.html',function(){
   return false;
   });
});


Then in the 'account_rec_load.html' page I have a similiar load
function that just loads in a totals box using .load as well. This
works in FF but not IE7. I'm assuming its because the ajax loaded page
isnt actually being seen as loaded in IE7? Sorry Im not quite the
javascript guru. Any ideas why IE7 is treating this differently.

$(document).ready(function(){
   $("div#paytotal").load("payment_total_load.html",function(){
   return false;
   });
});



[jQuery] Re: Improved timePicker, time/datePicker demo

2007-05-29 Thread Sam Collett

On May 28, 10:33 pm, Anders <[EMAIL PROTECTED]> wrote:
> > Nice plugin, very useful. What exactly are the differences to Sam's
> > orginal (without looking at the original...)?
>
> Thanks! Not 100% sure on these (Sam, correct me if I'm wrong), but
> should be mostly correct:
>
> * Scrolls to the entered time
> * Scrolls to the nearest time if not in the list, e.g 05.01 selects 05.00
> * Open/close on focus/blur (tabbing works)
> * Keeps focus in the input field when a time is selected (tabbing friendly)
> * Uses the dimension plugin for positioning which fixes a rendering bug
> * Fixes a bug where all times in the list where selected
> * Added callbacks (not documented/finalized)

It does have more features than mine (although I have added scrolling
to the entered time). It also uses another plugin (below) I did for
positioning, so there is no requirement to have the dimensions plugin.
There are two versions (table and list):
http://www.texotela.co.uk/code/jquery/timepicker/?version=table
http://www.texotela.co.uk/code/jquery/timepicker/?version=list



[jQuery] Re: How do i remove an event?

2007-05-29 Thread Gordon

Yeah, you have to repeat the code.  You could put the code in a
function though.

function doSlide ()
{
$('#myLine').slideDown ('slow');
}

$('div#topLineHover').bind('mouseover', doSlide);

On May 29, 11:03 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Does that mean i have to repeat the code or is there a way to do it without?
>
> Gordon wrote:
> > The same way you bound it in the first place.
>
> > On May 29, 8:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> >> Thanks Erik,
>
> >> But how do i rebind something which has been unbound?
>
> >> Erik Beeson wrote:
>
> >>> How about:
>
> >>> $('div#topLineHover').one('mouseover', function() {
> >>>  $('#topLine').slideDown('slow');
> >>> });
>
> >>> Or:
> >>> $('div#topLineHover').bind('mouseover', function() {
> >>>  $('#topLine').slideDown('slow');
> >>> });
> >>> And:
> >>> $('div#topLineHover').unbind('mouseover');
>
> >>> --Erik
>
> >>> On 5/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>   Hi all,
>
>   I'm struggling to understand how to remove an event listener in jquery.
>
>   I have this basic code:
>
>   $('div#topLineHover').hover(function()
>   {
>   $('#topLine').slideDown('slow');
>   });
>
>   Now, once the topLine div has appeared, i want to stop this code from
>  working any more.
>
>   At a later point, upon another event being triggered, i'd like to
>  reactivate this code
>
>   I'm really at a loss on this and i've searched high and low! Any
>  help would
>  be greatly appreciated.
>
>   Thanks



[jQuery] Re: How do i remove an event?

2007-05-29 Thread [EMAIL PROTECTED]

Does that mean i have to repeat the code or is there a way to do it without?

Gordon wrote:

The same way you bound it in the first place.

On May 29, 8:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
  

Thanks Erik,

But how do i rebind something which has been unbound?

Erik Beeson wrote:



How about:
  
$('div#topLineHover').one('mouseover', function() {

 $('#topLine').slideDown('slow');
});
  
Or:

$('div#topLineHover').bind('mouseover', function() {
 $('#topLine').slideDown('slow');
});
And:
$('div#topLineHover').unbind('mouseover');
  
--Erik
  
On 5/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
  

 Hi all,

 I'm struggling to understand how to remove an event listener in jquery.

 I have this basic code:

 $('div#topLineHover').hover(function()

 {
 $('#topLine').slideDown('slow');
 });

 Now, once the topLine div has appeared, i want to stop this code from

working any more.

 At a later point, upon another event being triggered, i'd like to

reactivate this code

 I'm really at a loss on this and i've searched high and low! Any

help would
be greatly appreciated.

 Thanks





  


[jQuery] Re: IE selector bug/error?

2007-05-29 Thread Luc Pestille
Anyone have any idea on this? Non-existant selctors are breaking IE,
which is fairly bad news for me!
Thanks,
Luc Pestille
Web Designer



From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Luc Pestille
Sent: 23 May 2007 15:19
To: jquery-en@googlegroups.com
Subject: [jQuery] IE selector bug/error?


I've found something that I can't get around; in IE6, these
selectors won't do anything for me;
 
1. $("#admin-jobs #discipline_client_row").hide();
2. $("#admin-jobs > #discipline_client_row").hide();
 
whereas this works fine (as you'd expect);
 
3. $("#discipline_client_row").hide();
 
In IE, number 1 gives me the error (when that div doesn't exist on the
page):
---
Line: 184
Error: 'getElementById' is null or not an object
---
 
but number 2 reports no error, despite not finding the div on the page.
Has anyone come across this before? Any help would be appreciated, IE is
starting to drive me in to a coma.
 
Thanks,
 
Luc Pestille
Web Designer

 



In2
Thames House
Mere Park
Dedmere Road
Marlow
Bucks
SL7 1PB
Tel 01628 899700
Fax 01628 899701
e: [EMAIL PROTECTED]
i: www.in2.co.uk  

This message (and any associated files) is intended only for the use of
jquery-en@googlegroups.com and may contain information that is
confidential, subject to copyright or constitutes a trade secret. If you
are not jquery-en@googlegroups.com you are hereby notified that any
dissemination, copying or distribution of this message, or files
associated with this message, is strictly prohibited. If you have
received this message in error, please notify us immediately by replying
to the message and deleting it from your computer. Messages sent to and
from us may be monitored. Any views or opinions presented are solely
those of the author [EMAIL PROTECTED] and do not necessarily
represent those of the company. 

  
<>

[jQuery] index of an element

2007-05-29 Thread Olivier Percebois-Garve

Hi

I'm trying to get this working:
jQuery('#accordion [EMAIL PROTECTED]').click(function(){
  var rank = jQuery('#accordion
p').index(function(){jQuery(this).parent('p').eq(0)});
});


my markup:

   
   bla blah
   
   Yes
   No
   


when I output 'rank' it keeps giving me -1.

I tried jQuery(this).parent('p') or jQuery(this).parent('p')[0] but no luck.
I dont get it because my debug says that it is a "object
HTMLParagraphElement" and if I ask the html() then the content is the right
one.

What I am missing ?

thanks


Olivier


[jQuery] Re: How do i remove an event?

2007-05-29 Thread Gordon

The same way you bound it in the first place.

On May 29, 8:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Thanks Erik,
>
> But how do i rebind something which has been unbound?
>
> Erik Beeson wrote:
>
> > How about:
>
> > $('div#topLineHover').one('mouseover', function() {
> >  $('#topLine').slideDown('slow');
> > });
>
> > Or:
> > $('div#topLineHover').bind('mouseover', function() {
> >  $('#topLine').slideDown('slow');
> > });
> > And:
> > $('div#topLineHover').unbind('mouseover');
>
> > --Erik
>
> > On 5/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> >>  Hi all,
>
> >>  I'm struggling to understand how to remove an event listener in jquery.
>
> >>  I have this basic code:
>
> >>  $('div#topLineHover').hover(function()
> >>  {
> >>  $('#topLine').slideDown('slow');
> >>  });
>
> >>  Now, once the topLine div has appeared, i want to stop this code from
> >> working any more.
>
> >>  At a later point, upon another event being triggered, i'd like to
> >> reactivate this code
>
> >>  I'm really at a loss on this and i've searched high and low! Any
> >> help would
> >> be greatly appreciated.
>
> >>  Thanks