[jQuery] Possible bug in 1.0.4

2006-12-15 Thread gilles
Hi guys,

I found a bug in 1.0.4;

It has to do with this line:
var c = this.events[event.type];

In the handle function.

The error occurs after cliking an ASP button which reloads the page.
Unfortunately, i can't give a test page since it is a closed project.  All
i can say is that it gives an error stating:
this.events has no properties

Maybe this one can be solved by adding this check?
if (!this.events)
  return;

However, i can't connect to SVN from here, so can someone pick this up?

Thanx

Gilles


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Function: $(...).ancestorsTo(match)

2006-12-15 Thread Jonathan Sharp

On 12/14/06, Sam Collett [EMAIL PROTECTED] wrote:


On 14/12/06, Dave Methvin [EMAIL PROTECTED] wrote:
  Would this be a candidate for addition to the core possibly?

 The ancestorsTo looks like it's an up-the-tree analog of the nextUntil
 method for siblings that was discussed here a while back. I think the
 general consensus on that was that there would be an extended navigation
 plugin rather than add all these to the core. Maybe they should be named
 ancestorsUntil and siblingsUntil for better consistency?

The only problem with that is that it also includes the element
matching the expression. nextUntil does not. There may be cases when
you want that, but other times you may not. Perhaps an additional
parameter?



Yeah, a second parameter would work or tacking on a .filter() would work.

Cheers,
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Manipulating XML

2006-12-15 Thread Pje

Hi,

I need to manipulate a XML that i receive from a request. The XML looks
like:

root
   company
   id3/id
   namefoo/name
   /company
   company
   id5/id
   namebar/name
   /company
/root

There is a way to get the node company that have a specific id?

$('company:nth('5')', xml).text(); will return the 5th node... what i need
is the node with id 5. Any tips?
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] jQuery.com down with 500 error?

2006-12-15 Thread Jonathan Sharp

Sad day!


Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and inform
them of the time the error occurred, and anything you might have done that
may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an
ErrorDocument to handle the request.
--
Apache/1.3.33 Server at www.jquery.com Port 80
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery.com down with 500 error?

2006-12-15 Thread Pje

I think some messages from the list in this meantime are lost too. I sent
two and i found only one in nabble.

On 12/15/06, Jonathan Sharp [EMAIL PROTECTED] wrote:


Sad day!


Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and inform
them of the time the error occurred, and anything you might have done that
may have caused the error.

More information about this error may be available in the server error
log.

Additionally, a 404 Not Found error was encountered while trying to use an
ErrorDocument to handle the request.
--
Apache/1.3.33 Server at www.jquery.com Port 80



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Empty each text field

2006-12-15 Thread Sam Collett
On 15/12/06, Chris Domigan [EMAIL PROTECTED] wrote:
 Mungbeans - remember this in the context you are using it is a normal DOM
 node, so you can't use jQuery methods like .val on it. You can do
 $(this).val() instead.

If it is just a text box (not a dropdown or radio/check button), you
just use 'this.value'.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] WEIRD IE problem - never mind.......

2006-12-15 Thread Michael Price
As is typical, as soon as I posted to the mailing list about it, I 
realised what I'd done wrong.

I used script type=text/javascript src=.. / and NOT 
script./script.

I'm an idiot, please return to your regularly scheduled programming. :)

Regards,
Michael Price


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Possible bug in 1.0.4

2006-12-15 Thread Jörn Zaefferer
 I found a bug in 1.0.4;
 
 It has to do with this line:
 var c = this.events[event.type];
 
 In the handle function.
 
 The error occurs after cliking an ASP button which reloads the page.
 Unfortunately, i can't give a test page since it is a closed project.  All
 i can say is that it gives an error stating:
 this.events has no properties
 
 Maybe this one can be solved by adding this check?
 if (!this.events)
   return;
 
 However, i can't connect to SVN from here, so can someone pick this up?

It seems like jQuery tries to handle an event that wasn't registered via 
jQuery. Does that make any sense?

--
Jörn Zaefferer

http://bassistance.de
-- 
Ein Herz für Kinder - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] WEIRD IE page not displaying problem

2006-12-15 Thread Michael Price
Hiya,
I've been using jQuery on a lot of client sites but I've just come 
across a VERY strange issue with IE on a site I'm working on at present.

I've got a page which is XHTML 1.0 Strict, and passes validation with 
the W3C validator. It loads perfectly in Firefox, but in IE I get the 
page title, and then nothing actually appears. Just a white screen. As 
soon as I remove the call to jquery.js everything loads again!

I thought it might be an odd issue with 1.0.4 so I loaded a copy of 
1.0.3 but the same thing happened.

This is IE6 on Win98 but a colleague also saw the same thing in IE7 on 
XP Home.

Any guesses? I've NEVER had this problem before

Regards,
Michael Price


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] WEIRD IE page not displaying problem

2006-12-15 Thread Aaron Heimlich

Without knowing what you're actually doing with jQuery it's pretty hard to
help you. Could you post a link to the site you're having problems with?
That said, I can honestly say that I've never experienced anything like what
you just described with any version of jQuery.

On 12/15/06, Michael Price [EMAIL PROTECTED] wrote:


Hiya,
I've been using jQuery on a lot of client sites but I've just come
across a VERY strange issue with IE on a site I'm working on at present.

I've got a page which is XHTML 1.0 Strict, and passes validation with
the W3C validator. It loads perfectly in Firefox, but in IE I get the
page title, and then nothing actually appears. Just a white screen. As
soon as I remove the call to jquery.js everything loads again!

I thought it might be an odd issue with 1.0.4 so I loaded a copy of
1.0.3 but the same thing happened.

This is IE6 on Win98 but a colleague also saw the same thing in IE7 on
XP Home.

Any guesses? I've NEVER had this problem before

Regards,
Michael Price


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] www.jquery.com - 500 Internal Server Error

2006-12-15 Thread Pje

Just reporting.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] 1.0.4 bug - please confirm...

2006-12-15 Thread Prague Expat
(Sorry if this is posted twice - tried through Nabble first but it wasn't 
sent)

This page works with 1.0.3, but not 1.0.4 - it simply calls a javascript 
function on the focus event:

Error returned is: c[j].apply is not a function

Can someone confirm before I post a bug report?

Copy / Paste the following:


html
head
 script type=text/javascript src=jquery.js/script
 script type=text/javascript
 function myfunction(x){
  alert(x);
 }
 /script
/head
body
form
input id=test type=text nametest
/form
 script type=text/javascript
!-- 
$(document).ready(function(){
$(#test).focus(myfunction(this.id););
});
//--
/script
/body
/html 


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] www.jquery.com - 500 Internal Server Error

2006-12-15 Thread John Resig
Sorry, it should be ok, now.

On 12/15/06, Pje [EMAIL PROTECTED] wrote:
 Just reporting.

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] tablesorter 1.1

2006-12-15 Thread justin kelly

Hi All,

anyone know how the progress of tablersorter1.1 is going, seems to be some
slight movement in the svn

cant wait for 1.1, jquery will have a proper datagrid (tablesorter + pager +
filters = tablesorter1.1 :) )

Cheers

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


Re: [jQuery] 1.0.4 bug - please confirm...

2006-12-15 Thread John Resig
In order to do something like this:
$(#test).focus(myfunction(this.id););

You would need to do the following:
$(#test).focus(function(){
myfunction(this.id);
});

Passing in a string to the event handler was undocumented and was
causing some problems, so it needed to be removed. If there's still a
huge demand for it, we may consider bringing it back in 1.1.

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] 1.0.4 bug - please confirm...

2006-12-15 Thread Jonathan Sharp

On 12/15/06, John Resig [EMAIL PROTECTED] wrote:


*SNIP*
Passing in a string to the event handler was undocumented and was
causing some problems, so it needed to be removed. If there's still a
huge demand for it, we may consider bringing it back in 1.1.



I'd vote for not bringing it back. (Just my $('.02') )

-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] I need syntax help, please.

2006-12-15 Thread Christopher Jordan

This should be a quick one.

I know there's a way to do this, but it escapes me at this time.

I've got a few a href... tags on my screen, and I want some of them to 
open in the same window and some to open in a pop up, sized specifically.


Here's what I've got so far:

script
   $(document).ready(
   function (){$(a, .newWindow).click(
   function(){
   // there's more than just width and height, but you get the 
idea.
   var handle = window.open(this.href, 'some_target', 
'width=550, height=500');

   });
   });
/script


I've tried this same idea with the following changes:
  ... $(a, #newWindow).click(...
and
  ... $(a, newWindow).click(...
and
  ... $(#newWindow, a).click(...
and
  ... $(.newWindow, a).click(...
and
  etc., etc., etc.

Where am I going wrong. So far in my jQuery experience, I've only had 
need to find elements by their class, element type, or ID. But not a 
combination of those. Can someone please hit me with the correct syntax? 
Hit me hard, so I don't forget it next time. :o)


Cheers,
Chris
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Jquery Flash Plugin the FlashBlock Extension

2006-12-15 Thread Sam Sherlock

sweet! thrilling stuff.

On 15/12/06, Luke Lutman [EMAIL PROTECTED]  wrote:


Hi Sam,

I had a look, and FlashBlock blocked UFO and SWFObject movies, and sIFR
showed the alternate content, so I'm guessing that by 'works with
flashblock', you mean that the alternate content is show when flashblock
is on, correct?

From what I can tell, Flashblock looks for two things specific to sIFR:
- element class=sIFR-replaced.../element, which it hides with
inline styles (can be any element).
- span class=sIFR-alternate.../span, and it shows with inline
styles (has to be a span).

To get the same behavior with the jQuery Flash Plugin, you can change
the default replace function, like so:

jQuery.fn.flash.replace = function(htmlOptions) {
this.innerHTML = 'span class=alt
sIFR-alternate'+this.innerHTML+'/span';
jQuery(this)
.addClass('flash-replaced')
.addClass('sIFR-replaced')
.prepend($$.transform(htmlOptions));
};

Here's an example:
http://jquery.lukelutman.com/plugins/flash/example-flashblock.html

Luke

Sam Sherlock wrote:
 I have noticed that the flash plugin does not work with the flashBlock
 firefox extension
 whereas the both swfObject, UFO  sIFR do work with the extension.

 In firefox with flashBlock installed and blocking flash content the
 flash is not displayed
 nor is the content that it replaces.

 I have looked at the source but its a bit beyond me.  Would this be
 complicated to
 build into the plugin?


 

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Remove from JSON

2006-12-15 Thread Michael Geary
  I suppose this touches on off topic, but ... is it possible 
  to remove an entry completely from a JSON hash?
 
  say I have
  {
  firstString: 'first',
  secondString: 'second'
  }
 
  and evaluate this into a json object, and I want to remove 
  firstString, could I do something like 
  json.remove(json.firstString); 

 I think
 
 json.firstString = null
 
 or
 
 delete json.firstString
 
 work (although IIRC delete is not supported by IE 5.5 or earlier).

json.firstString = null does not delete the property. It merely sets its
value to null.

delete json.firstString actually deletes the property. It is supported by
every browser that jQuery supports.

For IE, the delete operator goes back to JScript 3.0, which was implemented
in IE 4.0.

Here is a handy chart that shows IE version support for JavaScript features:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/ht
ml/440f4924-f7a9-48e0-873e-bd599a93b437.asp

-Mike


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Joel Birch
Assuming the class is set on the 'a' element:

$(a.newWindow).click( ...


On 16/12/2006, at 4:40 AM, Christopher Jordan wrote:

 This should be a quick one.

 I know there's a way to do this, but it escapes me at this time.

 I've got a few a href... tags on my screen, and I want some of  
 them to open in the same window and some to open in a pop up, sized  
 specifically.

 Here's what I've got so far:

 script
 $(document).ready(
 function (){$(a, .newWindow).click(
 function(){
 // there's more than just width and height, but you get  
 the idea.
 var handle = window.open(this.href, 'some_target',  
 'width=550, height=500');
 });
 });
 /script


 I've tried this same idea with the following changes:
... $(a, #newWindow).click(...
 and
... $(a, newWindow).click(...
 and
... $(#newWindow, a).click(...
 and
... $(.newWindow, a).click(...
 and
etc., etc., etc.

 Where am I going wrong. So far in my jQuery experience, I've only  
 had need to find elements by their class, element type, or ID. But  
 not a combination of those. Can someone please hit me with the  
 correct syntax? Hit me hard, so I don't forget it next time. :o)

 Cheers,
 Chris
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Alex Cook
Wait, I'm confused...

 

What does .newWindow relate too?  The code you're using has jQuery
looking for A within .newWindow... Are you trying to find all the A tags
with a class of newwindow?  If so, the constructer would be
$(a.newWindow).  jQuery uses CSS syntax to target things, so if you're
unfamiliar with how to select an element with a class, I'd suggest doing
some googling on it or read the jQuery.com pages on Expressions.

 

Second, you've constructed the click() function wrong... you don't need
the var handle = bit... function () { window.open(this.href,
'some_target', 'width=550, height=550'); } is all you need.

 

-ALEX

 



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Christopher Jordan
Sent: Friday, December 15, 2006 9:40 AM
To: jQuery Discussion.
Subject: [jQuery] I need syntax help, please.

 

This should be a quick one.

I know there's a way to do this, but it escapes me at this time.

I've got a few a href... tags on my screen, and I want some of them to
open in the same window and some to open in a pop up, sized
specifically.

Here's what I've got so far:

script
$(document).ready(
function (){$(a, .newWindow).click(
function(){
// there's more than just width and height, but you get the
idea.
var handle = window.open(this.href, 'some_target',
'width=550, height=500');
});
});
/script


I've tried this same idea with the following changes:
   ... $(a, #newWindow).click(...
and 
   ... $(a, newWindow).click(...
and
   ... $(#newWindow, a).click(...
and
   ... $(.newWindow, a).click(...
and
   etc., etc., etc.

Where am I going wrong. So far in my jQuery experience, I've only had
need to find elements by their class, element type, or ID. But not a
combination of those. Can someone please hit me with the correct syntax?
Hit me hard, so I don't forget it next time. :o)

Cheers,
Chris

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Aaron Heimlich

What you're looking for is probably

$(a.newWindow).click( ... );

which searches for all a elements that have a class of newWindow[1].

The second parameter to $() represents the context in which you are
searching. In other words, it answers the question where does jQuery start
searching from? The context defaults to the entire document, which is why
you don't see it used very often in examples.

Hope this helps,

Aaron

[1] This is standard CSS syntax. A complete list of supported CSS selectors
(which, strangely, doesn't mention the class selector I just showed you) can
be found at http://jquery.com/docs/Base/Expression/CSS/

On 12/15/06, Christopher Jordan [EMAIL PROTECTED] wrote:


 This should be a quick one.

I know there's a way to do this, but it escapes me at this time.

I've got a few a href... tags on my screen, and I want some of them to
open in the same window and some to open in a pop up, sized specifically.

Here's what I've got so far:

script
$(document).ready(
function (){$(a, .newWindow).click(
function(){
// there's more than just width and height, but you get the
idea.
var handle = window.open(this.href, 'some_target', 'width=550,
height=500');
});
});
/script


I've tried this same idea with the following changes:
   ... $(a, #newWindow).click(...
and
   ... $(a, newWindow).click(...
and
   ... $(#newWindow, a).click(...
and
   ... $(.newWindow, a).click(...
and
   etc., etc., etc.

Where am I going wrong. So far in my jQuery experience, I've only had need
to find elements by their class, element type, or ID. But not a combination
of those. Can someone please hit me with the correct syntax? Hit me hard, so
I don't forget it next time. :o)

Cheers,
Chris

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] tablesorter 1.1

2006-12-15 Thread Brice Burgess
justin kelly wrote:

 cant wait for 1.1, jquery will have a proper datagrid (tablesorter + 
 pager + filters = tablesorter1.1 :) )
Hey! + tableEditor too! :)

http://dev.iceburg.net/jquery/tableEditor/example_new.php

please note; the validation library (external) needs updating  I still 
need to merge my deleteRow changes. I ought to setup a bug tracker to 
organize development on this plugin...

~ Brice


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Aaron Heimlich

On 12/15/06, Aaron Heimlich [EMAIL PROTECTED] wrote:


(which, strangely, doesn't mention the class selector I just showed you)



Forget I said that. It's there, I just didn't notice it the first time.

--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Aaron Heimlich

On 12/15/06, Alex Cook [EMAIL PROTECTED] wrote:


 Second, you've constructed the click() function wrong… you don't need the
var handle = bit… function () { window.open(this.href, 'some_target',
'width=550, height=550'); } is all you need.


Actually, IIRC window.open returns a reference to the new window that was
just created, allowing it to be controlled by the developer. So, there's
nothing wrong with his click() function.

FYI -- Also, IIRC, window.open will return null (or false, dunno which) if
the window was somehow prevented from opening; very useful for detecting the
presence of popup blockers.

--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Christopher Jordan
Ah! That's where I've gone wrong. I knew what I had was all a big 
cock-up. I did look at the API first, but still couldn't manage to get 
it to work right. My click function worked just fine (though I know that 
the var handle bit isn't strictly necessary), it's just that *all* of 
my a href... tags were opening via the .click function and not just 
the couple I wanted.


The class isn't one that really exists in a .css file or anything, but 
just something I added in an attempt to do what you've now explained to 
me how to do. I had originally had an ID on each of the a tags that I 
wanted opening up in this special way. If I've got this right now, I 
could do something like:


$(a#newWindow).click(function{});

Is that right? I think I'd rather not use a class, since one doesn't 
really exist that's called newWindow (I just arbitrarily put that 
class on the certain A tags in one of many attempts to get the syntax 
correct. So, I think the ID on each tag would be better. Have I got that 
right?


Cheers,
Chris

Alex Cook wrote:


Wait, I'm confused...

 

What does .newWindow relate too?  The code you're using has jQuery 
looking for A within .newWindow... Are you trying to find all the A 
tags with a class of newwindow?  If so, the constructer would be 
$(a.newWindow).  jQuery uses CSS syntax to target things, so if 
you're unfamiliar with how to select an element with a class, I'd 
suggest doing some googling on it or read the jQuery.com pages on 
Expressions.


 

Second, you've constructed the click() function wrong... you don't 
need the var handle = bit... function () { window.open(this.href, 
'some_target', 'width=550, height=550'); } is all you need.


 


-ALEX

 




*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
*On Behalf Of *Christopher Jordan

*Sent:* Friday, December 15, 2006 9:40 AM
*To:* jQuery Discussion.
*Subject:* [jQuery] I need syntax help, please.

 


This should be a quick one.

I know there's a way to do this, but it escapes me at this time.

I've got a few a href... tags on my screen, and I want some of them 
to open in the same window and some to open in a pop up, sized 
specifically.


Here's what I've got so far:

script
$(document).ready(
function (){$(a, .newWindow).click(
function(){
// there's more than just width and height, but you get 
the idea.
var handle = window.open(this.href, 'some_target', 
'width=550, height=500');

});
});
/script


I've tried this same idea with the following changes:
   ... $(a, #newWindow).click(...
and
   ... $(a, newWindow).click(...
and
   ... $(#newWindow, a).click(...
and
   ... $(.newWindow, a).click(...
and
   etc., etc., etc.

Where am I going wrong. So far in my jQuery experience, I've only had 
need to find elements by their class, element type, or ID. But not a 
combination of those. Can someone please hit me with the correct 
syntax? Hit me hard, so I don't forget it next time. :o)


Cheers,
Chris



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
  
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Off-Topic: Rounded Corners

2006-12-15 Thread Klaus Hartl
Chris Domigan schrieb:
 On 15/12/06, *Erik Beeson* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 Rounded corners are easy:
 
 border-radius: 10px;
 -moz-border-radius: 10px;
 
 And a link to http://www.getfirefox.com/ http://www.getfirefox.com/
 
 --Erik
 
 
 
 And in the latest Firefox 3 Alpha and nightlies, they're now 
 anti-aliased! Very purdy.


Totally off-topic, but: The FF 3 nightlies also pass the Acid-Test ... Yay!


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Manipulating XML

2006-12-15 Thread Klaus Hartl
Pje schrieb:
 Hi,
 
 I need to manipulate a XML that i receive from a request. The XML looks 
 like:
 
 root
 company
 id3/id
 namefoo/name
 /company
 company
 id5/id
 namebar/name
 /company
 /root
 
 There is a way to get the node company that have a specific id?
 
 $('company:nth('5')', xml).text(); will return the 5th node... what i 
 need is the node with id 5. Any tips?

Try

var node;
$('company', xml).each(function() {
 var jqId = $('id', this);
 if (jqId.text() == 5) {
 node = jqId[0];
 return false; // break
 }
});


Maybe this works too:

var node = $('company/id[5]').parent();


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Klaus Hartl
Alex Cook schrieb:
 Wait, I’m confused…
 
  
 
 What does .newWindow relate too?  The code you’re using has jQuery 
 looking for A within .newWindow… Are you trying to find all the A tags 
 with a class of newwindow?  If so, the constructer would be 
 $(“a.newWindow”).  jQuery uses CSS syntax to target things, so if you’re 
 unfamiliar with how to select an element with a class, I’d suggest doing 
 some googling on it or read the jQuery.com pages on Expressions.
 
  
 
 Second, you’ve constructed the click() function wrong… you don’t need 
 the var handle = bit… function () { window.open(this.href, 
 ‘some_target’, ‘width=550, height=550’); } is all you need.
 
  
 
 -ALEX
 
  
 
 
 
 *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 *On Behalf Of *Christopher Jordan
 *Sent:* Friday, December 15, 2006 9:40 AM
 *To:* jQuery Discussion.
 *Subject:* [jQuery] I need syntax help, please.
 
  
 
 This should be a quick one.
 
 I know there's a way to do this, but it escapes me at this time.
 
 I've got a few a href... tags on my screen, and I want some of them to 
 open in the same window and some to open in a pop up, sized specifically.
 
 Here's what I've got so far:
 
 script
 $(document).ready(
 function (){$(a, .newWindow).click(
 function(){
 // there's more than just width and height, but you get the 
 idea.
 var handle = window.open(this.href, 'some_target', 
 'width=550, height=500');
 });
 });
 /script
 
 
 I've tried this same idea with the following changes:
... $(a, #newWindow).click(...
 and
... $(a, newWindow).click(...
 and
... $(#newWindow, a).click(...
 and
... $(.newWindow, a).click(...
 and
etc., etc., etc.
 
 Where am I going wrong. So far in my jQuery experience, I've only had 
 need to find elements by their class, element type, or ID. But not a 
 combination of those. Can someone please hit me with the correct syntax? 
 Hit me hard, so I don't forget it next time. :o)
 
 Cheers,
 Chris


And there shouldn't be a white space in the options string:
'width=550,height=500'


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Empty each text field

2006-12-15 Thread Klaus Hartl
Chris Domigan schrieb:
 Mungbeans - remember this in the context you are using it is a normal 
 DOM node, so you can't use jQuery methods like .val on it. You can do 
 $(this).val() instead.


In that case I'd rather use this.value = ''

That saves a nearly needless jQuery object creation. But Blair's suggestion

$('[EMAIL PROTECTED]text]').val();

is more elegant anyway.


-- Klaus




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] highlightFade's source code missing...

2006-12-15 Thread aedmonds

Hey everybody,

It seems that the maintainer at http://jquery.offput.ca/highlightFade/ has
some problems with the site. I can't access any of the code for the
highlightFade plugin. It's not available in the jQuery SVN either.

Could someone please post the uncompressed code for me?

Thanks a bunch,

-A
-- 
View this message in context: 
http://www.nabble.com/highlightFade%27s-source-code-missing...-tf2828595.html#a7896410
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] CSS Selector help

2006-12-15 Thread blemming

I have a few divs on a page that are ABSOUTELY positioned inside a TD tag

table
tr
td
div class=color_view style=position:absolute;color view/div
 img src=.. 
div style=position:absolute;display:hidden;Color Options/div/td
/tr
/table

When the user clicks the img the second hidden div is displayed showing
options.  When the user clicks on the option color I would like to then
change the background color of the first div.  I can't seem to access it via
the 
ancestors('color_view') function because of its absolute positioning.  Is
there any way to access via css selector or do I need to pass some sort of
id variable?

Thanks, David

 
-- 
View this message in context: 
http://www.nabble.com/CSS-Selector-help-tf2828575.html#a7896339
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] WEIRD IE page not displaying problem

2006-12-15 Thread bmsterling

I am going to have to agree, can you send us a url to check out?
-- 
View this message in context: 
http://www.nabble.com/WEIRD-IE-page-not-displaying-problem-tf2828172.html#a7895973
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Christopher Jordan
Yeah, Klaus. That space doesn't really exist in my code (though I don't 
think it matters... not to IE any way), it was just because I was typing 
it as quickly as I could. :o)


Cheers,
Chris

Klaus Hartl wrote:

Alex Cook schrieb:
  

Wait, I’m confused…

 

What does .newWindow relate too?  The code you’re using has jQuery 
looking for A within .newWindow… Are you trying to find all the A tags 
with a class of newwindow?  If so, the constructer would be 
$(“a.newWindow”).  jQuery uses CSS syntax to target things, so if you’re 
unfamiliar with how to select an element with a class, I’d suggest doing 
some googling on it or read the jQuery.com pages on Expressions.


 

Second, you’ve constructed the click() function wrong… you don’t need 
the var handle = bit… function () { window.open(this.href, 
‘some_target’, ‘width=550, height=550’); } is all you need.


 


-ALEX

 




*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
*On Behalf Of *Christopher Jordan

*Sent:* Friday, December 15, 2006 9:40 AM
*To:* jQuery Discussion.
*Subject:* [jQuery] I need syntax help, please.

 


This should be a quick one.

I know there's a way to do this, but it escapes me at this time.

I've got a few a href... tags on my screen, and I want some of them to 
open in the same window and some to open in a pop up, sized specifically.


Here's what I've got so far:

script
$(document).ready(
function (){$(a, .newWindow).click(
function(){
// there's more than just width and height, but you get the 
idea.
var handle = window.open(this.href, 'some_target', 
'width=550, height=500');

});
});
/script


I've tried this same idea with the following changes:
   ... $(a, #newWindow).click(...
and
   ... $(a, newWindow).click(...
and
   ... $(#newWindow, a).click(...
and
   ... $(.newWindow, a).click(...
and
   etc., etc., etc.

Where am I going wrong. So far in my jQuery experience, I've only had 
need to find elements by their class, element type, or ID. But not a 
combination of those. Can someone please hit me with the correct syntax? 
Hit me hard, so I don't forget it next time. :o)


Cheers,
Chris




And there shouldn't be a white space in the options string:
'width=550,height=500'


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

  
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Help with drop down menus

2006-12-15 Thread blemming

Thought I'd post that I ended up solving my issue by utilizing the hover()
function and just hiding the menu on mouseout.


blemming wrote:
 
 I'm trying to create a few drop down option menus that are contained in
 divs which are initially not displayed.  There each have a image dropdown
 image with class = div_color. Here is how I am opening the boxes and
 closing any others that were left open.  
 
 $(.box_color).click(function ()
   {
   $(.div_color).hide();
   $(this).next().show();
   }   
 )
 
 My question is how do I create an event that will hide() the divs if the
 user clicks anywhere else on the screen?  I'm new to jQuery so I'm
 thinking something along these lines might work but I don't know how to
 properly write the css selector. 
 
 // DOESNT WORK 
 $('body:not(.div_color)').click(function(){
   $(.div_color).hide();
   }
 )
 
 Thanks for your help! David
 

-- 
View this message in context: 
http://www.nabble.com/Help-with-drop-down-menus-tf2821960.html#a7894343
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread blemming

try, 
 
$(a#newWindow).click(...

David


Christopher Jordan-2 wrote:
 
 This should be a quick one.
 
 I know there's a way to do this, but it escapes me at this time.
 
 I've got a few   tags on my screen, and I want some of them to 
 open in the same window and some to open in a pop up, sized specifically.
 
 Here's what I've got so far:
 
 script
 $(document).ready(
 function (){$(a, .newWindow).click(
 function(){
 // there's more than just width and height, but you get the 
 idea.
 var handle = window.open(this.href, 'some_target', 
 'width=550, height=500');
 });
 });
 /script
 
 
 I've tried this same idea with the following changes:
... $(a, #newWindow).click(...
 and
... $(a, newWindow).click(...
 and
... $(#newWindow, a).click(...
 and
... $(.newWindow, a).click(...
 and
etc., etc., etc.
 
 Where am I going wrong. So far in my jQuery experience, I've only had 
 need to find elements by their class, element type, or ID. But not a 
 combination of those. Can someone please hit me with the correct syntax? 
 Hit me hard, so I don't forget it next time. :o)
 
 Cheers,
 Chris
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 

-- 
View this message in context: 
http://www.nabble.com/I-need-syntax-help%2C-please.-tf2828514.html#a7896248
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] jQuery Media Plugins question

2006-12-15 Thread bmsterling

Guess this would directed at malsup, but if anyone else has the answer,
please lend me you input.

I am using the Media plugin and I am not getting the alert about upgrading
to the current flash when using this plugin, what can I do to make sure I
get this alert?  I see how you set the params for the quicktime part, but
what about flash, I need to set some params (ie. wmode) and can't seem to
achieve that without editing the plugin itself.

thanks.

btw, this is the url  http://ierev.informationexperts.com/old_index.htm
http://ierev.informationexperts.com/old_index.htm 
-- 
View this message in context: 
http://www.nabble.com/jQuery-Media-Plugins-question-tf2827989.html#a7894537
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Change href of external links

2006-12-15 Thread agent2026

Having a hard time with this Dave, and I'm afraid the thread has moved a
little ahead of my level.  Here's where I'm at:

var intLink = ['site1.com/','site2.com/'];

function linkExc(){
if (document.getElementsByTagName) {
var a = document.getElementsByTagName(a);
for(var h=0; hintLink.length; h++){
 console.log(intLink[h]);
 for(var i=0; ia.length; i++){
 if(a[i].href.match(intLink[h])){
 console.log(a[i]);
 }
 else {
 a[i].onClick = window.open(this.href.value);
 }
 };
};
}
};

I've resorted to straight js for the meantime as I was having trouble with
jQuery.  One problem is I don't seem to be able to set the onClick event,
though I am able to set other attributes when testing (title, etc.).  

Regardless, I would like to use .bind here, but I'm not sure how to turn
this all into jQuery, or at least making the combination of the two you
suggested, as there is no equivalent to .match that I know of.  The only
solution I see is to put all the matching href values into a new array
(which will hold the FULL urls - args, session ids, etc.), then using .grep
to go through the array and .bind the click event, but that seems excessive. 
Instinct tells me there must be a better way :).

Any help appreciated,
Adam



dave.methvin wrote:
 
 Am I mistaken, or does the string have to match
 exactly in this case? 
 
 Yep, but you could implement a left-case-insensitive match or even a
 regexp-based pattern match. The jQuery part wouldn't change at all.
 
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 

-- 
View this message in context: 
http://www.nabble.com/Change-href-of-external-links-tf2718387.html#a7891064
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Alex Cook
Ahs gotcha... I had spaced on that, I stay away from window.open
like the plague... modal windows for me all the way :-)

 



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Aaron Heimlich
Sent: Friday, December 15, 2006 10:05 AM
To: jQuery Discussion.
Subject: Re: [jQuery] I need syntax help, please.

 

On 12/15/06, Alex Cook [EMAIL PROTECTED] wrote:

Second, you've constructed the click() function wrong... you
don't need the var handle = bit... function () { window.open(this.href,
'some_target', 'width=550, height=550'); } is all you need.

Actually, IIRC window.open returns a reference to the new window that
was just created, allowing it to be controlled by the developer. So,
there's nothing wrong with his click() function. 

FYI -- Also, IIRC, window.open will return null (or false, dunno which)
if the window was somehow prevented from opening; very useful for
detecting the presence of popup blockers.

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

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] highlightFade's source code missing...

2006-12-15 Thread Remy Sharp

/*
jQuery Plugin highlightFade (jquery.offput.ca/highlightFade)
(c) 2006 Blair Mitchelmore (offput.ca) [EMAIL PROTECTED]
*/
/*
(The inline documentation has returned until I can publish it on a page)
Usage: 
$(whatever).hightlightFade(color,duration,complete,iterator);

$(whatever).highlightFade({color:whatever,duration:whatever,complete:whatever,iterator:whatever});
Description:
This plugin allows for simple yellow fade technique which was
popularized
by 37signals.com but this can highlight in any colour. It 
always fades to 
the current background of the element but if the need for 
specifying the 
final colour is requested I'll consider adding it (or you could 
do it
yourself :)).
Arguments:
color: Defines the color at which to begin fading
- a w3c css compatable color code (ie rgb(1,2,3), #ccc, 
#ed3e23)
  or a w3c spec color name (ie blue, red, gray, et. al.)
- Default value: rgb(250,250,200)
duration: Defines the speed at which the color fades away
- a jQuery speed string (ie slow, fast) or a duration 
in milliseconds
- Default value: default value of jQuery's $.speed 
function
complete: Defines a function to call once the colour fade has 
finished
- Can be anything you want it to be. You can access the 
element on which
  the fade was applied via the this variable.
- Default value: no action
iterator: Defines the method by which we move from the starting 
color to
the final.
- Can be a string representing one of the built in 
fading algorithms (ie
'linear',
  'sinusoidal', or 'exponential') or a custom function 
of your design.
The custom
  function must take as it's arguments the start value, 
the final value,
the total 
  number of steps and the current step.
- Linear is an even colour progression, Sinusoidal 
changes in the
beginning fast but 
  slows as it approaches disappearing, Exponential 
changes slowly in the
beginning
  but increases its colour change per step as time goes 
on.
- Default value: linear
Notes: 
- Any arguments can be set to the default by setting them as 
null in the
function call
- Any arguments not specified in the Object notation are also 
taken as the
default value
Examples:
- Do a red exponential highlightFade on all p elements on the 
page at a
crawl speed
  $('p').highlightFade({color'red','crawl',null,'exponential')
- Do a bluish sinusoidal highlightFade on all div's with a 
class of 'new'
and remove it afterwards
  $('div.new').highlightFade('rgb(128,128,255)',null,function() 
{
$(this).remove() },'sinusoidal');
- Just do a plain old linear yellow fade on 'this'
  $(this).highlightFade();
*/

$.fn.highlightFade = function(colour,settings) {
if (typeof settings != 'object') settings = {
color: arguments[0], 
speed: arguments[1], 
complete: arguments[2], 
iterator: arguments[3]
};
if (typeof colour != 'object' || (colour  colour.constructor == 
Array))
settings['color'] = colour;
else settings = colour;
var o = settings;
var ts = {
'linear': function(s,e,t,c) { return parseInt(s+(c/t)*(e-s)); },
'sinusoidal': function(s,e,t,c) { return
parseInt(s+Math.sin(((c/t)*90)*(Math.PI/180))*(e-s)); },
'exponential': function(s,e,t,c) { return
parseInt(s+(Math.pow(c/t,2))*(e-s)); }
};
var t = (o['iterator']  o['iterator'].constructor == Function) ?
o['iterator'] : ts[o['iterator']] || ts['linear'];
return this.each(function() {
var i = 50;
var e = (this.highlighting) ? this.highlighting.end :
$.highlightFade.getBGColor(this) || [255,255,255];
var c = $.highlightFade.getRGB(o['color'] || [255,255,128]);
var s = $.speed(o['speed'],o['complete']);
var r = (this.highlighting  this.highlighting.orig) ?
this.highlighting.orig : $.curCSS(this,'backgroundColor');
if (this.highlighting  this.highlighting.timer)
window.clearInterval(this.highlighting.timer);
this.highlighting = { steps: ((s.duration) / i), interval: i, 
currentStep:
0, start: c, end: e, orig: r };
$.highlightFade(this,s.complete,t);
});
};

$.highlightFade = function(e,o,t) {

Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Aaron Heimlich

If you've got many links on the page that you want to open in a new window,
then a class is the best way to go. It doesn't matter whether it actually
exists in your CSS or not -- if it's in the a element's class attribute,
jQuery will find it.

BTW, $(#newWindow) is alot faster than $(a#newWindow). See
http://aheimlich.freepgs.com/javascript/jquery-selector-speed/ for more
info.

On 12/15/06, Christopher Jordan [EMAIL PROTECTED] wrote:


 Ah! That's where I've gone wrong. I knew what I had was all a big
cock-up. I did look at the API first, but still couldn't manage to get it to
work right. My click function worked just fine (though I know that the var
handle bit isn't strictly necessary), it's just that *all* of my a
href... tags were opening via the .click function and not just the couple I
wanted.

The class isn't one that really exists in a .css file or anything, but
just something I added in an attempt to do what you've now explained to me
how to do. I had originally had an ID on each of the a tags that I wanted
opening up in this special way. If I've got this right now, I could do
something like:

$(a#newWindow).click(function{});

Is that right? I think I'd rather not use a class, since one doesn't
really exist that's called newWindow (I just arbitrarily put that class on
the certain A tags in one of many attempts to get the syntax correct. So, I
think the ID on each tag would be better. Have I got that right?

Cheers,
Chris

Alex Cook wrote:

 Wait, I'm confused…



What does .newWindow relate too?  The code you're using has jQuery looking
for A within .newWindow… Are you trying to find all the A tags with a class
of newwindow?  If so, the constructer would be $(a.newWindow).  jQuery
uses CSS syntax to target things, so if you're unfamiliar with how to select
an element with a class, I'd suggest doing some googling on it or read the
jQuery.com pages on Expressions.



Second, you've constructed the click() function wrong… you don't need the
var handle = bit… function () { window.open(this.href, 'some_target',
'width=550, height=550'); } is all you need.



-ALEX


 --

*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED][EMAIL PROTECTED]]
*On Behalf Of *Christopher Jordan
*Sent:* Friday, December 15, 2006 9:40 AM
*To:* jQuery Discussion.
*Subject:* [jQuery] I need syntax help, please.



This should be a quick one.

I know there's a way to do this, but it escapes me at this time.

I've got a few a href... tags on my screen, and I want some of them to
open in the same window and some to open in a pop up, sized specifically.

Here's what I've got so far:

script
$(document).ready(
function (){$(a, .newWindow).click(
function(){
// there's more than just width and height, but you get the
idea.
var handle = window.open(this.href, 'some_target', 'width=550,
height=500');
});
});
/script


I've tried this same idea with the following changes:
   ... $(a, #newWindow).click(...
and
   ... $(a, newWindow).click(...
and
   ... $(#newWindow, a).click(...
and
   ... $(.newWindow, a).click(...
and
   etc., etc., etc.

Where am I going wrong. So far in my jQuery experience, I've only had need
to find elements by their class, element type, or ID. But not a combination
of those. Can someone please hit me with the correct syntax? Hit me hard, so
I don't forget it next time. :o)

Cheers,
Chris

--

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


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Alex Cook
Yep, you've got it... tho if there are multiple links on the page you
want this too happen with, class is better, two of the same IDs on a
page is bad.  Regardless of the class being in the CSS file or not, it's
a unique identifier for a group of elements.

 



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Christopher Jordan
Sent: Friday, December 15, 2006 10:10 AM
To: jQuery Discussion.
Subject: Re: [jQuery] I need syntax help, please.

 

Ah! That's where I've gone wrong. I knew what I had was all a big
cock-up. I did look at the API first, but still couldn't manage to get
it to work right. My click function worked just fine (though I know that
the var handle bit isn't strictly necessary), it's just that *all* of
my a href... tags were opening via the .click function and not just
the couple I wanted.

The class isn't one that really exists in a .css file or anything, but
just something I added in an attempt to do what you've now explained to
me how to do. I had originally had an ID on each of the a tags that I
wanted opening up in this special way. If I've got this right now, I
could do something like:

$(a#newWindow).click(function{});

Is that right? I think I'd rather not use a class, since one doesn't
really exist that's called newWindow (I just arbitrarily put that
class on the certain A tags in one of many attempts to get the syntax
correct. So, I think the ID on each tag would be better. Have I got that
right?

Cheers,
Chris

Alex Cook wrote: 

Wait, I'm confused...

 

What does .newWindow relate too?  The code you're using has jQuery
looking for A within .newWindow... Are you trying to find all the A tags
with a class of newwindow?  If so, the constructer would be
$(a.newWindow).  jQuery uses CSS syntax to target things, so if you're
unfamiliar with how to select an element with a class, I'd suggest doing
some googling on it or read the jQuery.com pages on Expressions.

 

Second, you've constructed the click() function wrong... you don't need
the var handle = bit... function () { window.open(this.href,
'some_target', 'width=550, height=550'); } is all you need.

 

-ALEX

 



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Christopher Jordan
Sent: Friday, December 15, 2006 9:40 AM
To: jQuery Discussion.
Subject: [jQuery] I need syntax help, please.

 

This should be a quick one.

I know there's a way to do this, but it escapes me at this time.

I've got a few a href... tags on my screen, and I want some of them to
open in the same window and some to open in a pop up, sized
specifically.

Here's what I've got so far:

script
$(document).ready(
function (){$(a, .newWindow).click(
function(){
// there's more than just width and height, but you get the
idea.
var handle = window.open(this.href, 'some_target',
'width=550, height=500');
});
});
/script


I've tried this same idea with the following changes:
   ... $(a, #newWindow).click(...
and 
   ... $(a, newWindow).click(...
and
   ... $(#newWindow, a).click(...
and
   ... $(.newWindow, a).click(...
and
   etc., etc., etc.

Where am I going wrong. So far in my jQuery experience, I've only had
need to find elements by their class, element type, or ID. But not a
combination of those. Can someone please hit me with the correct syntax?
Hit me hard, so I don't forget it next time. :o)

Cheers,
Chris

 







 
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
  
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Jquery Flash Plugin the FlashBlock Extension

2006-12-15 Thread Luke Lutman
Agreed, Klaus ... but Sam's not trying to get around it ;-)

He just wants alternate content to show when flash is blocked, rather than the 
big ugly 'click 
to play the flash movie' placeholder that FlashBlock stuffs in.

FWIW, I think FlashBlock is pretty silly...

Luke

Klaus Hartl wrote:
 Sam Sherlock schrieb:
 I have noticed that the flash plugin does not work with the flashBlock 
 firefox extension
 whereas the both swfObject, UFO  sIFR do work with the extension.

 In firefox with flashBlock installed and blocking flash content the 
 flash is not displayed
 nor is the content that it replaces.

 I have looked at the source but its a bit beyond me.  Would this be 
 complicated to
 build into the plugin?
 
 My €0.02: If a user uses flashbock he actually *wants* to block flash, 
 so why should one try to get around this? Why pissing off the user?
 
 
 -- Klaus
 
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


-- 
zinc Roe Design
www.zincroe.com
(647) 477-6016

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] CSS Selector help

2006-12-15 Thread Klaus Hartl
blemming schrieb:
 I have a few divs on a page that are ABSOUTELY positioned inside a TD tag
 
 table
 tr
 td
 div class=color_view style=position:absolute;color view/div
  img src=.. 
 div style=position:absolute;display:hidden;Color Options/div/td
 /tr
 /table
 
 When the user clicks the img the second hidden div is displayed showing
 options.  When the user clicks on the option color I would like to then
 change the background color of the first div.  I can't seem to access it via
 the 
 ancestors('color_view') function because of its absolute positioning.  Is
 there any way to access via css selector or do I need to pass some sort of
 id variable?
 
 Thanks, David

Absolute positioning has absolutely no influence on the HTML structure, 
thus it will not affect a possible selector.

Because you are talking of ancestors I assume that's the problem here. 
The second div is not an ancestor but a sibling of the other one.

Try:

prev('.color_view')

There was also missing a period in the class selector.


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Manipulating XML

2006-12-15 Thread John Resig
You can try using :contains() and [...]

$(company[id:contains(5)])

That effectively means: Find all company elements that has an element
inside of it (named 'id') that contains the text '5'.

--John

On 12/15/06, Pje [EMAIL PROTECTED] wrote:
 Hi,

 I need to manipulate a XML that i receive from a request. The XML looks
 like:

 root
 company
 id3/id
 namefoo/name
 /company
 company
 id5/id
 namebar/name
 /company
 /root

 There is a way to get the node company that have a specific id?

 $('company:nth('5')', xml).text(); will return the 5th node... what i need
 is the node with id 5. Any tips?

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Manipulating XML

2006-12-15 Thread Pje

Thanks Klaus, I'm using an each like u said.

I'm looking for something like the second one, but unfortunately this didnt
work.

On 12/15/06, Klaus Hartl [EMAIL PROTECTED] wrote:


Pje schrieb:
 Hi,

 I need to manipulate a XML that i receive from a request. The XML looks
 like:

 root
 company
 id3/id
 namefoo/name
 /company
 company
 id5/id
 namebar/name
 /company
 /root

 There is a way to get the node company that have a specific id?

 $('company:nth('5')', xml).text(); will return the 5th node... what i
 need is the node with id 5. Any tips?

Try

var node;
$('company', xml).each(function() {
 var jqId = $('id', this);
 if (jqId.text() == 5) {
 node = jqId[0];
 return false; // break
 }
});


Maybe this works too:

var node = $('company/id[5]').parent();


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Media Plugins question

2006-12-15 Thread Mike Alsup
 I am using the Media plugin and I am not getting the alert about upgrading
 to the current flash when using this plugin, what can I do to make sure I
 get this alert?  I see how you set the params for the quicktime part, but
 what about flash, I need to set some params (ie. wmode) and can't seem to
 achieve that without editing the plugin itself.

Just add your params and/or flashvars to the options arg.  For example

var options = {
params = { wmode: 'wmodeValue', anotherParam: 'val' },
flashvars = { var1: 'value1', var2: 'value2' }
};

$(...).flash(options);

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Manipulating XML

2006-12-15 Thread Pje

Thanks John, worked fine here. :)

I was looking for something like that.

On 12/15/06, John Resig [EMAIL PROTECTED] wrote:


You can try using :contains() and [...]

$(company[id:contains(5)])

That effectively means: Find all company elements that has an element
inside of it (named 'id') that contains the text '5'.

--John

On 12/15/06, Pje [EMAIL PROTECTED] wrote:
 Hi,

 I need to manipulate a XML that i receive from a request. The XML looks
 like:

 root
 company
 id3/id
 namefoo/name
 /company
 company
 id5/id
 namebar/name
 /company
 /root

 There is a way to get the node company that have a specific id?

 $('company:nth('5')', xml).text(); will return the 5th node... what i
need
 is the node with id 5. Any tips?

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Jquery Flash Plugin the FlashBlock Extension

2006-12-15 Thread Sam Sherlock

Exactly right, looking back at my explanation I can see how this is
confusing.

When I said work in the same way as the other options, I block content using
flashBlock by default :)

I tried to rewrite my original message but had little joy with finding
better wording.

I should have said how can I make the alternative content display when using
the flash plugin with flashBlock (firefox extension)

the more I can make a site adapt to the users BVP 
settings/options/preferences the better

atb -S

On 15/12/06, Luke Lutman [EMAIL PROTECTED] wrote:


Agreed, Klaus ... but Sam's not trying to get around it ;-)

He just wants alternate content to show when flash is blocked, rather than
the big ugly 'click
to play the flash movie' placeholder that FlashBlock stuffs in.

FWIW, I think FlashBlock is pretty silly...

Luke

Klaus Hartl wrote:
 Sam Sherlock schrieb:
 I have noticed that the flash plugin does not work with the flashBlock
 firefox extension
 whereas the both swfObject, UFO  sIFR do work with the extension.

 In firefox with flashBlock installed and blocking flash content the
 flash is not displayed
 nor is the content that it replaces.

 I have looked at the source but its a bit beyond me.  Would this be
 complicated to
 build into the plugin?

 My €0.02: If a user uses flashbock he actually *wants* to block flash,
 so why should one try to get around this? Why pissing off the user?


 -- Klaus


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


--
zinc Roe Design
www.zincroe.com
(647) 477-6016

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Change href of external links

2006-12-15 Thread Jonathan Sharp

On 12/14/06, Dave Methvin [EMAIL PROTECTED] wrote:


 Uh oh, I know what it is. It's a bug in pushStack.

If the last arg to pushStack is a function, it does .each(fn) with the
filtered set but returns the original set. If there are two trailing
function args, the first is treated as above. However, if the filtered set
returned nothing (and thus fn was never called) it does .each(fn2) with the
original set. Kind of like an if-then-else. It's never been documented but I
think it will be eventually.

I think this should fix it:

 pushStack: function(a,args) {
  var fn = args  args.length  1  args[args.length-1];
  var fn2 = args  args.length  2  args[args.length-2];



Has this been fixed in svn or has a bug ticket been opened?

Cheers,
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Remove from JSON

2006-12-15 Thread Brice Burgess
Andreas Wahlin wrote:
 I suppose this touches on off topic, but ... is it possible to remove  
 an entry completely from a JSON hash?

 say I have
 {
 firstString: 'first',
 secondString: 'second'
 }

 and evaluate this into a json object, and I want to remove  
 firstString, could I do something like
 json.remove(json.firstString);
 ?
   

You could do a regex replace on the JSON string before it's eval'd (so 
that the property never gets added to the object);

  e.g.

script type=text/javascript
 var jsonStr = { firstString: 'first', secondString: 'second', 
thirdString: 'third' };
 eval(var json =  + jsonStr.replace(/,?\s?secondString:\s?'.*?'/, ''));

 if(typeof(json.secondString) == 'undefined')
   alert('worked');
/script

While this would result in json being an object with properties 
firstString and thirdString, it would probably be easier (and not 
reliant on a potentially faulty regEx) to just delete the property from 
the eval'd object via;

delete json.secondString;

~ Brice



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Change href of external links

2006-12-15 Thread Jonathan Sharp

On 12/15/06, agent2026 [EMAIL PROTECTED] wrote:



Having a hard time with this Dave, and I'm afraid the thread has moved a
little ahead of my level.  Here's where I'm at:

var intLink = ['site1.com/','site2.com/'];

function linkExc(){
if (document.getElementsByTagName) {
var a = document.getElementsByTagName(a);
for(var h=0; hintLink.length; h++){
 console.log(intLink[h]);
 for(var i=0; ia.length; i++){
 if(a[i].href.match(intLink[h])){
 console.log(a[i]);
 }
 else {
 a[i].onClick = window.open(
this.href.value);



Try: $(a[i]).bind('click', function(){ window.open(this.href.value) });

also for pure JavaScript the events are onclick instead of onClick...

}

 };
};
}
};

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Klaus Hartl
Alex Cook schrieb:
 Yep, you’ve got it… tho if there are multiple links on the page you want 
 this too happen with, class is better, two of the same IDs on a page is 
 bad.  Regardless of the class being in the CSS file or not, it’s a 
 unique identifier for a group of elements.

Yes, the class attribute isn't only meant to be a style sheet selector:

The class attribute, on the other hand, assigns one or more class names 
to an element; the element may be said to belong to these classes. A 
class name may be shared by several element instances. The class 
attribute has several roles in HTML:

 * As a style sheet selector (when an author wishes to assign style 
information to a set of elements).
 * For general purpose processing by user agents.


http://www.w3.org/TR/html401/struct/global.html#h-7.5.2

Wow, I should get money everytime I post that quote on this list :-)



- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Change href of external links

2006-12-15 Thread Dave Methvin
 Has this been fixed in svn or has a bug ticket been opened?
 
I just opened two tickets.
 
pushStack bug:
http://jquery.com/dev/bugs/bug/511/
 
Document functions on destructive methods:
http://jquery.com/dev/bugs/bug/512/

 
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Plugin: Mousehold

2006-12-15 Thread Remy Sharp

I've written a simple plugin that keeps firing the specified function while
the mouse button is held down (i.e. a repeat action).

Here it is:

http://leftlogic.com/jquery/mousehold.js

Here's a bit more detail on how it works - along with an example:

http://remysharp.com/2006/12/15/jquery-mousehold-event/

Any feedback or bugs please let me know.

Cheers,

Remy Sharp.
-- 
View this message in context: 
http://www.nabble.com/Plugin%3A-Mousehold-tf2828870.html#a7897334
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] highlightFade's source code missing...

2006-12-15 Thread aedmonds

Thanks Remy...

I love the jQuery community!

-A


Remy Sharp wrote:
 
 /*
   jQuery Plugin highlightFade (jquery.offput.ca/highlightFade)
   (c) 2006 Blair Mitchelmore (offput.ca) [EMAIL PROTECTED]
 */
 /*
   (The inline documentation has returned until I can publish it on a page)
   Usage: 
   $(whatever).hightlightFade(color,duration,complete,iterator);
   
 $(whatever).highlightFade({color:whatever,duration:whatever,complete:whatever,iterator:whatever});
   Description:
   This plugin allows for simple yellow fade technique which was
 popularized
   by 37signals.com but this can highlight in any colour. It 
 always fades
 to 
   the current background of the element but if the need for 
 specifying the 
   final colour is requested I'll consider adding it (or you could 
 do it
 yourself :)).
   Arguments:
   color: Defines the color at which to begin fading
   - a w3c css compatable color code (ie rgb(1,2,3), #ccc, 
 #ed3e23)
 or a w3c spec color name (ie blue, red, gray, et. al.)
   - Default value: rgb(250,250,200)
   duration: Defines the speed at which the color fades away
   - a jQuery speed string (ie slow, fast) or a duration 
 in milliseconds
   - Default value: default value of jQuery's $.speed 
 function
   complete: Defines a function to call once the colour fade has 
 finished
   - Can be anything you want it to be. You can access the 
 element on
 which
 the fade was applied via the this variable.
   - Default value: no action
   iterator: Defines the method by which we move from the starting 
 color to
 the final.
   - Can be a string representing one of the built in 
 fading algorithms
 (ie 'linear',
 'sinusoidal', or 'exponential') or a custom function 
 of your design.
 The custom
 function must take as it's arguments the start value, 
 the final
 value, the total 
 number of steps and the current step.
   - Linear is an even colour progression, Sinusoidal 
 changes in the
 beginning fast but 
 slows as it approaches disappearing, Exponential 
 changes slowly in
 the beginning
 but increases its colour change per step as time goes 
 on.
   - Default value: linear
   Notes: 
   - Any arguments can be set to the default by setting them as 
 null in the
 function call
   - Any arguments not specified in the Object notation are also 
 taken as
 the default value
   Examples:
   - Do a red exponential highlightFade on all p elements on the 
 page at a
 crawl speed
 $('p').highlightFade({color'red','crawl',null,'exponential')
   - Do a bluish sinusoidal highlightFade on all div's with a 
 class of
 'new' and remove it afterwards
 $('div.new').highlightFade('rgb(128,128,255)',null,function() 
 {
 $(this).remove() },'sinusoidal');
   - Just do a plain old linear yellow fade on 'this'
 $(this).highlightFade();
 */
 
 $.fn.highlightFade = function(colour,settings) {
   if (typeof settings != 'object') settings = {
   color: arguments[0], 
   speed: arguments[1], 
   complete: arguments[2], 
   iterator: arguments[3]
   };
   if (typeof colour != 'object' || (colour  colour.constructor == 
 Array))
 settings['color'] = colour;
   else settings = colour;
   var o = settings;
   var ts = {
   'linear': function(s,e,t,c) { return parseInt(s+(c/t)*(e-s)); },
   'sinusoidal': function(s,e,t,c) { return
 parseInt(s+Math.sin(((c/t)*90)*(Math.PI/180))*(e-s)); },
   'exponential': function(s,e,t,c) { return
 parseInt(s+(Math.pow(c/t,2))*(e-s)); }
   };
   var t = (o['iterator']  o['iterator'].constructor == Function) ?
 o['iterator'] : ts[o['iterator']] || ts['linear'];
   return this.each(function() {
   var i = 50;
   var e = (this.highlighting) ? this.highlighting.end :
 $.highlightFade.getBGColor(this) || [255,255,255];
   var c = $.highlightFade.getRGB(o['color'] || [255,255,128]);
   var s = $.speed(o['speed'],o['complete']);
   var r = (this.highlighting  this.highlighting.orig) ?
 this.highlighting.orig : $.curCSS(this,'backgroundColor');
   if (this.highlighting  this.highlighting.timer)
 window.clearInterval(this.highlighting.timer);
   this.highlighting = { steps: ((s.duration) / i), interval: i,
 currentStep: 0, start: c, end: e, orig: r };
   $.highlightFade(this,s.complete,t);
   });
 

Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Christopher Jordan

Thanks everyone! :o)

It looks like you're all saying the same thing. Using the class as an 
identifier on the A tag is faster, and duplicate IDs are bad (which I 
kinda knew already, but wasn't sure about the proper usage of the class 
attribute). So I should stick with (in this case at least) using a class 
to identify the A tags that I want to open in new windows.


I was avoiding using just $(.newWindow), or $(#newWindow), because 
then jQuery has to search the whole document for that class or ID. 
Whereas if I use $(a.newWindow) or $(a#newWindow), it's faster 
because jQuery then only examines the A tags, and nothing else. Am I 
right in thinking that. I'm pretty sure I read something to that affect 
on this list, as some point.


So I'll use $(a.newWindow).click(... as my selector. Does that sound 
about right? Is it the best approach?


Thanks,
Chris

Klaus Hartl wrote:

Alex Cook schrieb:
  
Yep, you’ve got it… tho if there are multiple links on the page you want 
this too happen with, class is better, two of the same IDs on a page is 
bad.  Regardless of the class being in the CSS file or not, it’s a 
unique identifier for a group of elements.



Yes, the class attribute isn't only meant to be a style sheet selector:

The class attribute, on the other hand, assigns one or more class names 
to an element; the element may be said to belong to these classes. A 
class name may be shared by several element instances. The class 
attribute has several roles in HTML:


 * As a style sheet selector (when an author wishes to assign style 
information to a set of elements).

 * For general purpose processing by user agents.


http://www.w3.org/TR/html401/struct/global.html#h-7.5.2

Wow, I should get money everytime I post that quote on this list :-)



- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

  
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] highlightFade's source code missing...

2006-12-15 Thread Remy Sharp

No problem - it's a great little plugin.


aedmonds wrote:
 
 Thanks Remy...
 
 I love the jQuery community!
 
 
-- 
View this message in context: 
http://www.nabble.com/highlightFade%27s-source-code-missing...-tf2828595.html#a7897553
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Erik Beeson
  I was avoiding using just $(.newWindow), or $(#newWindow), because then 
 jQuery has to search the whole document for that class or ID. Whereas if I 
 use $(a.newWindow) or $(a#newWindow), it's faster because jQuery then 
 only examines the A tags, and nothing else. Am I right in thinking that. I'm 
 pretty sure I read something to that affect on this list, as some point.


Half right, $(.newWindow) selects all tags and searches their
classes for newWindow. $(a.newWindow) selects all a tags and
searches their classes for newWindow. Fewer tags to search so the
a.newWindow version is faster. In the case of $(#newWindow), jQuery
uses the browser's native document.getElementById function to go
straight to the correct element. $(a#newWindow) selects all a
tags, then searches them for the one who's id is newWindow, so it's
actually slower than $(#newWindow).

But in your case, you're probably going to have more than one
newWindow, so you want a class.

  So I'll use $(a.newWindow).click(... as my selector. Does that sound about 
 right? Is it the best approach?

Yes.

--Erik

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin: Mousehold

2006-12-15 Thread Erik Beeson
This is probably a corner case that isn't worth dealing with, but
while I was holding one of the arrows, I accidentally bumped the right
mouse button, which brought up the right-click menu. Whoops, I
thought to myself, and clicked off in the white space of the page to
get rid of it. When I looked back at the textfield, it was still
spinning away, and no amount of clicking on either arrow would get it
to stop.

I assume clicking again fired another 'hold' event, but you might want
to make it so all hold events for a particular element are cleared on
mouseup/mouseout. Maybe at the beginning of mousedown, check to see if
interval is already running and clear it if it is? Or maybe it's not
worth messing with.

Nice plugin :)

--Erik

On 12/15/06, Remy Sharp [EMAIL PROTECTED] wrote:

 I've written a simple plugin that keeps firing the specified function while
 the mouse button is held down (i.e. a repeat action).

 Here it is:

 http://leftlogic.com/jquery/mousehold.js

 Here's a bit more detail on how it works - along with an example:

 http://remysharp.com/2006/12/15/jquery-mousehold-event/

 Any feedback or bugs please let me know.

 Cheers,

 Remy Sharp.
 --
 View this message in context: 
 http://www.nabble.com/Plugin%3A-Mousehold-tf2828870.html#a7897334
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin: Mousehold

2006-12-15 Thread John Resig
This is a fantastic plugin!

The only suggestion that I have is to reverse the order of the arguments:
$(...).mousehold( 100, function(){ ... } );

and make the timeout argument optional. That way you can still write:
$(...).mousehold( function(){ ... } );

This makes it more consistent with the style of other jQuery methods
(having the callback always be last!)

Also, it may make sense to have the default timeout be something like
'100' - as a timeout of 1 second seems to be kind of useless (IMO).

--John

On 12/15/06, Remy Sharp [EMAIL PROTECTED] wrote:

 I've written a simple plugin that keeps firing the specified function while
 the mouse button is held down (i.e. a repeat action).

 Here it is:

 http://leftlogic.com/jquery/mousehold.js

 Here's a bit more detail on how it works - along with an example:

 http://remysharp.com/2006/12/15/jquery-mousehold-event/

 Any feedback or bugs please let me know.

 Cheers,

 Remy Sharp.
 --
 View this message in context: 
 http://www.nabble.com/Plugin%3A-Mousehold-tf2828870.html#a7897334
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin: Mousehold

2006-12-15 Thread Remy Sharp

Cheers for the feedback.

I've quickly swapped over the args and changed the default 1/10th of second
(you're right, once a second is pretty useless!)

I've also tweaked mouse down tracking as suggested by Erik to use a global
flag - otherwise you can some crazy events firing!

Thanks again.


John Resig wrote:
 
 This is a fantastic plugin!
 
 The only suggestion that I have is to reverse the order of the arguments:
 $(...).mousehold( 100, function(){ ... } );
 
 and make the timeout argument optional. That way you can still write:
 $(...).mousehold( function(){ ... } );
 
 This makes it more consistent with the style of other jQuery methods
 (having the callback always be last!)
 
 Also, it may make sense to have the default timeout be something like
 '100' - as a timeout of 1 second seems to be kind of useless (IMO).
 
 --John
 
 On 12/15/06, Remy Sharp [EMAIL PROTECTED] wrote:

 I've written a simple plugin that keeps firing the specified function
 while
 the mouse button is held down (i.e. a repeat action).

 Here it is:

 http://leftlogic.com/jquery/mousehold.js

 Here's a bit more detail on how it works - along with an example:

 http://remysharp.com/2006/12/15/jquery-mousehold-event/

 Any feedback or bugs please let me know.

 Cheers,

 Remy Sharp.
 --
 View this message in context:
 http://www.nabble.com/Plugin%3A-Mousehold-tf2828870.html#a7897334
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 

-- 
View this message in context: 
http://www.nabble.com/Plugin%3A-Mousehold-tf2828870.html#a7898405
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin: Mousehold

2006-12-15 Thread Andy Matthews
This would be a perfect thing to meld in with that form scroller plugin.
Can't recall who wrote it, but it converted a form field into a widget that
let you click up and down to change values.

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of John Resig
Sent: Friday, December 15, 2006 1:54 PM
To: jQuery Discussion.
Subject: Re: [jQuery] Plugin: Mousehold


This is a fantastic plugin!

The only suggestion that I have is to reverse the order of the arguments:
$(...).mousehold( 100, function(){ ... } );

and make the timeout argument optional. That way you can still write:
$(...).mousehold( function(){ ... } );

This makes it more consistent with the style of other jQuery methods
(having the callback always be last!)

Also, it may make sense to have the default timeout be something like
'100' - as a timeout of 1 second seems to be kind of useless (IMO).

--John

On 12/15/06, Remy Sharp [EMAIL PROTECTED] wrote:

 I've written a simple plugin that keeps firing the specified function
while
 the mouse button is held down (i.e. a repeat action).

 Here it is:

 http://leftlogic.com/jquery/mousehold.js

 Here's a bit more detail on how it works - along with an example:

 http://remysharp.com/2006/12/15/jquery-mousehold-event/

 Any feedback or bugs please let me know.

 Cheers,

 Remy Sharp.
 --
 View this message in context:
http://www.nabble.com/Plugin%3A-Mousehold-tf2828870.html#a7897334
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Duplicate Events

2006-12-15 Thread floepi

Hi Jonathan,

thanks i found out what i was doing wrong. The function i wanted to unclick
was part of my plugin which was loaded everytime i made an Ajaxcall.
Therefore it was not registered globally. I took it out the the plugin and
now it works. 

Cheers

Phil

Jonathan Sharp wrote:
 
 Are you loading in your function via AJAX? Does it get loaded multiple
 times?
 
 If so you might need to do something like this (untested):
 
 var prevMyFunc;
 var myFunc;
 
 // ajax returns myFunc = function(){ ... }
 
 $('#mainWindow').unclick(prevMyFunc).click(myFunc);
 prevMyFunc = myFunc;
 
 Cheers,
 -js
 
 
 On 12/14/06, floepi [EMAIL PROTECTED] wrote:



 A

 Please try for yourselves on any page.

 var hello = function() {
 alert('funzt nicht');
 };
 $('#mainWindow').unclick(hello).click(hello);
 $('#mainWindow').unclick(hello).click(hello);

 If i understand correctly we should only get one alert popping up since
 we
 registered the function globally and unclicked it. But it doesn't work
 :((

 Well i hope we can solve this mystery - thanks very much for your time
 guys.

 Cheers

 Phil



 floepi wrote:
 
  I guess i am doing something wrong. If i try this
 
  $('#mainWindow').click(function() { alert(Hello); });
  $(#mainWindow).unbind( click, function() { alert(Hello); });
 
  where the functions are identical, it still does not work. It will
 invoke
  the alert function when i click in the mainWindow.
 
  I must be missing something.
 
  Cheers
 
  Phil
 
 
 
  Sam Collett wrote:
 
  On 14/12/06, floepi [EMAIL PROTECTED] wrote:
 
  Hi,
 
  i have the following problem using the events in jQuery:
 
  $('#mainWindow').click(function(){
   alert('test');
  });
 
  and load this function at the end of a php script:
  ?php
  bla bla bla
  ?
  script
  my function
  /script
 
  The problem is that i load this data into the mainWindow which means,
  that
  the event gets attached each time i load content into the mainWindow.
 So
  when i click in the mainWindow i get multiple alert messages.
 
  Is there a way to tell jQuery to overwrite the event if the function
 is
  the
  same. Otherwise i have to use the specific unbind each time i load
 data
  into
  the window, which feels hacky and unnecessary.
 
  Thanks for your time. Maybe you know how to solve my problem.
 
  Cheers
 
  Phil
 
  Have you tried 'unclick'?
 
  $('#mainWindow').unclick().click(...
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Duplicate-Events-tf2820382.html#a7873813
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 

-- 
View this message in context: 
http://www.nabble.com/Duplicate-Events-tf2820382.html#a7888900
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin: Mousehold

2006-12-15 Thread Remy Sharp

That's exactly why I wrote it (though not for that plugin) - I've been
working on a 'spinner' that's closer to desktop application spinners for the
web - converting select boxes to this new object...but you're right - it
does fit quite well together.



Andy Matthews wrote:
 
 This would be a perfect thing to meld in with that form scroller plugin.
 Can't recall who wrote it, but it converted a form field into a widget
 that
 let you click up and down to change values.
 
 !//--
 andy matthews
 web developer
 certified advanced coldfusion programmer
 ICGLink, Inc.
 [EMAIL PROTECTED]
 615.370.1530 x737
 --//-
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Behalf Of John Resig
 Sent: Friday, December 15, 2006 1:54 PM
 To: jQuery Discussion.
 Subject: Re: [jQuery] Plugin: Mousehold
 
 
 This is a fantastic plugin!
 
 The only suggestion that I have is to reverse the order of the arguments:
 $(...).mousehold( 100, function(){ ... } );
 
 and make the timeout argument optional. That way you can still write:
 $(...).mousehold( function(){ ... } );
 
 This makes it more consistent with the style of other jQuery methods
 (having the callback always be last!)
 
 Also, it may make sense to have the default timeout be something like
 '100' - as a timeout of 1 second seems to be kind of useless (IMO).
 
 --John
 
 On 12/15/06, Remy Sharp [EMAIL PROTECTED] wrote:

 I've written a simple plugin that keeps firing the specified function
 while
 the mouse button is held down (i.e. a repeat action).

 Here it is:

 http://leftlogic.com/jquery/mousehold.js

 Here's a bit more detail on how it works - along with an example:

 http://remysharp.com/2006/12/15/jquery-mousehold-event/

 Any feedback or bugs please let me know.

 Cheers,

 Remy Sharp.
 --
 View this message in context:
 http://www.nabble.com/Plugin%3A-Mousehold-tf2828870.html#a7897334
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 

-- 
View this message in context: 
http://www.nabble.com/Plugin%3A-Mousehold-tf2828870.html#a7898530
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin: Mousehold

2006-12-15 Thread Karl Swedberg

On Dec 15, 2006, at 3:14 PM, Andy Matthews wrote:

 This would be a perfect thing to meld in with that form scroller  
 plugin.
 Can't recall who wrote it, but it converted a form field into a  
 widget that
 let you click up and down to change values.



Yeah, it would also work great with that menu demo someone showed  
with the iPod-like interface. Remember someone mentioned that  
clicking repeatedly was giving him carpal tunnel syndrome? It was the  
one that had as one of its results the guy wearing the fruity pants.  
I can't track it down in my previous emails, but I'd like to find it  
again. Does anyone recall who did this or where it is?

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






 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Behalf Of John Resig
 Sent: Friday, December 15, 2006 1:54 PM
 To: jQuery Discussion.
 Subject: Re: [jQuery] Plugin: Mousehold


 This is a fantastic plugin!

 The only suggestion that I have is to reverse the order of the  
 arguments:
 $(...).mousehold( 100, function(){ ... } );

 and make the timeout argument optional. That way you can still write:
 $(...).mousehold( function(){ ... } );

 This makes it more consistent with the style of other jQuery methods
 (having the callback always be last!)

 Also, it may make sense to have the default timeout be something like
 '100' - as a timeout of 1 second seems to be kind of useless (IMO).

 --John

 On 12/15/06, Remy Sharp [EMAIL PROTECTED] wrote:

 I've written a simple plugin that keeps firing the specified function
 while
 the mouse button is held down (i.e. a repeat action).

 Here it is:

 http://leftlogic.com/jquery/mousehold.js

 Here's a bit more detail on how it works - along with an example:

 http://remysharp.com/2006/12/15/jquery-mousehold-event/

 Any feedback or bugs please let me know.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin: Mousehold

2006-12-15 Thread Giuliano Marcangelo

Using the mousewheel also fires the event,but when the mousewheel is
released another duplicate window opens (tested in FF)
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Matt Stith

To shorten:

a.class  .class
#id  a#id

On 12/15/06, Erik Beeson [EMAIL PROTECTED] wrote:


  I was avoiding using just $(.newWindow), or $(#newWindow), because
then jQuery has to search the whole document for that class or ID. Whereas
if I use $(a.newWindow) or $(a#newWindow), it's faster because jQuery
then only examines the A tags, and nothing else. Am I right in thinking
that. I'm pretty sure I read something to that affect on this list, as some
point.


Half right, $(.newWindow) selects all tags and searches their
classes for newWindow. $(a.newWindow) selects all a tags and
searches their classes for newWindow. Fewer tags to search so the
a.newWindow version is faster. In the case of $(#newWindow), jQuery
uses the browser's native document.getElementById function to go
straight to the correct element. $(a#newWindow) selects all a
tags, then searches them for the one who's id is newWindow, so it's
actually slower than $(#newWindow).

But in your case, you're probably going to have more than one
newWindow, so you want a class.

  So I'll use $(a.newWindow).click(... as my selector. Does that sound
about right? Is it the best approach?

Yes.

--Erik

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Christopher Jordan

Sweet. Thanks Erik! :o)

Cheers,
Chris

Erik Beeson wrote:

 I was avoiding using just $(.newWindow), or $(#newWindow), because then jQuery has to search 
the whole document for that class or ID. Whereas if I use $(a.newWindow) or $(a#newWindow), 
it's faster because jQuery then only examines the A tags, and nothing else. Am I right in thinking that. I'm pretty 
sure I read something to that affect on this list, as some point.




Half right, $(.newWindow) selects all tags and searches their
classes for newWindow. $(a.newWindow) selects all a tags and
searches their classes for newWindow. Fewer tags to search so the
a.newWindow version is faster. In the case of $(#newWindow), jQuery
uses the browser's native document.getElementById function to go
straight to the correct element. $(a#newWindow) selects all a
tags, then searches them for the one who's id is newWindow, so it's
actually slower than $(#newWindow).

But in your case, you're probably going to have more than one
newWindow, so you want a class.

  

 So I'll use $(a.newWindow).click(... as my selector. Does that sound about 
right? Is it the best approach?



Yes.

--Erik

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

  
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] buildStyleString

2006-12-15 Thread Dave Methvin
 I'm looking for some help in building a plugin that would get the
 computed styles of an element and build an inline style string for
 that element. I assume it'd be something like looping through
 jQuery(el).css(styleName) and sticking the results together.  
 
I'm curious, how would this be used?
 
Do you want only the results of inline styles, or the current values of all
style properties whether they're inline or inherited? If you plan to
round-trip this back to the tested element as an inline style, would the
interference with css stylesheet rules be a problem?
 
 
 
 
 
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] buildStyleString

2006-12-15 Thread Luke Lutman
I had to do something similar recently. What I did was overload the css and 
curCSS functions in 
jQuery to accept an array (of css property names), and return an object whose 
toString method 
builds the inline css string.

For example:

$('#single').css('font-size'); - 12px

$('multi').css(['font-size','line-height']).toString(); - font-size: 12px; 
line-height: normal;

I've packaged it up as a (not very thoroughly tested) plugin here:

http://jquery.lukelutman.com/plugins/css/
http://jquery.lukelutman.com/plugins/css/jquery.css.js

Cheers,
Luke

Yehuda Katz wrote:
 I'm looking for some help in building a plugin that would get the 
 computed styles of an element and build an inline style string for that 
 element. I assume it'd be something like looping through 
 jQuery(el).css(styleName) and sticking the results together.
 
 Any more specific ideas?
 
 -- 
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 
 
 
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


-- 
zinc Roe Design
www.zincroe.com
(647) 477-6016

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] I need syntax help, please.

2006-12-15 Thread Erik Beeson
On 12/15/06, Matt Stith [EMAIL PROTECTED] wrote:
 To shorten:

 a.class  .class
 #id  a#id

This could be misleading. It depends on what you're comparing. It
looks like you're comparing execution time, in which case the
inequalities are backwards. Obviously your comparing performance
where greater is better (faster, less time), but it's still a bit
confusing to me.

--Erik

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin: Mousehold

2006-12-15 Thread Aaron Heimlich

On 12/15/06, Giuliano Marcangelo [EMAIL PROTECTED] wrote:


Using the mousewheel also fires the event,but when the mousewheel is
released another duplicate window opens (tested in FF)



This happens in IE7 too (and probably IE6 as well). Middle-clicking doesn't
seem to trigger a click event, only mouseup and mousedown

--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] highlightFade's source code missing...

2006-12-15 Thread Blair Mitchelmore
Damn broken symlinks...

-blair

aedmonds wrote:
 Hey everybody,

 It seems that the maintainer at http://jquery.offput.ca/highlightFade/ has
 some problems with the site. I can't access any of the code for the
 highlightFade plugin. It's not available in the jQuery SVN either.

 Could someone please post the uncompressed code for me?

 Thanks a bunch,

 -A

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] setTimeout in jquery function

2006-12-15 Thread Mungbeans

I am (attempting) to convert a standard javascript function to a jquery
function.  It targets an image within a given div and changes it height and
width.   Here is the old function, where z is the image.  img_act_height,
max_width etc are global variables:

function zoom_in() {
if(z.width==0){
z.border=0;
}
if(z.width!=0){
if(z.widthmax_width) {
z.width+=step;

z.height=Math.round(z.width*((img_act_height)/(img_act_width)));
setTimeout(zoom_in(),time_length);
} else {
window.alert('Maximum Width exceeded\n© Qiksearch 
zoOom.');
}
}  
} 

Here is my attempt:

$.fn.zoom_in = function() {
w = $(img,this).attr(width);
if(w==0){
z.border=0;
}
if(w!=0){
if(wmax_width) {
newWidth=w+step;
$(img,this).attr(width, newWidth);
newHeight=Math.round(newWidth*image_scale);
$(img,this).attr(height, newHeight);
setTimeout(zoom_in(),time_length);
} else {
window.alert('Maximum Width exceeded');
}
}  
}

I'm not sure how to change the line: 
setTimeout(zoom_in(),time_length)
to that the function can call itself.  Help appreciated.
-- 
View this message in context: 
http://www.nabble.com/setTimeout-in-jquery-function-tf2830530.html#a7902446
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] setTimeout in jquery function

2006-12-15 Thread Erik Beeson
$.fn.zoom_in = function() {
  var self = arguments.callee;
...
  setTimeout(self, time_length);

Also, it's bad form to use $ in a plugin function. Use jQuery(...)
instead of $(...)

--Erik


On 12/15/06, Mungbeans [EMAIL PROTECTED] wrote:

 I am (attempting) to convert a standard javascript function to a jquery
 function.  It targets an image within a given div and changes it height and
 width.   Here is the old function, where z is the image.  img_act_height,
 max_width etc are global variables:

 function zoom_in() {
 if(z.width==0){
 z.border=0;
 }
 if(z.width!=0){
 if(z.widthmax_width) {
 z.width+=step;
 
 z.height=Math.round(z.width*((img_act_height)/(img_act_width)));
 setTimeout(zoom_in(),time_length);
 } else {
 window.alert('Maximum Width exceeded\n(c) Qiksearch 
 zoOom.');
 }
 }
 }

 Here is my attempt:

 $.fn.zoom_in = function() {
 w = $(img,this).attr(width);
 if(w==0){
 z.border=0;
 }
 if(w!=0){
 if(wmax_width) {
 newWidth=w+step;
 $(img,this).attr(width, newWidth);
 newHeight=Math.round(newWidth*image_scale);
 $(img,this).attr(height, newHeight);
 setTimeout(zoom_in(),time_length);
 } else {
 window.alert('Maximum Width exceeded');
 }
 }
 }

 I'm not sure how to change the line:
 setTimeout(zoom_in(),time_length)
 to that the function can call itself.  Help appreciated.
 --
 View this message in context: 
 http://www.nabble.com/setTimeout-in-jquery-function-tf2830530.html#a7902446
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] setTimeout in jquery function

2006-12-15 Thread Mungbeans


Erik Beeson wrote:
 
 
 Also, it's bad form to use $ in a plugin function. Use jQuery(...)
 instead of $(...)
 
 

Duly noted :)  I was fully expecting someone to take me to task about the
global variables...
-- 
View this message in context: 
http://www.nabble.com/setTimeout-in-jquery-function-tf2830530.html#a7902627
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-12-15 Thread Alan Gutierrez
* Jörn Zaefferer [EMAIL PROTECTED] [2006-11-22 03:17]:
 Alan Gutierrez schrieb:
  Extending prototype creates a lot of surprises. You're going to find
  yourself saying, yeah, that library isn't compatable with jQuery.

 I don't quite get your point. Do you use for-in loops on Strings or 
 Arrays? If yes, the new methods plugins are not good for you, if no, 
 there is no reason that you can't use it. jQuery itself won't extend any 
 prototypes apart from it's own, but those String and Array (and maybe 
 Date soon) extension are way easier to use based on protoypes then with 
 everything else.

Speaking from experience with Prototype and Google Maps. It doesn't
matter if I choose to do for in loops on Arrays, if a library that I
depend upon descides to do for in loops on Arrays, I have to live
their those decisions.

-- 
Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/
Think New Orleans - http://thinknola.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] setTimeout in jquery function

2006-12-15 Thread Mungbeans



Erik Beeson wrote:
 
   setTimeout(self, time_length);
 

This line is now returning an error (its on line 430):

missing ] after element list
gs_admin.js (line 430)
[object Window]

-- 
View this message in context: 
http://www.nabble.com/setTimeout-in-jquery-function-tf2830530.html#a7903385
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] setTimeout in jquery function

2006-12-15 Thread Erik Beeson
In this case I guess that should work. You could get in to trouble if
you did that inside an anonymous function (like a click handler)
expecting it to refer to your plugin function though.

--Erik

On 12/15/06, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 I don't know about using self there ... I use
 timeout = setTimeout(arguments.callee,5000); to do my recursive calls.

 (it works for me!)



 On 12/15/06, Mungbeans [EMAIL PROTECTED] wrote:
 
 
 
  Erik Beeson wrote:
  
 setTimeout(self, time_length);
  
 
  This line is now returning an error (its on line 430):
 
  missing ] after element list
  gs_admin.js (line 430)
  [object Window]
 
  --
  View this message in context:
 http://www.nabble.com/setTimeout-in-jquery-function-tf2830530.html#a7903385
  Sent from the JQuery mailing list archive at Nabble.com.
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 



 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/