[jQuery] Remove a plugin from elements

2008-06-04 Thread SiCo

Hi, I'm using the Table Hover and Table Drag and Drop plugin, I want
to enable the Table Hover when an element is clicked. Easy enough: $
(#table).tableDnD(); placed inside the onlcik event of the element I
want to activate the plugin.

I also want to unbind the table hover plugin while the drag and drop
plugin is active.

But how do I remove this plugin once the order has been saved? I read
on here that plugins should provide methods to remove them but I don't
believe this one does.

There must be an easy way to do this I just can't find it!

Thanks
Simon


[jQuery] Re: Selecting elements with multiple classes

2008-06-04 Thread Gordon

Says it found 2 rows here, which looking at the source code is exactly
the expected behaviour.

On Jun 4, 12:31 am, Mike Alsup [EMAIL PROTECTED] wrote:
   Yes, it is the way how it works. I have managed to do it as

   $(tr[class^='child'])

   Which selects all classes like class=child test class=child test2 etc

   However, if you make it as $(tr.child), nothing will be selected. Tried
   and tested many times...

  Post a demo link.

 Here's a link for you:

 http://malsup.com/jquery/test/jun3.html


[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available

2008-06-04 Thread Sam Collett

Looks like another good release, yet more performance improvements and
a few useful new features!

Regarding speed testing, maybe it is worth mentioning the PC
specification of the machine that performs these tests?

For example, mine (Core Duo 1.6Ghz)

.extend()
1.2.3 - 63
1.2.6 - 46

.map()
1.2.3 - 2268
1.2.6 - 203

Still a performance improvement, but not as great as the test machine
- i.e. the faster the client PC processor, the better the performance
improvement (I don't think RAM will have much of an impact as the CPU
is doing the work).

Perhaps the tests should be done on different spec machines, more so
the low end ones (Celeron, Sempron and Intel Atom)?

-Sam

On Jun 3, 6:46 pm, Rey Bango [EMAIL PROTECTED] wrote:
 jQuery v1.2.6 is now official and release notes have been 
 posted:http://docs.jquery.com/Release:jQuery_1.2.6

 The biggest changes are improvements in performance, especially event
 handling, which is now 103% faster.

 Also, the Dimensions plugin is now part of core. The remaining methods
 of the Dimensions plugin, by Brandon Aaron, have been introduced into
 jQuery core, along with additional bug fixes and performance
 improvements. This plugin has seen considerable use amongst developers
 and plugin authors and has become a solid part of the jQuery ecosystem.
 We've been, slowly, introducing the most-used methods from the
 Dimensions plugin over the past couple releases - but with the release
 of 1.2.6 all remaining methods are now part of core.

 If you're upgrading your copy of jQuery to version 1.2.6 you can now opt
 to exclude the Dimensions plugin from your code.

 There are plenty of other updates so please read the release note for
 full details.

 http://docs.jquery.com/Release:jQuery_1.2.6

 The jQuery Team...


[jQuery] Re: File Upload with Form Plugin

2008-06-04 Thread Pascal Zajac


You're right, it does, I changed the id for the submit button from
id=submit to id=submit_button and it works as intended. I wasn't aware
that 'submit' wasn't allowed; I did see the alert() about that in the source
code but it didn't actually trigger so I never got the error message, and
didn't think anything of it.

Thanks so much for the help (and quickly) and thanks for a brilliant plugin
Mike.


malsup wrote:
 
 Sounds like your form has an input with the name submit?That is
 not allowed.  The latest version of the form plugin will check for
 this and alert a warning.
 
 

-- 
View this message in context: 
http://www.nabble.com/File-Upload-with-Form-Plugin-tp17637445s27240p17638287.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] v1.0.2

2008-06-04 Thread Trend-King

He released version 1.0.2 really good!


[jQuery] Image Rotation

2008-06-04 Thread vinay

hi,
i am trying to rotate an image with any angle and i am able to do
this. But after rotaion i want to add onclick attribute on that
rotated image. So that i can get id of that on click.
please help me if you have done like this or have any idea.

thanks
vinay


[jQuery] My first jQuery

2008-06-04 Thread gandalf458

I'm trying my first simple jQuery task, a mouseover event to display a
box with some text.

  $(p.sec-ia).addClass(unhide).show(slow);

works fine but when I add the mouseover

  $(#section1).hover(function(){
$(p.sec-ia).addClass(unhide).show(slow);
  },function(){
$(p.sec-ia).removeClass(unhide);
  });

it doesn't do anything. I don't know if it's because my p.sec-ia isn't
in the #section1. Can anyone give me a clue, please? Thanks.


[jQuery] Javascript canvas

2008-06-04 Thread vinay

Hi,

Is there any way to add onclick property in javascript canvas.

please help me.

vinay


[jQuery] Creating and manually firing events

2008-06-04 Thread KayakingJoe

Hi,
var myButton = dojo.byId('mybutton');
var evObjclick = document.createEvent('MouseEvents');
evObjclick.initMouseEvent( 'click', true, true, null, 0, 27, 53,
27,53, false, false, false, false, 0, null );
myButton.dispatchEvent(evObjclick);

I'm looking for a cross-browser solution to the above vanilla js,
which works in FF but not IE. Can you do this using jquery ?
Thanks


[jQuery] Re: File Upload with Form Plugin

2008-06-04 Thread Mike Alsup

 You're right, it does, I changed the id for the submit button from
 id=submit to id=submit_button and it works as intended. I wasn't aware
 that 'submit' wasn't allowed; I did see the alert() about that in the source
 code but it didn't actually trigger so I never got the error message, and
 didn't think anything of it.

Hmm, thanks for the feedback on that.  I thought I had the alert
working correctly but I guess not.


[jQuery] Re: Tooltip onlink inside td falls below the table

2008-06-04 Thread asle

I found the problem. It is not reading my CSS for #tooltip. Very
strange. I tried to strip my CSS completely. Still it does not read
the position etc. of #tooltip. So I had to hardcode the same CSS into
the plugin:
.css(position,absolute)..etc. Any Idea why it does not read
the CSS for the tooltip? I tried to strip out all other js files
except jquery and tooltip. No luck.

/asle


[jQuery] Re: My first jQuery

2008-06-04 Thread Joseph DJOMEDA
hi i'm also a newby.try with something simple to see whether you have set
jquery well.even copy and paste from a tuorial.just to be sure your are not
looking for something elsewhere.

2008/6/4 gandalf458 [EMAIL PROTECTED]:


 I'm trying my first simple jQuery task, a mouseover event to display a
 box with some text.

  $(p.sec-ia).addClass(unhide).show(slow);

 works fine but when I add the mouseover

  $(#section1).hover(function(){
$(p.sec-ia).addClass(unhide).show(slow);
  },function(){
$(p.sec-ia).removeClass(unhide);
  });

 it doesn't do anything. I don't know if it's because my p.sec-ia isn't
 in the #section1. Can anyone give me a clue, please? Thanks.



[jQuery] Reading http headers out of an ajax response

2008-06-04 Thread sparkpool

Hi all,

I know that jquery's ajax calls set the X-Requested-With header to
'XMLHttpRequest' for ajax requests, making it really easy for the
server side to detect them.

Is there any way for jquery to read the http headers out an ajax
response back from the server? I can see the ones I'm interested in in
the firebug console, but when I dump the XMLHttpRequest object out
from inside my ajax complete method, I don't see them anywhere.

Does jquery provide any tools for this? Is it possible at all in
javascript?

Thanks


[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available

2008-06-04 Thread John Resig

 Still a performance improvement, but not as great as the test machine
 - i.e. the faster the client PC processor, the better the performance
 improvement (I don't think RAM will have much of an impact as the CPU
 is doing the work).

How so? Your .extend() improved by 37% and your .map() improved by
1017%. Those are well within the realm of what we posted. The speed of
the processor shouldn't affect the degree of relative improvement.

--John


[jQuery] Re: My first jQuery

2008-06-04 Thread Sean O


Did you place your code inside jQuery's document ready function?

$(document).ready(function() {
  $(#section1).hover(function(){
$(p.sec-ia).addClass(unhide).show(slow);
  },function(){
$(p.sec-ia).removeClass(unhide).hide(fast);
  });
});

The above worked for me, assuming .unhide was a display style and was used
to display a p with class of sec-ia.

_
SEAN O
http://www.sean-o.com



gandalf458-2 wrote:
 
 
 I'm trying my first simple jQuery task, a mouseover event to display a
 box with some text.
 
   $(p.sec-ia).addClass(unhide).show(slow);
 
 works fine but when I add the mouseover
 
   $(#section1).hover(function(){
 $(p.sec-ia).addClass(unhide).show(slow);
   },function(){
 $(p.sec-ia).removeClass(unhide);
   });
 
 it doesn't do anything. I don't know if it's because my p.sec-ia isn't
 in the #section1. Can anyone give me a clue, please? Thanks.
 
 

-- 
View this message in context: 
http://www.nabble.com/My-first-jQuery-tp17643861s27240p17645936.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: My first jQuery

2008-06-04 Thread Scott Sauyet


gandalf458 wrote:

I'm trying my first simple jQuery task, a mouseover event to display a
box with some text.

  $(p.sec-ia).addClass(unhide).show(slow);

works fine but when I add the mouseover

  $(#section1).hover(function(){
$(p.sec-ia).addClass(unhide).show(slow);
  },function(){
$(p.sec-ia).removeClass(unhide);
  });

it doesn't do anything. I don't know if it's because my p.sec-ia isn't
in the #section1. Can anyone give me a clue, please? Thanks.



It would be easier if you could point us to a live page.  But there is 
something that looks odd.  I don't know how the CSS for the class 
unhide is defined, but you seem to be combining idioms.  Usually you 
would choose to *either* toggle a CSS class:


$(p.sec-ia).addClass(unhide);

or to directly toggle the visibility:

$(p.sec-ia).show(slow);

Perhaps your hover shouldn't bother (at least at first) with the 
unhide class but should instead simply do a


$(p.sec-ia).hide();  // or
$(p.sec-ia).fadeIn(slow);


Good luck,

  -- Scott


[jQuery] Re: Creating and manually firing events

2008-06-04 Thread Richard D. Worth
What timing. Eduardo Lundgren and I have just been working on a plugin to do
this to help with jQuery UI testing:

http://ui.jquery.com/bugs/browser/trunk/ui/tests/jquery.simulate.js?rev=140

No Safari 2 support at this time (since UI supports only 3+), but Eduardo
said he'll add it at some point (right now we're focused on *using* the
plugin). Also, we're writing utility functions. So instead of

$(#foo)
  .simulate(mousedown, { clientX: 50, clientY: 50 })
  .simulate(mousemove, { clientX: 50, clientY: 50 })
  .simulate(mousemove, { clientX: 55, clientY: 55 })
  .simulate(mousemove, { clientX: 60, clientY: 60 })
  .simulate(mouseup, { clientX: 60, clientY: 60 });

you can simply call

$(#foo).simulate(drag, { dx: 10, dy: 10 });

- Richard

Richard D. Worth
http://rdworth.org/

On Wed, Jun 4, 2008 at 3:45 AM, KayakingJoe [EMAIL PROTECTED] wrote:


 Hi,
 var myButton = dojo.byId('mybutton');
 var evObjclick = document.createEvent('MouseEvents');
 evObjclick.initMouseEvent( 'click', true, true, null, 0, 27, 53,
 27,53, false, false, false, false, 0, null );
 myButton.dispatchEvent(evObjclick);

 I'm looking for a cross-browser solution to the above vanilla js,
 which works in FF but not IE. Can you do this using jquery ?
 Thanks



[jQuery] Re: Cornerz 0.4

2008-06-04 Thread Andy Matthews

I'm really disappointed with this script. I spent about an hour last night
trying to get it to work (part of which was my Mac's fault) and when I
finally did, it kept showing the squared-off corners in addition to the
rounded corners. I finally figured out that the corner has to be set to the
same color as the background.

However in my case I'm using a gradient image as a background so this corner
method won't work. You might want to list that in your limitations because
that will DEFINITELY throw off other people like it did for me.

As a conclusion, this plugin works GREAT for people who have solid color
backgrounds, but not at all for sites that don't.

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Tuesday, June 03, 2008 7:03 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Cornerz 0.4


Very well done, Jonah!

--Karl

Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jun 3, 2008, at 7:53 AM, weepy wrote:


 Hi

 I've just released Cornerz 0.4

 http://groups.google.com/group/cornerz

 Bullet Proof Corners plugin for jQuery using Canvas/VML

* Antialiased
* Fast - this pages renders in 200ms on my Vaio in Firefox and 
 there's quite a few corners!!
* Support for any size radius and border width with minimal 
 performance increase
* No excanvas
* Current layout is maintained
* Works with many tested positions/display/floats (current 
 limitation with inline)
* Supports fluid layouts.
* Original div still shows through, so can easily do hover effects
* Script is only 4.0k uncompressed
* Requires jQuery 1.2.6+
* Tested on :
  o IE6 XP/Vista
  o IE7 XP/Vista
  o Firefox 2 Ubuntu/Windows
  o Safari 3 Windows
  o Opera 9 Windows/Linux

  Limitations:
  o Problem with some Inline elements in IE - due to incorrect 
 reporting of width
  o For IE as it cannot handle right/bottom aligned elements 
 with odd (2n+1) dimensions - positioning is calculated at page load.
 If an element changes height or width - the cornerz need adding again.



 Cheers

 Jonah




[jQuery] Re: [ANNOUNCE] jFlip plugin

2008-06-04 Thread Andy Matthews

Mike...

When I'm trying to grab the bottom right corner, and flip it to the left, I
keep wanting to move my mouse past the edge of the flip area (just like I
would with a real book). If the flip area were in the middle of the window,
that would be no big deal. However since the flip area is flush to the edge
of the window, when my mouse goes past the edge of the flip area, it also
goes past the window which causes the corner to release and go back to it's
original position.


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Alsup
Sent: Tuesday, June 03, 2008 5:12 PM
To: jQuery (English)
Subject: [jQuery] Re: [ANNOUNCE] jFlip plugin


 http://www.jquery.info/The-jFlip-plugin

Very nice effect, Renato.  Definitely uses a lot of CPU when it's active,
but the visual is quite nice.


 It's WAY too difficult to use with it being so close to the edge of 
 the window.

I don't understand this comment at all.




[jQuery] strange error with plugin validation

2008-06-04 Thread k8

Hi guys,
i have this strange error with plugin validation.
This is my code:
http://rafb.net/p/L0yQZ681.html


Thx @ all.


[jQuery] Collecting info on sites using jquery.

2008-06-04 Thread Istvan Orban

Hi All,

I have been using jQuery now more then 6 months. It is amazing.

Although as a Java Programmer I found it very difficult to turn my head
around, and start using prototypal inheritance and all the Javascript
stuff.

I have checked in many Frameworks, and jQuery seemed to be the least
verbose and most expressing. which was a major point when we went for
jQuery.

There is clear documentation how to develop plugins, also due to the
YUI theatre there are plenty of info on Javascript itself as well.

So My big question is, I would like to collect and also maybe put
together some info on :

1, Best practises with Portlets with JQuery 

2, Best practises when writting component on the page generally.

   - do you prefer some inheritance ( I know with jQuery this is not the
best )

   - use delegation

I would like to see example from Real Life projects where People faced
these problems and I would like to learn from why and what they have
decided.

so Could we put together somewhere a little list of sites and preferable
links to some js files and css etc. which shows some great examples of
implementation with jQuery.

Any suggestions, Links, infos are very welcome.

Thanks

Istvano

So My big question is, I would like to learn and SEE how other have used
jQuery with real sites and real implementation.





[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available

2008-06-04 Thread Sam Collett

I suppose a few % points off isn't that much of a difference and in
some cases were even better. But I expect mine isn't too far off the
test machine.

Think I got my maths the wrong way round:
((1.2.3 time - 1.2.6 time) / 1.2.3 time) * 100

e.g. for .extend():
((63 - 46) / 63) * 100
(17 / 63) * 100 = 27% improvement

Maybe that's why I made that conclusion.

What I am interested in is how the lower spec PC's performed (non-dual
core, entry level machines), to see if multi-core processors actually
make much of a difference (since many users of website using jQuery
will have these type of PC's).

.map() is the major improvement in this release as a few milliseconds
off a fast method like .extend() won't mean as much (although if it is
called a lot it adds up to more savings). .offset() is still a
bottleneck (browser quirks stop any major improvements), but caching
values and restricting how often it is called helps mitigate that (I
think Flash is still far smoother when it comes to mouse tracking and
animation - which can be very slow over a Citrix connection).
Animation performance is not something that can be tested with unit
tests (still need a human to do that).


How does it compare with other libraries now?

-Sam

On Jun 4, 1:21 pm, John Resig [EMAIL PROTECTED] wrote:
  Still a performance improvement, but not as great as the test machine
  - i.e. the faster the client PC processor, the better the performance
  improvement (I don't think RAM will have much of an impact as the CPU
  is doing the work).

 How so? Your .extend() improved by 37% and your .map() improved by
 1017%. Those are well within the realm of what we posted. The speed of
 the processor shouldn't affect the degree of relative improvement.

 --John


[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available

2008-06-04 Thread John Resig

.extend() was used extensively in the event handling code, hence the
need for improvement.

 How does it compare with other libraries now?

How does what compare? No other library is making the optimizations we
are - or even examining how to perform faster operations here.

--John


[jQuery] Re: Collecting info on sites using jquery.

2008-06-04 Thread Joe

I think if you check out Liferay ( http://www.liferay.com ) you should
see the purest usage of portlets and their relationship to jQuery.
Liferay runs on Java (Velocity Templates) and uses jQuery as their
preferred library.  The solution is incredibly robust and shows how
one can integrate jQuery with portlets.

Hope this helps...

Cheers.

Joe

www.subprint.com

On Jun 4, 6:36 am, Istvan Orban [EMAIL PROTECTED]
wrote:
 Hi All,

 I have been using jQuery now more then 6 months. It is amazing.

 Although as a Java Programmer I found it very difficult to turn my head
 around, and start using prototypal inheritance and all the Javascript
 stuff.

 I have checked in many Frameworks, and jQuery seemed to be the least
 verbose and most expressing. which was a major point when we went for
 jQuery.

 There is clear documentation how to develop plugins, also due to the
 YUI theatre there are plenty of info on Javascript itself as well.

 So My big question is, I would like to collect and also maybe put
 together some info on :

 1, Best practises with Portlets with JQuery

 2, Best practises when writting component on the page generally.

- do you prefer some inheritance ( I know with jQuery this is not the
 best )

- use delegation

 I would like to see example from Real Life projects where People faced
 these problems and I would like to learn from why and what they have
 decided.

 so Could we put together somewhere a little list of sites and preferable
 links to some js files and css etc. which shows some great examples of
 implementation with jQuery.

 Any suggestions, Links, infos are very welcome.

 Thanks

 Istvano

 So My big question is, I would like to learn and SEE how other have used
 jQuery with real sites and real implementation.


[jQuery] Re: [ANNOUNCE] jFlip plugin

2008-06-04 Thread Joe

Awesome plugin.  Well done.

Joe

www.subprint.com

On Jun 4, 8:28 am, Andy Matthews [EMAIL PROTECTED] wrote:
 Mike...

 When I'm trying to grab the bottom right corner, and flip it to the left, I
 keep wanting to move my mouse past the edge of the flip area (just like I
 would with a real book). If the flip area were in the middle of the window,
 that would be no big deal. However since the flip area is flush to the edge
 of the window, when my mouse goes past the edge of the flip area, it also
 goes past the window which causes the corner to release and go back to it's
 original position.

 andy

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

 Behalf Of Mike Alsup
 Sent: Tuesday, June 03, 2008 5:12 PM
 To: jQuery (English)
 Subject: [jQuery] Re: [ANNOUNCE] jFlip plugin

 http://www.jquery.info/The-jFlip-plugin

 Very nice effect, Renato.  Definitely uses a lot of CPU when it's active,
 but the visual is quite nice.

  It's WAY too difficult to use with it being so close to the edge of
  the window.

 I don't understand this comment at all.


[jQuery] Re: Cornerz 0.4

2008-06-04 Thread DaveG



Andy Matthews wrote:

it kept showing the squared-off corners in addition to the
rounded corners. I finally figured out that the corner has to be set to the
same color as the background.

Ah, thanks for that. I had the same squared off problem (only in FF though).


However in my case I'm using a gradient image as a background so this corner
method won't work.

Also had the same issue.


 ~ ~ Dave


[jQuery] Re: My first jQuery

2008-06-04 Thread gandalf458

Thanks guys. I am trying to do something based on what I've seen in a
couple of the tutorials. But I think it's more different that I
realise. The page I'm playing with is at

http://www.compassion-in-business.co.uk/x.php

Thanks


[jQuery] Re: Collecting info on sites using jquery.

2008-06-04 Thread Seth - TA

Here is a HUGE list, enjoy - http://docs.jquery.com/Sites_Using_jQuery

On Jun 4, 6:36 am, Istvan Orban [EMAIL PROTECTED]
wrote:
 Hi All,

 I have been using jQuery now more then 6 months. It is amazing.

 Although as a Java Programmer I found it very difficult to turn my head
 around, and start using prototypal inheritance and all the Javascript
 stuff.

 I have checked in many Frameworks, and jQuery seemed to be the least
 verbose and most expressing. which was a major point when we went for
 jQuery.

 There is clear documentation how to develop plugins, also due to the
 YUI theatre there are plenty of info on Javascript itself as well.

 So My big question is, I would like to collect and also maybe put
 together some info on :

 1, Best practises with Portlets with JQuery

 2, Best practises when writting component on the page generally.

- do you prefer some inheritance ( I know with jQuery this is not the
 best )

- use delegation

 I would like to see example from Real Life projects where People faced
 these problems and I would like to learn from why and what they have
 decided.

 so Could we put together somewhere a little list of sites and preferable
 links to some js files and css etc. which shows some great examples of
 implementation with jQuery.

 Any suggestions, Links, infos are very welcome.

 Thanks

 Istvano

 So My big question is, I would like to learn and SEE how other have used
 jQuery with real sites and real implementation.


[jQuery] Re: Cornerz 0.4

2008-06-04 Thread Andy Matthews

I want to clarify my point on this. Of all the corner plugins, I think this
one is the best. It results in the least amount of extra code, and it's
quite elegant.

However, the page background issue is going to be a dealbreak for a good
amount of people, myself included. If I was willing to forgo the gradient
background for my site I'd use this plugin in a heartbeat.


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of DaveG
Sent: Wednesday, June 04, 2008 10:06 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Cornerz 0.4



Andy Matthews wrote:
 it kept showing the squared-off corners in addition to the rounded 
 corners. I finally figured out that the corner has to be set to the 
 same color as the background.
Ah, thanks for that. I had the same squared off problem (only in FF though).

 However in my case I'm using a gradient image as a background so this 
 corner method won't work.
Also had the same issue.


  ~ ~ Dave




[jQuery] Re: strange error with plugin validation

2008-06-04 Thread Jörn Zaefferer

What is the strange error you see? Please clarify.

Meanwhile, this looks like it shouldn't be there:
$(#joinusCompleteForm).submit(function(){
  $(#joinusCompleteForm).validate();
});

Jörn

On Wed, Jun 4, 2008 at 2:43 PM, k8 [EMAIL PROTECTED] wrote:

 Hi guys,
 i have this strange error with plugin validation.
 This is my code:
 http://rafb.net/p/L0yQZ681.html


 Thx @ all.



[jQuery] Re: Tooltip onlink inside td falls below the table

2008-06-04 Thread Jörn Zaefferer

It would help a lot to see a testpage.

Jörn

On Wed, Jun 4, 2008 at 1:16 PM, asle [EMAIL PROTECTED] wrote:

 I found the problem. It is not reading my CSS for #tooltip. Very
 strange. I tried to strip my CSS completely. Still it does not read
 the position etc. of #tooltip. So I had to hardcode the same CSS into
 the plugin:
 .css(position,absolute)..etc. Any Idea why it does not read
 the CSS for the tooltip? I tried to strip out all other js files
 except jquery and tooltip. No luck.

 /asle



[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available

2008-06-04 Thread Sam Collett

Mainly CSS selector tests, but perhaps also methods that may be common
among libraries (like map, extend), but that may be more difficult.

There is this one, but it uses old libraries (not just jQuery):
http://dev.jquery.com/~john/slick/

-Sam

On Jun 4, 3:52 pm, John Resig [EMAIL PROTECTED] wrote:
 .extend() was used extensively in the event handling code, hence the
 need for improvement.

  How does it compare with other libraries now?

 How does what compare? No other library is making the optimizations we
 are - or even examining how to perform faster operations here.

 --John


[jQuery] Re: Select lists in 1.2.5

2008-06-04 Thread Ariel Flesler

I'm even happier :)

--
Ariel Flesler
http://flesler.blogspot.com

On 3 jun, 15:10, Photic [EMAIL PROTECTED] wrote:
 Appears to work just fine in 1.2.6 (without having to convert to
 string)
 I'm happy once again :)

 On May 22, 10:30 pm, Photic [EMAIL PROTECTED] wrote:



  Aah, functionality change. Bummer.

  On May 22, 9:28 pm, Aaron Heimlich [EMAIL PROTECTED] wrote:

   $(#q).val(3); -- notice that I used a string, not an integer
   works. 
   Seehttp://groups.google.com/group/jquery-dev/browse_thread/thread/e42d27...

  http://groups.google.com/group/jquery-dev/browse_thread/thread/6ce769...

   On Thu, May 22, 2008 at 10:22 PM,Photic[EMAIL PROTECTED] wrote:

Sure no prob.
Here you go:
   http://www.happinessinmycheeks.com/jquery/1.2.3.htm
   http://www.happinessinmycheeks.com/jquery/1.2.5.htm

On May 22, 6:29 pm, Wil Everts [EMAIL PROTECTED] wrote:
Photic,

 Can you point us to a web-sample so we can Firebug it up? (The 
 console is
 your friend).

 Best Wishes,

 Wil Everts
 [EMAIL PROTECTED]

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

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Ocultar texto de la cita -

 - Mostrar texto de la cita -


[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available

2008-06-04 Thread Alexsandro_xpt

Cool!!!



--
www.alexsandro.com.br

On 3 jun, 14:46, Rey Bango [EMAIL PROTECTED] wrote:
 jQuery v1.2.6 is now official and release notes have been 
 posted:http://docs.jquery.com/Release:jQuery_1.2.6

 The biggest changes are improvements in performance, especially event
 handling, which is now 103% faster.

 Also, the Dimensions plugin is now part of core. The remaining methods
 of the Dimensions plugin, by Brandon Aaron, have been introduced into
 jQuery core, along with additional bug fixes and performance
 improvements. This plugin has seen considerable use amongst developers
 and plugin authors and has become a solid part of the jQuery ecosystem.
 We've been, slowly, introducing the most-used methods from the
 Dimensions plugin over the past couple releases - but with the release
 of 1.2.6 all remaining methods are now part of core.

 If you're upgrading your copy of jQuery to version 1.2.6 you can now opt
 to exclude the Dimensions plugin from your code.

 There are plenty of other updates so please read the release note for
 full details.

 http://docs.jquery.com/Release:jQuery_1.2.6

 The jQuery Team...


[jQuery] jQuery and Information Architecture

2008-06-04 Thread Glen Lipka
I had written something a while back on IA using jQuery for the purpose of a
book.  The book is in hibernation, but I am fond of the content.
It shows how to use IA techniques and jQuery to make your user happier and
more productive.

http://www.commadot.com/book/UX/UX-Tabs.pdf

I'm not looking for feedback to make it better, but I thought it might be
helpful to someone. :)

Glen
posted at http://commadot.com


[jQuery] Re: Sortable - onUpdate

2008-06-04 Thread denise

That explains the problem, there are two separate libraries jQuery/UI
and Interface.  Duh.  I think I like the one for Interface better, but
it looks as though they may be unsupported now.  Does anyone know the
status?

Thank,
d.

On Jun 3, 7:31 pm, Richard D. Worth [EMAIL PROTECTED] wrote:
 There is a dedicated mailing list for jQuery UI plugins:

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

 Here's the documentation for sortables:

 http://docs.jquery.com/UI/Sortables/sortable#options(click the Options tab)

 The callback you want is called 'sort'. It's called for each mousemove
 during the sort.

 - Richard

 On Tue, Jun 3, 2008 at 6:17 PM, denise [EMAIL PROTECTED] wrote:

  Hi,

  I'm very impressed with the plugins available for jQuery, but I really
  need callbacks during the dragging ( the way the Scriptaculous works
  with its onChange method).  It looks as though there used to be an
  onUpdate method and an onChange method, but the more frequent callback
  doesn't seem to be available anymore, only the one at the end.    Is
  there a way to get notified when the helper moves?  or even a way to
  set the onDrag option value on the sortable items?  if so, can anyone
  point me to documentation that would tell me how to do it?

  Thanks,
  d.


[jQuery] Re: Sortable - onUpdate

2008-06-04 Thread Richard D. Worth

That's right. Interface is no longer being supported/improved and is
being replaced by jQuery UI. You can think of it as the next version
of Interface, but it's totally reworked.

- Richard

On 6/4/08, denise [EMAIL PROTECTED] wrote:

 That explains the problem, there are two separate libraries jQuery/UI
 and Interface.  Duh.  I think I like the one for Interface better, but
 it looks as though they may be unsupported now.  Does anyone know the
 status?

 Thank,
 d.

 On Jun 3, 7:31 pm, Richard D. Worth [EMAIL PROTECTED] wrote:
 There is a dedicated mailing list for jQuery UI plugins:

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

 Here's the documentation for sortables:

 http://docs.jquery.com/UI/Sortables/sortable#options(click the Options
 tab)

 The callback you want is called 'sort'. It's called for each mousemove
 during the sort.

 - Richard

 On Tue, Jun 3, 2008 at 6:17 PM, denise [EMAIL PROTECTED] wrote:

  Hi,

  I'm very impressed with the plugins available for jQuery, but I really
  need callbacks during the dragging ( the way the Scriptaculous works
  with its onChange method).  It looks as though there used to be an
  onUpdate method and an onChange method, but the more frequent callback
  doesn't seem to be available anymore, only the one at the end.Is
  there a way to get notified when the helper moves?  or even a way to
  set the onDrag option value on the sortable items?  if so, can anyone
  point me to documentation that would tell me how to do it?

  Thanks,
  d.



[jQuery] firebugExecuteCommand and $ becoming a function called anonymous

2008-06-04 Thread Peter Bengtsson

My site stopped working because $ is no longer an alias for jQuery.
Instead it's this function:

function anonymous() { return window.console.notifyFirebug(arguments,
$, firebugExecuteCommand); }

I suspect that my Firebug (version 1.2.0a21X) has incorrectly set
itself as an alias for $. Does anybody know about this in the jQuery
community? My next destination is to go over to Firebug website and
lurk.


[jQuery] Re: [ANNOUNCE] jFlip plugin

2008-06-04 Thread Renato Formato

 I'm surprised that this didn't get more reaction when posted.  Maybe
 just because Magnify was posted the same day.  I for one am very
 impressed.  To realize that this is written in Javascript is quite
 exciting.  Thanks for the nice work.


Thanks Scott,
I was surprised too, however it has been great to code it.
A nice bonus to the plugin is that the modified version of excanvas
that jFlip uses supports patterns too.

Renato Formato


[jQuery] Re: firebugExecuteCommand and $ becoming a function called anonymous

2008-06-04 Thread Morgan Allen
I was having that problem too, but I think upgrading to 1.2b1 fixed it.

On Wed, Jun 4, 2008 at 10:00 AM, Peter Bengtsson [EMAIL PROTECTED] wrote:


 My site stopped working because $ is no longer an alias for jQuery.
 Instead it's this function:

 function anonymous() { return window.console.notifyFirebug(arguments,
 $, firebugExecuteCommand); }

 I suspect that my Firebug (version 1.2.0a21X) has incorrectly set
 itself as an alias for $. Does anybody know about this in the jQuery
 community? My next destination is to go over to Firebug website and
 lurk.




-- 
http://morglog.alleycatracing.com
Lets make up more accronyms!

http://www.alleycatracing.com
LTABOTIIOFR! ROFL! ROFL! ROFL!
Upcoming alley cats, reviews, touring logs, and a general congregation of
bike nerdity.


[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available

2008-06-04 Thread John Resig

Sure, we'll take credit for that :-)

--John

On Wed, Jun 4, 2008 at 12:28 PM, Josh Nathanson [EMAIL PROTECTED] wrote:

 Great job on this release guys.

 I also noticed when developing a plugin that it seems the memory management
 in IE6 is greatly improved.  I accidentally was using 1.2.1 while trying to
 cut memory leaks in IE6, and when I switched to 1.2.6 the memory leaks on
 IE6 were gone.  I'm not sure if it was some combination of my code and
 jQuery...am I imagining this, or is this also something that was worked on,
 or perhaps a by-product of other optimizations?

 -- Josh




[jQuery] Re: My first jQuery

2008-06-04 Thread Scott Sauyet


gandalf458 wrote:

Thanks guys. I am trying to do something based on what I've seen in a
couple of the tutorials. But I think it's more different that I
realise. The page I'm playing with is at


You're using an id selector, #section1, but your markup is using 
section1 as a class.  Either switch the selector to a class selector, 
.section1, or change the class to an id in the document.



  -- Scott


[jQuery] jQuery + jCarousel Picture Gallery working fine in Firefox but not in IE

2008-06-04 Thread Naveen

Hi,

I'm trying to make a picture gallery using jCarousel (
http://sorgalla.com/projects/jcarousel/ ) and other jQuery features,
powered by Perl/CGI and XML at the backend.

The initial version of the gallery at http://gallery.naveeng.com/trek.html
is working fine in both FF and IE. Clicking a thumbnail on the left
scroller loads the corresponding image via jQuery in the main image
area, while the previous, next buttons are also fine.

I wrote a comments feature which enables a user to comment on
individual pictures and then it appears below the main image. It can
be seen at http://gallery.naveeng.com/trek_final.html but this works
fine only in FF, while in IE, the initial page loads okay, but
clicking a new thumbnail or any of the previous, next, first or last
buttons, make IE go blank (both IE 6 and IE7)!

The following are the additional changes done in the latter version,
which is not working in IE:

script type=text/javascript src=scripts/jquery.form.js/script
script type=text/javascript src=scripts/
jquery.livequery.pack.js/script
script type=text/javascript
//![CDATA[

$(document).ready(function() {

$('#htmlForm').livequery(function(){
$('#htmlForm').ajaxForm({
success: function(resText) {
$('#htmlExampleTarget').append(resText);
}
});
});
});

Also, in another custom javascript function cust(), I'm using a $.ajax
function to call the comments script comm_all.cgi and retrieving the
comments form. But commenting out this part makes the script the work
fine in IE!

function cust(url)
{

re = /^(http:\/\/www\.naveeng\.com\/gallery\/Trek\/Canon\/Best
\/)thumbs\/(.+?)_thumb(\.jpg)$/i;
array=url.match(re);

var xfn = Trek/data/new/ + array[2] + .xml;

jQuery.get(
xfn,

function(data){
//  jQuery(document).ready(function() {
jQuery('#s_it').html(jQuery('title',data).text());
jQuery('#s_desc').html(jQuery('desc',data).text());
jQuery('#s_dt').html(jQuery('date',data).text());
jQuery('#s_pl').html(jQuery('place',data).text());
jQuery('#s_cam').html(jQuery('camera',data).text());
jQuery('#s_len').html(jQuery('lens',data).text());
jQuery('#s_fl').html(jQuery('flash',data).text());
jQuery('#s_res').html(jQuery('imgres',data).text());
jQuery('#s_sz').html(jQuery('imgsize',data).text());
jQuery('#s_or').html(jQuery('orientation',data).text());
jQuery('#s_ss').html(jQuery('ss',data).text());
//  })
},
'xml'
);


var insh=a target=_blank href=' + array[1] + array[2] + array[3] +
'img src=' + array[1] + main/ + array[2] + _main + array[3] +
' border=0 //a;

var inval=array[2] + _main + array[3];
gup = document.getElementById('img_name');
gup.value = inval;

reg_ssi = /Trekking_Pic_(\d+)_main/i;
arr_ssi = inval.match(reg_ssi);

$.ajax({
type: GET,
url: comm_all.cgi?pic= + arr_ssi[1],
dataType: html,
eval: true,
error: function(){
  alert('Error loading document');
},
success: function(data){
$('#ssi').html(data);
}
  });


//  jQuery(document).ready(function() {
jQuery('#main_div_2').fadeOut(2000).fadeTo(10, 1, function()
{jQuery('#main_img_div').html(insh);}).fadeIn(2000);
//  });



}


So what is the problem with the above function? And how should I
rewrite the $.ajax portion above so that IE doesn't go blank?

Thanks.

Naveen



[jQuery] Re: My first jQuery

2008-06-04 Thread gandalf458

Oh what a plonker! Thanks for that. Works a treat now. Now I can play
with different effects.

Cheers G :)


[jQuery] Sorting Divs by Span Value

2008-06-04 Thread Seth - TA

I got a little bit of info from this old thread -
http://groups.google.com/group/jquery-en/browse_thread/thread/e0d6c199552dd1f7/145d28867f5e9577?lnk=gstq=sorting#145d28867f5e9577,
however, not enough. For some reason, when sorting numbers, it
disregards the second number. So if I have {11,100, 500} it would sort
it {100,11,500}. That is completely wrong.

My intension is to have a Div which holds hotel information. (I know I
could do a table and use tablesorter, but the layout does not look
good with a table). Within each div will be two spans which will have
either the price in one and a distance in the other. I will have two
links above the list of divs which can be clicked on to determine how
they are sorted.

Any help is greatly appreciated.

Seth


[jQuery] JQuery: Rendering in IE7

2008-06-04 Thread Taff

Hey,

I've started using JQuery and am really happy with how things are
progressing, but I am having an issue that would appear to be related
to how IE is rendering some text after it has been brought in using
show('slow').

The problem is the Events  Exhibitions Calendar text at the bottom
on the left. Is there anyway I can update the text rendered or
something like that to make it look better?

The page I am referring to is at: http://www.spevco.biz/index.php?id=3

Thanks for any help anyone can offer.

Taff


[jQuery] jMaps Plugin - Unable to Add Custom Icon for Marker

2008-06-04 Thread Joe

var $j = jQuery.noConflict();

$j().ready(function()
{

var myIcon = $j.jmap.createIcon(
{
iconImage: http://www3.travelinfony.com/carsgoogle/images/
camera.gif,
iconSize : new GSize(15, 13),
iconAnchor : new GPoint(9, 34),
infoWindowAnchor : new GPoint(9, 2)
});

$j(#mapFrame).jmap(
{
mapZoom: 11,
mapEnableKey: true,
mapCenter:[ 30,-97 ]
} );

function addCamPoint(i)
{
// cameras[][] is just an array with some geocoded locations.
var lat = cameras[i][0];
var lng = cameras[i][1];
var pHTML = div style='width:360px; height:340px;'Some Info Here/
div;

$j(#mapFrame).jmap(addMarker, {
pointLatLng: [lat, lng],
pointHTML: pHTML,
centermap: true,
icon: myIcon
});
}
}

for (i = 1; i  cameras.length; i++)
{ addCamPoint(i); }

});  // End DOM Ready




No matter what I do, the custom icon never gets added.  I've tried
overriding even the default options in the jMaps source code and to no
avail.  Anyone have any examples of how to use the jMaps plugin with
custom icons?

Thanks!


[jQuery] multiple selectors: returns array NOT in order of DOM

2008-06-04 Thread andjules

this is not a surprise... it is right in the docs:

 http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN
 Note order of the dom elements in the jQuery object aren't
 necessarily identical.

BUT, I need to match a handful of things and add to the first match in
the DOM, e.g.:
$('h2,h4,p,ul').eq(0).addClass('found-it');

unfortunately, it looks for all h2 THEN all h4 THEN all p THEN all ul,
instead of scanning the dom for matches in the order of the DOM...

So my question is: how would I achieve this: find the first match for
multiple selectors, as it appears in the DOM?

Thanks


[jQuery] Adverts destroy my JavaScript

2008-06-04 Thread [EMAIL PROTECTED]

Hi there,

I noticed a problem while including layer-ads. Firebug says

$(body) has no properties

HTML:

script type=text/javascript src={$path_js}plugins/jquery.js/
script
script type=text/javascript src={$path_js}ajax.js/script
script type=text/javascript src={$path_js}logoutScreen.js/
script
script type=text/javascript src=http://www.sponsorads.de/
script.php?s=116298/script

logoutScreen.js:

var Countdown = {
timer: 15,
stepSpeed: 1000,

initialize: function () {
if (!$(body).length) {
window.setTimeout(Countdown.initialize(), 500);
return;
}
$(body).append('div id=logoutBox/divdiv 
id=toPortalspan
id=countDownLinespan id=countDownNumber15/span seconds until
logout/span/div');
window.setTimeout(Countdown.step(), this.stepSpeed);
},
...
...

};

$(function() {
Countdown.initialize();
});

-

How may I avoide this? I tried things like $.getScript() but it
doesn't work (and the ad-company doensn't allow it anyway).
Any Ideas?

Eric Teubert


[jQuery] Re: multiple selectors: returns array NOT in order of DOM

2008-06-04 Thread Klaus Hartl

I can only think of somehow circumventing to use grouped selectors,
e.g. search by class (which is ugly probably):

$('.find-me').eq(0).addClass('found-it');

or search by universal selector and filter by type afterwards:

$('body *').filter('h2, h4, p, ul').eq(0).addClass('found-it');

Not sure if that yields the desired result... and how good it would
perform.


--Klaus



On 4 Jun., 22:11, andjules [EMAIL PROTECTED] wrote:
 this is not a surprise... it is right in the docs:

 http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN
  Note order of the dom elements in the jQuery object aren't
  necessarily identical.

 BUT, I need to match a handful of things and add to the first match in
 the DOM, e.g.:
 $('h2,h4,p,ul').eq(0).addClass('found-it');

 unfortunately, it looks for all h2 THEN all h4 THEN all p THEN all ul,
 instead of scanning the dom for matches in the order of the DOM...

 So my question is: how would I achieve this: find the first match for
 multiple selectors, as it appears in the DOM?

 Thanks


[jQuery] Re: jMaps Plugin - Unable to Add Custom Icon for Marker

2008-06-04 Thread Joe

For anyone that may want the answer to this, it is simple.  In the
options hash of the addMarker function, change 'icon' to 'pointIcon'
and presto.

Joe

www.subprint.com

On Jun 4, 3:39 pm, Joe [EMAIL PROTECTED] wrote:
 var $j = jQuery.noConflict();

 $j().ready(function()
 {

 var myIcon = $j.jmap.createIcon(
 {
 iconImage: http://www3.travelinfony.com/carsgoogle/images/
 camera.gif,
 iconSize : new GSize(15, 13),
 iconAnchor : new GPoint(9, 34),
 infoWindowAnchor : new GPoint(9, 2)

 });

 $j(#mapFrame).jmap(
 {
 mapZoom: 11,
 mapEnableKey: true,
 mapCenter:[ 30,-97 ]

 } );

 function addCamPoint(i)
 {
 // cameras[][] is just an array with some geocoded locations.
 var lat = cameras[i][0];
 var lng = cameras[i][1];
 var pHTML = div style='width:360px; height:340px;'Some Info Here/
 div;

 $j(#mapFrame).jmap(addMarker, {
 pointLatLng: [lat, lng],
 pointHTML: pHTML,
 centermap: true,
 icon: myIcon
 });
 }

 }

 for (i = 1; i  cameras.length; i++)
 { addCamPoint(i); }

 });  // End DOM Ready

 

 No matter what I do, the custom icon never gets added.  I've tried
 overriding even the default options in the jMaps source code and to no
 avail.  Anyone have any examples of how to use the jMaps plugin with
 custom icons?

 Thanks!


[jQuery] Re: jCarousel - Multiple rows in horizontal mode (or cols in vertical mode)

2008-06-04 Thread andrew morton

Rocking the tables like it's 1995... no better options? I guess if the
rows were divs with several images you could achieve the same effect.

On Apr 30, 11:54 am, Jan Sorgalla [EMAIL PROTECTED] wrote:
 Hi,

 you can put whatever you want inside the li items. It can be a
 single image or a table of 9 images.

 Jan

 On 30 Apr., 13:00, tekanet [EMAIL PROTECTED] wrote:

  Hello folks,
  I need to put multiple items in a carousel, placed on rows and cols,
  with horizontal scrolling.

  Examples. Now my carousel looks like this:

  -  [ITEM] [ITEM] [ITEM] -

  I want it like this:

      [ITEM] [ITEM] [ITEM]
  - [ITEM] [ITEM] [ITEM] -
      [ITEM] [ITEM] [ITEM]

  Is this possibile? Is there any other carousel component that works
  like this?

  TIA,
  tk


[jQuery] Extend Autocomplete

2008-06-04 Thread Tyler

I have a JavaScript function that makes an Ajax call and returns
results into a local variable.  I would like to call this function
from the Autocomplete plugin (http://bassistance.de/jquery-plugins/
jquery-plugin-autocomplete/) as my Ajax data souce.  I understand that
Autocomplete can use either a local variable or a URL, but the
framework I'm using has some built-in Ajax functions to set the value
of a variable, run a SQL query, and return the result.

I could do this by re-writing autocomplete, but I don't think that's
the best solution.

So, lets say I have some JavaScript function called getMyData, how
would I extend Autocomplete such that it calls getMyData instead of a
URL to get the results?

Thanks,
Tyler


[jQuery] Re: Extend Autocomplete

2008-06-04 Thread Jörn Zaefferer

Currently the plugin is constructed around the two supported
datasources, while needing a lot of refactoring to offer proper
support for other datasources.

As your datasource runs async, an option may be to intercept the
$.ajax method (see http://docs.jquery.com/Types#Proxy_Pattern). Your
proxy would check for a custom option or a certain URL, and if that is
used, delegate the request handling to your existing function,
triggering the success-callback in the same way $.ajax does. Something
like this:

(function() {
  // log all calls to setArray
  var proxied = jQuery.ajax;
  jQuery.ajax = function(options) {
if (options.autocomplete) {
  handleRequest(options.data, options.success);
}
return proxied.apply(this, arguments);
  };
});

Jörn

On Wed, Jun 4, 2008 at 11:35 PM, Tyler [EMAIL PROTECTED] wrote:

 I have a JavaScript function that makes an Ajax call and returns
 results into a local variable.  I would like to call this function
 from the Autocomplete plugin (http://bassistance.de/jquery-plugins/
 jquery-plugin-autocomplete/) as my Ajax data souce.  I understand that
 Autocomplete can use either a local variable or a URL, but the
 framework I'm using has some built-in Ajax functions to set the value
 of a variable, run a SQL query, and return the result.

 I could do this by re-writing autocomplete, but I don't think that's
 the best solution.

 So, lets say I have some JavaScript function called getMyData, how
 would I extend Autocomplete such that it calls getMyData instead of a
 URL to get the results?

 Thanks,
 Tyler



[jQuery] pausing a link and resuming its normal behavior

2008-06-04 Thread Shelane

If I click a link, I want to trigger a modal, and based on a response
from the modal, I either want to cancel the link click or make the
link be followed.  Has anyone done this sort of thing or know how to
accomplish it?


[jQuery] Refactoring Functions

2008-06-04 Thread Chris P

I wanted a script that would make a sticky footer, and it worked
perfectly with this (where 341 is the elements to offset).

var height = $(document).height();
var height = height - 341;
$('#footer').css('margin-top', height);

Then I want this code to re-run on browser resize.  I also want to
refactor the code above to use a second time.  The problem is that (1)
it doesn't re-run on browser resize and (2) I don't want to duplicate
code.  How can I refactor?

var height = $(document).height();
var height = height - 341;
$('#footer').css('margin-top', height);

$(window).resize(function(){
var height = $(document).height();
var height = height - 341;
$('#footer').css('margin-top', height);
});


[jQuery] Re: multiple selectors: returns array NOT in order of DOM

2008-06-04 Thread andjules

thanks, that pointed me in the right direction...

On Jun 4, 5:12 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 I can only think of somehow circumventing to use grouped selectors,
 e.g. search by class (which is ugly probably):

 $('.find-me').eq(0).addClass('found-it');

 or search by universal selector and filter by type afterwards:

 $('body *').filter('h2, h4, p, ul').eq(0).addClass('found-it');

 Not sure if that yields the desired result... and how good it would
 perform.

 --Klaus

 On 4 Jun., 22:11, andjules [EMAIL PROTECTED] wrote:

  this is not a surprise... it is right in the docs:

  http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN
   Note order of the dom elements in the jQuery object aren't
   necessarily identical.

  BUT, I need to match a handful of things and add to the first match in
  the DOM, e.g.:
  $('h2,h4,p,ul').eq(0).addClass('found-it');

  unfortunately, it looks for all h2 THEN all h4 THEN all p THEN all ul,
  instead of scanning the dom for matches in the order of the DOM...

  So my question is: how would I achieve this: find the first match for
  multiple selectors, as it appears in the DOM?

  Thanks


[jQuery] Re: Cornerz 0.4

2008-06-04 Thread sparkpool

Not a totally great solution, but there are proprietary
browser-specific attributes you could try, for Firefox and I think
Safari.

On Wed, Jun 4, 2008 at 11:17 AM, Andy Matthews [EMAIL PROTECTED] wrote:

 I want to clarify my point on this. Of all the corner plugins, I think this
 one is the best. It results in the least amount of extra code, and it's
 quite elegant.

 However, the page background issue is going to be a dealbreak for a good
 amount of people, myself included. If I was willing to forgo the gradient
 background for my site I'd use this plugin in a heartbeat.


 andy

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of DaveG
 Sent: Wednesday, June 04, 2008 10:06 AM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: Cornerz 0.4



 Andy Matthews wrote:
 it kept showing the squared-off corners in addition to the rounded
 corners. I finally figured out that the corner has to be set to the
 same color as the background.
 Ah, thanks for that. I had the same squared off problem (only in FF though).

 However in my case I'm using a gradient image as a background so this
 corner method won't work.
 Also had the same issue.


  ~ ~ Dave





[jQuery] Re: Refactoring Functions

2008-06-04 Thread Carl Von Stetten

How about this (untested):

var stickyFooter = function() {
var height = $(document).height();
var height = height - 341;
$('#footer').css('margin-top', height);
}

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

$(window).resize(
stickyFooter()
);

HTH,
Carl

Chris P wrote:
 I wanted a script that would make a sticky footer, and it worked
 perfectly with this (where 341 is the elements to offset).

 var height = $(document).height();
 var height = height - 341;
 $('#footer').css('margin-top', height);

 Then I want this code to re-run on browser resize.  I also want to
 refactor the code above to use a second time.  The problem is that (1)
 it doesn't re-run on browser resize and (2) I don't want to duplicate
 code.  How can I refactor?

 var height = $(document).height();
 var height = height - 341;
 $('#footer').css('margin-top', height);

 $(window).resize(function(){
   var height = $(document).height();
   var height = height - 341;
   $('#footer').css('margin-top', height);
 });


   


[jQuery] jqModal question

2008-06-04 Thread Mistraal


Good evening, I'm having a relatively small problem using jqModal. (I hope)

I have a page that contains a form. This form contains an input box. A link
beside this input box opens a jqModal window, so far no problems.

In this modal window I show the results of a database search with
pagination. Pagination works wonderfully, updating a div inside the modal
window. Even onclick events on links in code received via AJAX appear to
work. 

Well almost. This is where I have the problem. 

It appears that the 'jqmClose' class is being ignored on these links. The
onclick event works perfectly, updating the input box in the form on the
parent page, however the modal window does not close nor does the overlay
disappear. Obviously clicking again on the overlay it disappears fine, but
I'd like this to happen when the user selects an item in the list. 

How would I go about adding an inline script to my links so that not only
does it perform the onclick update element process, but also closes the
modal window and returns focus to the parent page?

Any thoughts would be gratefully received.

Regards,



Adam Frame
-- 
View this message in context: 
http://www.nabble.com/jqModal-question-tp17658960s27240p17658960.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Reading http headers out of an ajax response

2008-06-04 Thread sparkpool

Sorry to be a pest, but any takers on this? Does anyone know if it's
possible at all in javascript?

Thanks

On Wed, Jun 4, 2008 at 7:21 AM, sparkpool [EMAIL PROTECTED] wrote:

 Hi all,

 I know that jquery's ajax calls set the X-Requested-With header to
 'XMLHttpRequest' for ajax requests, making it really easy for the
 server side to detect them.

 Is there any way for jquery to read the http headers out an ajax
 response back from the server? I can see the ones I'm interested in in
 the firebug console, but when I dump the XMLHttpRequest object out
 from inside my ajax complete method, I don't see them anywhere.

 Does jquery provide any tools for this? Is it possible at all in
 javascript?

 Thanks



[jQuery] Re: Refactoring Functions

2008-06-04 Thread Carl Von Stetten

Better yet, change line second line of stickFooter function to:

var height = $(document).height() - 341;

And remove the third line entirely.

Carl

Carl Von Stetten wrote:
 How about this (untested):

 var stickyFooter = function() {
 var height = $(document).height();
 var height = height - 341;
 $('#footer').css('margin-top', height);
 }

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

 $(window).resize(
 stickyFooter()
 );

 HTH,
 Carl

 Chris P wrote:
   
 I wanted a script that would make a sticky footer, and it worked
 perfectly with this (where 341 is the elements to offset).

 var height = $(document).height();
 var height = height - 341;
 $('#footer').css('margin-top', height);

 Then I want this code to re-run on browser resize.  I also want to
 refactor the code above to use a second time.  The problem is that (1)
 it doesn't re-run on browser resize and (2) I don't want to duplicate
 code.  How can I refactor?

 var height = $(document).height();
 var height = height - 341;
 $('#footer').css('margin-top', height);

 $(window).resize(function(){
  var height = $(document).height();
  var height = height - 341;
  $('#footer').css('margin-top', height);
 });


   
 


   


[jQuery] Re: jqModal question

2008-06-04 Thread Josh Nathanson


Adam - you have to bind the jqmClose class in the onLoad callback. 
Otherwise, the links are not there to be bound yet.


So you might have something like this:

$(#modaldiv).jqm({
 trigger: 'a.modal_link',
 ajax: '@href',
 onLoad: function() {
 $(this).jqmAddClose(.jqmClose);
   }
});

-- Josh


- Original Message - 
From: Mistraal [EMAIL PROTECTED]

To: jquery-en@googlegroups.com
Sent: Wednesday, June 04, 2008 4:32 PM
Subject: [jQuery] jqModal question





Good evening, I'm having a relatively small problem using jqModal. (I 
hope)


I have a page that contains a form. This form contains an input box. A 
link

beside this input box opens a jqModal window, so far no problems.

In this modal window I show the results of a database search with
pagination. Pagination works wonderfully, updating a div inside the modal
window. Even onclick events on links in code received via AJAX appear to
work.

Well almost. This is where I have the problem.

It appears that the 'jqmClose' class is being ignored on these links. The
onclick event works perfectly, updating the input box in the form on the
parent page, however the modal window does not close nor does the overlay
disappear. Obviously clicking again on the overlay it disappears fine, but
I'd like this to happen when the user selects an item in the list.

How would I go about adding an inline script to my links so that not only
does it perform the onclick update element process, but also closes the
modal window and returns focus to the parent page?

Any thoughts would be gratefully received.

Regards,



Adam Frame
--
View this message in context: 
http://www.nabble.com/jqModal-question-tp17658960s27240p17658960.html
Sent from the jQuery General Discussion mailing list archive at 
Nabble.com.






[jQuery] Re: Reading http headers out of an ajax response

2008-06-04 Thread Karl Rudd

From a quick Google search I found
(http://www.hunlock.com/blogs/AJAX_for_n00bs):

# AJAX.getAllResponseHeaders() -- returns as a string all current
headers in use.
# AJAX.getResponseHeader(headerLabel) -- returns value of the
requested header.

Karl Rudd

On Thu, Jun 5, 2008 at 9:32 AM, sparkpool [EMAIL PROTECTED] wrote:

 Sorry to be a pest, but any takers on this? Does anyone know if it's
 possible at all in javascript?

 Thanks

 On Wed, Jun 4, 2008 at 7:21 AM, sparkpool [EMAIL PROTECTED] wrote:

 Hi all,

 I know that jquery's ajax calls set the X-Requested-With header to
 'XMLHttpRequest' for ajax requests, making it really easy for the
 server side to detect them.

 Is there any way for jquery to read the http headers out an ajax
 response back from the server? I can see the ones I'm interested in in
 the firebug console, but when I dump the XMLHttpRequest object out
 from inside my ajax complete method, I don't see them anywhere.

 Does jquery provide any tools for this? Is it possible at all in
 javascript?

 Thanks




[jQuery] help with array for flot

2008-06-04 Thread rolfsf

I'm playing with the flot plugin (http://code.google.com/p/flot/) and
need a little help

I want to take data from a series of text inputs (Quantity/Price
pairs) and plot them when a button is clicked.

I just don't understand enough about javascript and arrays to know how
to make an array from the inputs (I suspect it's simple)

I have this test page, which uses a hardcoded array to draw the graph:
http://www.monkeypuzzle.net/testfiles/jquery/flot/flot-test-1.htm

How do I get from:
table
tr
td1/td
tdinput type=text 
class=qty/input/td
tdinput type=text 
class=price/input/td
/tr
tr
td2/td
tdinput type=text 
class=qty/input/td
tdinput type=text 
class=price/input/td
/tr
tr
td3/td
tdinput type=text 
class=qty/input/td
tdinput type=text 
class=price/input/td
/tr
tr
td4/td
tdinput type=text 
class=qty/input/td
tdinput type=text 
class=price/input/td
/tr
tr
td5/td
tdinput type=text 
class=qty/input/td
tdinput type=text 
class=price/input/td
/tr
/table

to this?:

var d1 = [[5, 10], [10, 15], [20, 20], [30, 25], [40, 25]];

thanks!
rolf


[jQuery] Re: Sorting Divs by Span Value

2008-06-04 Thread Dave Methvin

 For some reason, when sorting numbers, it
 disregards the second number. So if I have {11,100, 500} it would sort
 it {100,11,500}. That is completely wrong.

Looks like it's doing a character sort, at least for the data set you
have there. Can you show the specific markup you'll have in this case?
I think I see what you're trying to do but I want to make sure I know
exactly what the markup looks like before I try some code.


[jQuery] Re: Refactoring Functions

2008-06-04 Thread Chris P

 Better yet, change line second line of stickFooter function to:

 var height = $(document).height() - 341;

 And remove the third line entirely.

 Carl

Thanks for responding Carl.  This is what I ended up using as you
prescribed.

script type=text/javascript
var stickyFooter = function() {
var height = $(document).height() - 341;
$('#footer').css('margin-top', height);
}
$(document).ready(
stickyFooter()
);
$(window).resize(
stickyFooter()
);
/script

But Firebug tells me document.body has no properties with the error
seemingly in the jQuery library.

Thanks!


[jQuery] Help with tabsLoad

2008-06-04 Thread keny

Hi thanks for reading

I am trying to load a link in a tab with this function with no
result :-(

function loadTab(tab){
var tab;
var $tabs = $('#container-8').tabs;
var selected = $tabs.tabsSelected();
$tabs.tabsLoad(selected,tab);

}
/script

The tab variable contain the page to load but noting happen what wrong
with that ?

Thanks you very much !!!


[jQuery] text box keeps focus when another element type is clicked ?

2008-06-04 Thread paulj

Hi,

When a text box has the focus, I would like it to keep the focus even
when another element type (not another text box) is clicked. eg after
clicking this other element type, the user can press a key(s) and the
text box will accept this key input without the user having to click
back into the text box.
Hope this makes sense.

Karl gave me some info. the other day and I was pretty sure I would be
able to fine-tune it for my app. but the best I could come up with
is :

$(document).ready(function()
{
  $(':text').blur(function(event)
  {
  if (!$(event.target).is(':text'))
  { $(this).focus() }
  });

});

Thanks for any help
Paul

Here is the full code :

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

head

title/title
meta http-equiv=Content-Type content=text/html;
charset=ISO-8859-1

  style type=text/css
  input { width : 700px ; }

  /style

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

$(document).ready(function()
{
  $(':text').blur(function(event)
  {
  if (!$(event.target).is(':text'))
  { $(this).focus() }
  });

});

 /script

/head

body

ul
liclick here/li
lior click here/li
/ul

br br

form

 input type='text' class='test' value='these text boxes should retain
the focus when another element type is clicked' brbr
 input type='text' value='these text boxes should retain the focus
when another element type is clicked' brbr
 input type='text'   value='these text boxes should retain the focus
when another element type is clicked' id='focusHere' br

/form

/body

/html








[jQuery] Re: help with array for flot

2008-06-04 Thread Leanan

This is kinda pseudocodish, but it should do what you want:
$('button selector').click(function()  {
  $('table tr').each(function() {
x = $(this + 'td:eq(1)');  //should grab the second td
y = $(this + 'td:eq(2)');  //should grab the third td
push(array,[x,y]);
  });
});

Of course if you have multiple tables you'll be iterating over all of
them, so you may need to an id to the table so that you can use that
to select the proper table.


[jQuery] Re: thoughts ? Announcing AJAX Libraries API: Speed up your Ajax apps with Google’s infrastructure

2008-06-04 Thread Matt Wilson

I'm trying to use the this, and I used a script tag to load, but then
when I tried to use the $(...), it seems to point to something else
entirely.

The jQuery(...) function still works fine.

This is copied from a firebug console:

 $(div)
null
 jQuery(div)

[div#header, div.bottomleft, div.nonsemantic, div.localnav, div#main,
div#recipients, div#tpo_recipients, div.nonsemantic, div.localnav,
div#_firebugConsole]

Any ideas?


[jQuery] jquery.flash error

2008-06-04 Thread skunkwerk

I'm getting the error:
block.call is not a function in line 95 of jquery.flash.js, as
reported by firebug

here's my javascript code:

$('#portal').flash(
{
  src: 'http://www.akbar.net/media/portal.swf',
  base: http://akbar.net/path/file/;,
  width: 600,
  height: 450,
  flashvars: { file: 'wudif', username: 'imran' }
},
{ version: 8 },
{ expressInstall: true }
);

html:
div id=portalYou need to install flash/div

suggestions/ideas?
thanks


[jQuery] Re: jquery json and zend_json

2008-06-04 Thread justcaldwell


I think you need to add more than '[]' to the json response. When you use the
...callback=? parameter, jQuery automatically generates a 
http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/ JSONP 
callback value and substitutes it for the '?'. So, the parameters that get
sent to your php script will include something like:

   ...callback=jsonp12126279...

You need to capture that generated value in your php script:

   $jsonp = $_GET['callback']

And prepend it to your json response:

   echo $jsonp.'('.$json-encode($job_data).')';

Your json response should end up looking something like:

   jsonp12126279({job_Description:My Job,job_Notes:My jobs notes are
here.})

Hope that helps,
Michael



jforth-2 wrote:
 
 
 Hey thanks for the help...
 
 I add the [] to the string. I don't get the invalid label error but
 nothing is alerted ? No errors in fire bug.
 
 
 On Dec 17, 4:10 pm, Benjamin Sterling
 [EMAIL PROTECTED] wrote:
 wrap it in [] like:
 [{job_Description:My Job,job_Notes:My jobs notes are here.}]

 On 12/17/07, jforth [EMAIL PROTECTED] wrote:




 
 
 

-- 
View this message in context: 
http://www.nabble.com/jquery-json-and-zend_json-tp14300277s27240p17660046.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jQuery().focus() not working in IE 7

2008-06-04 Thread nandu

Dear Folks,

I have been having a problem with the jquery foucs function not
working in IE 7.  I have a small piece of code showing a textbox that
is initially hidden.  Below is a simplified framework of the function
that does the opening

function (textbox_id)
{
 jQuery('#' + textbox_id).show();
 jQuery('#' + textbox_id).focus();

 var textboxObj = document.getElementById(textbox_id);

 if (typeof textboxObj.addEventListener != 'undefined')
 {
   textboxObj.addEventListener('change', sendUpdate, false);
   textboxObj.addEventListener('keypress', openNext, false);
 }
 // Fix for IE browsers
 else if (typeof textboxObj.attachEvent != 'undefined')
 {
  textboxObj.attachEvent('onchange', sendUpdate);
  textboxObj.attachEvent('onkeydown', openNext);
 }
}

The above code works in Firefox and Opera but does not seem to work in
IE 7.
Please do let me know if there is a way to solve this problem.

Thanks,
Yours sincerely,
Nandu
05 Jul 08


[jQuery] Re: help with array for flot

2008-06-04 Thread rolfsf


cool - that's part of what I need. Since I'm actually using inputs in  
the td's, wouldn't I need to get the value of the input within each td?


maybe I can figure that out from here...

(there's actually a plugin that converts tables to flot graphs... but  
since I'm using inputs in a table, I figured it wouldn't work)


thanks,
rolf



On Jun 4, 2008, at 7:39 PM, Leanan wrote:



This is kinda pseudocodish, but it should do what you want:
$('button selector').click(function()  {
  $('table tr').each(function() {
x = $(this + 'td:eq(1)');  //should grab the second td
y = $(this + 'td:eq(2)');  //should grab the third td
push(array,[x,y]);
  });
});

Of course if you have multiple tables you'll be iterating over all of
them, so you may need to an id to the table so that you can use that
to select the proper table.




[jQuery] Re: pausing a link and resuming its normal behavior

2008-06-04 Thread Karl Swedberg


Hi Shelane,

Have you considered using a simple confirm message?

For example:

$('a').click(function() {
var c = confirm('are you sure?');
if (!c) return false;
});

--Karl

Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jun 4, 2008, at 6:25 PM, Shelane wrote:



If I click a link, I want to trigger a modal, and based on a response
from the modal, I either want to cancel the link click or make the
link be followed.  Has anyone done this sort of thing or know how to
accomplish it?




[jQuery] Re: Refactoring Functions

2008-06-04 Thread Karl Swedberg


Hi Chris,

Looks like the problem lies with the lines where the function is being  
called. Either put it inside an anonymous function or use a named  
reference to the function instead. Try something like this.


$(document).ready(function() {
   stickyFooter();

   $(window).resize(function() {
  stickyFooter();
   });
});

or this ...

$(document).ready(function() {
   stickyFooter();

   $(window).resize(stickyFooter);
});

--Karl

Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jun 4, 2008, at 8:51 PM, Chris P wrote:




Better yet, change line second line of stickFooter function to:

   var height = $(document).height() - 341;

And remove the third line entirely.

Carl


Thanks for responding Carl.  This is what I ended up using as you
prescribed.

script type=text/javascript
var stickyFooter = function() {
var height = $(document).height() - 341;
   $('#footer').css('margin-top', height);
}
$(document).ready(
   stickyFooter()
);
$(window).resize(
   stickyFooter()
);
/script

But Firebug tells me document.body has no properties with the error
seemingly in the jQuery library.

Thanks!




[jQuery] Re: Refactoring Functions

2008-06-04 Thread Klaus Hartl

On 5 Jun., 06:22, Karl Swedberg [EMAIL PROTECTED] wrote:
 or this ...

 $(document).ready(function() {
     stickyFooter();

     $(window).resize(stickyFooter);

 });

How about:

$(function() {
$(window).resize(stickyFooter).trigger('resize');
});

You wouldn't need a named function here anymore:

$(function() {
$(window).
resize(function() {
var height = $(document).height() - 341;
$('#footer').css('margin-top', height);
}).
trigger('resize');
});

But do you really need JavaScript at all and can't let CSS do its job?

#footer {
position: fixed;
bottom: 0;
}


--Klaus