[jQuery] Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread pd

Hi All

I've been hacking with jQuery on and off lately and I've now hit the
annoying problem of not being able to access simple DOM 0 properties
unless, apparently, using either of the following syntaxes:

$('#foo')[0]

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

Eventually after scratching my head each time, I've found this syntax
answer again. However is this documented? I really find the jQuery
documentation very handy but I do not remember seeing this crucial
information within it.

It seems from searching this group, I'm not the only person who
perceives jQuery methods to provide additional functionality above
JavaScript, but to still allow access to the simple properties we are
all familiar with. If this is not the case, and it doesn't seem to be,
these and other syntax 'shortcuts' really should be documented and
very obviously at that, shouldn't they?

I can access the wiki and I'm happy to add this information though I
am not convinced I have a complete 'handle' on it.

pd



[jQuery] Re: What is wrong with this code?

2007-08-15 Thread Tane Piper

Yes, it's current planned in 1.2 which should be out in less than a
month.  Ganesh has also working on his LavaLamp plugin that provides
an animation stop to the menu.

To be honest it's one of these things that probably should have been
in before now, but people are only starting to see that's it's needed
now as we enter the age of rich-internet clients.


On 14/08/07, Eridius [EMAIL PROTECTED] wrote:


 Are there any current projects or planned projects to have animation stop
 and
 go back to how they were when another one is started, almost like group
 certain effect together and one one can be active at a time.  I think this
 is the only spot were mootools is much better than jQuery, which is
 animation.


 Karl Swedberg-2 wrote:
 
 
 
  On Aug 13, 2007, at 8:40 PM, Joel Birch wrote:
 
  On 8/14/07, Joel Birch [EMAIL PROTECTED] wrote:
  On 8/14/07, Eridius [EMAIL PROTECTED] wrote:
 
  That help quite a bit but still not the effect i am looking for.  I
  know this
  is ironic but i am looking for the effect on this home page on the
  right
  hand side:
 
  http://mootools.net/
 
  The thing that that effect has and this one does not is the is
  stops the
  effect once the mouse leaves if i move over a link real fast and
  then leave
  it.  in my code it perform the full effect even if my mouse is over
  it right
  away.  is there a way to stop the effect from fully complete if the
  mouse is
  move in and then out real fast?
 
  Would you like to take this one Karl ;)
 
  Joel.
 
  Seriously though, I think you will find that jQuery can not
  currently stop animations mid-way through. If it begins, it will
  animate fully and then remember to do the closing animation if you
  moused out in the meantime. I think the ability to stop animations
  mid-way is planned for a future release of jQuery.
 
  In the meantime I highly recommend looking at Brian Cherne's
  hoverIntent plugin as it will definitely help cut down on
  triggering unwanted animations for menus like this.
 
  haha, very funny, Joel. :-)
 
  I hope Ganeshji Marwaha doesn't mind my pasting a previous email of
  his that answers the same question:
 
  1. There is a plugin called hover intent. The primary purpose of
  this plugin is to stop these kind of actions on unintentional hovers.
  So, you can allow the user to move the mouse over ur link, and when
  it is clear that the users intention is to actually use the link,
  the hover event is fired. This can solve your problem although,
  this might not be what you are looking for.
 
  2. You can unbind the mouseover event when the animation starts and
  in the animation end callback you can bind the handler again. Same
  can be done for mouse out as well. This way if the user mouseovers
  the link, the unbind event happens and the animation starts. During
  this time if the user hovers over it again and again, your handler
  wont be called because you have unbound it already. Once the
  animation is done, attach the handler again.
 
  And you can see an implementation of suggestion #2 in Ganeshji's
  jQuerified version of another Mootools accordion thingie:
 
  http://www.gmarwaha.com/jquery/jkwick/test/test.html
 
  Just have a look at the source js. That should get you going in the
  right direction.
 
  This questions has been asked a lot lately. Anyone up for adding it
  to the frequently asked questions list? :)
 
 
  --Karl
  _
  Karl Swedberg
  www.englishrules.com
  www.learningjquery.com
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/What-is-wrong-with-this-code--tf4264306s15494.html#a12153000
 Sent from the JQuery mailing list archive at Nabble.com.




-- 
Tane Piper
http://digitalspaghetti.me.uk

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


[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread Erik Beeson
var a = $(...);
var b = a.length;
a.XXX();
var c = a.get(0);

Now, 'a' is a jQuery object that contains all of the elements that matched
the selector. 'b' is the number of elements found. The third line is calling
a jQuery function or plugin on the jQuery object that is wrapping the
selected elements. 'c' is the DOM node for the first selected element. To
call a jQuery function or plugin, use 'a', to access DOM properties of the
first element, use 'c'. To access DOM properties of all of the elements that
are wrapped by the jQuery object, use each().

The [n] syntax is just a shortcut for .get(n):
http://docs.jquery.com/Core#get.28_num_.29

Does that help any?

--Erik

On 8/14/07, pd [EMAIL PROTECTED] wrote:


 Hi All

 I've been hacking with jQuery on and off lately and I've now hit the
 annoying problem of not being able to access simple DOM 0 properties
 unless, apparently, using either of the following syntaxes:

 $('#foo')[0]

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

 Eventually after scratching my head each time, I've found this syntax
 answer again. However is this documented? I really find the jQuery
 documentation very handy but I do not remember seeing this crucial
 information within it.

 It seems from searching this group, I'm not the only person who
 perceives jQuery methods to provide additional functionality above
 JavaScript, but to still allow access to the simple properties we are
 all familiar with. If this is not the case, and it doesn't seem to be,
 these and other syntax 'shortcuts' really should be documented and
 very obviously at that, shouldn't they?

 I can access the wiki and I'm happy to add this information though I
 am not convinced I have a complete 'handle' on it.

 pd




[jQuery] Re: How do I bind this into the DOM?

2007-08-15 Thread Erik Beeson
You may want to return false; at the end of your click handler function
that you bind to #pendingUsers a so that the link won't be followed.

--Erik


On 8/14/07, Steve Finkelstein [EMAIL PROTECTED] wrote:

 Hi all,

 This is a rather complicated issue, for a novice at least.

 I have HTML that gets injected into the DOM, and this is after a
 completely separate HTML gets injected via .load() into a separate div.

 So essentially, when you load the page, a div gets populated with .load(),
 and when you click a link from that populated data, more HTML gets injected
 via the following code:

 $('#pendingUsers').load(' index.php/meduser/check_pending_users',false,
 function() {
  $('#pendingUsers a').click(function() {
  $.post('index.php/meduser/pull_user_information', {id:
 $(this).attr('rel')},
  function(data) {
  $('#main').html(data);
  }
  );
  });
 });

 I'm looking to bind .click() to an element within $('#main').html(data);,
 over to input type=button id=button name=accept value=Accept

 Would anyone be kind enough to give me hints as to how I can access my
 button via a click action in this setup?

 Thank you kindly for all of your assistance!





[jQuery] Re: jQuery for JavaScript programmers

2007-08-15 Thread Tane Piper

Very clear and concise article - it should get linked to on the
documention page as a good beginners tutorial.


On 15/08/07, Erik Beeson [EMAIL PROTECTED] wrote:
 Here's a really nice jQuery introduction that starts at the beginning and
 goes all the way through plugin development. It looks pretty thorough:

 http://simonwillison.net/2007/Aug/15/jquery/

 --Erik



-- 
Tane Piper
http://digitalspaghetti.me.uk

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


[jQuery] Re: jQuery for JavaScript programmers

2007-08-15 Thread Ganeshji Marwaha
+1 - to linking this from the jquery site...

-GTG


On 8/15/07, Tane Piper [EMAIL PROTECTED] wrote:


 Very clear and concise article - it should get linked to on the
 documention page as a good beginners tutorial.


 On 15/08/07, Erik Beeson [EMAIL PROTECTED] wrote:
  Here's a really nice jQuery introduction that starts at the beginning
 and
  goes all the way through plugin development. It looks pretty thorough:
 
  http://simonwillison.net/2007/Aug/15/jquery/
 
  --Erik
 


 --
 Tane Piper
 http://digitalspaghetti.me.uk

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



[jQuery] Re: jQuery for JavaScript programmers

2007-08-15 Thread Tane Piper

Done

On 8/15/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 +1 - to linking this from the jquery site...

 -GTG



 On 8/15/07, Tane Piper [EMAIL PROTECTED] wrote:
 
  Very clear and concise article - it should get linked to on the
  documention page as a good beginners tutorial.
 
 
  On 15/08/07, Erik Beeson [EMAIL PROTECTED] wrote:
   Here's a really nice jQuery introduction that starts at the beginning
 and
   goes all the way through plugin development. It looks pretty thorough:
  
   http://simonwillison.net/2007/Aug/15/jquery/
  
   --Erik
  
 
 
  --
  Tane Piper
  http://digitalspaghetti.me.uk
 
  This email is: [ ] blogable [ x ] ask first [ ] private
 




-- 
Tane Piper
http://digitalspaghetti.me.uk

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


[jQuery] Re: How to test if plugin X is loaded ?

2007-08-15 Thread xavier

Thanks, didn't search the doc at the right place (was looking into
core, that's under ajax).

Why would you question if I really want to do that ? What would be the
reason/risk of doing it ?

X+

On Aug 15, 1:09 am, Erik Beeson [EMAIL PROTECTED] wrote:
 I question whether or not you really want to be doing that... But here's
 both questions in one go:

 if(!$.isFunction($.fn['pluginName'])) {
   $.getScript('/path/to/plugin', function() {
 alert('Plugin ready');
   });} else {

   alert('Plugin ready');

 }

 That assumes the plugin is on the same domain as the current page. If not,
 getScript won't work, so you'd have to do something like:

   var script = document.createElement('script');
   script.type = 'text/javascript';
   script.src = '/path/to/plugin';
   $('head')[0].appendChild(script);

 But then you don't get the nice callback stuff to ensure that it's loaded.

 --Erik

 On 8/14/07, Benjamin Sterling [EMAIL PROTECTED] wrote:



  Xavier,
  For question #1:  if(typeof $.fn.tableSorter == 'function')

  question #2: yes, you just need to know the path to the file and do a
  document.write('script...

  On 8/14/07, xavier [EMAIL PROTECTED] wrote:

   Hello,

   I'd like to be able to test if a specific plug in is loaded before
   calling some of its properties (to avoid throwing an error).

   Second question, is it possible to load it if missing ?

   Use case:

   I have a bit of template that have a sortable table of users, and
   another one that list groups. They both have a sortable table, and
   might be included into the same page or used separately.

   I'd rather not load on all the pages the sortable table plugin, so I
   have to be able to detect on each of these template if the plugin is
   already loaded or if I have to load it (or not call the .tableSorter()
   method).

   Any suggestion ?

   Thanks in advance,

   X+

  --
  Benjamin Sterling
 http://www.KenzoMedia.com
 http://www.KenzoHosting.com



[jQuery] serverCookieJar, thoughts please

2007-08-15 Thread James Dempster

after Dan G. Switzer, II mentioned here
http://groups.google.com/group/jquery-en/browse_frm/thread/cf786440e6154366/16e79411ae8b118d#16e79411ae8b118d
regarding cookies being sent with every request and the 4KB limit it
got me thinking, maybe store this on the server and make one request
for it each page load, it might make more sense then sending it
backwards and forwards all the time.

So I tried to make serverCookieJar example here
http://www.jdempster.com/wp-content/uploads/2007/08/jquery.servercookiejar.example.html
http://www.jdempster.com/wp-content/uploads/2007/08/jquery.servercookiejar.js

I'm abit unsure about the design regarding line 50  68 where I make a
synchronous ajax request which could tie the browser up until the
request is complete. I think I can safely remove this from the save
function. But for the load function it's important that this data is
brought down before anything else is done.

What are peoples thoughts on this?

/James



[jQuery] Tweaks to jCarouselLite

2007-08-15 Thread Kelvin Luck


Hi,

I've just tried to implement jCarouselLite [1] on a project I'm working 
on. Nice plugin - perfect for my needs of a lightweight carousel for 
this project :)


But I came across a couple of problems. For some reason, when I set 
circular to false the carousel stopped animating for me. Not sure why as 
it works on the example on the authors site - maybe because my carousel 
had more items in... Or maybe because I have more than one carousel on 
the page...


I also wanted to update the state of the previous and next buttons when 
the plugin initialised and set them to disabled if necessary. So I made 
a couple of changes to the plugin - you can get the changed file here:


http://kelvinluck.com/assets/jquery/jCarouselLite/jquery.jcarousellite.js

And a patch showing the changes here:

http://kelvinluck.com/assets/jquery/jCarouselLite/jquery.jcarousellite.js.patch

Hope that's helpful,

Kelvin :)

[1] http://www.gmarwaha.com/jquery/jcarousellite/


[jQuery] Re: Tabs not working

2007-08-15 Thread Klaus Hartl


Eridius wrote:


I am trying to use the Tabs plugin but it is not really working.  her eis my
demo:

http://www.apex-wowguild.com/dev

It work when you first click on the click but when you go back to a link, it
just does not shouw anything.  I am just using .tabs() and the html looks
good to me.


I really can't see any reason why it shouldn't work...

Maybe it somehow interferes with some other plugin. But could you first 
tabs without history, e.g. remove the history plugin from the included 
scripts?




--Klaus


[jQuery] Re: Tabs not working

2007-08-15 Thread Stephan Beal

On Aug 15, 1:12 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 I really can't see any reason why it shouldn't work...

It seems that the problem has something to do with this:

Before clicking a tab:
div id=one class=tabs-container tabs-hideTEST/div
div id=two class=tabs-containerTEST/div

After clicking a tab:
div id=one class=tabs-container tabs-hideTEST/div
div id=two class=tabs-container tabs-hide style=TEST/div

Note that both tabs now have the tabs-hide style.



[jQuery] Draggables help

2007-08-15 Thread Gordon

As I just can't track down a javascript slider that can cope with two
handles satisfactorially, I am trying to implement my own using just
the Draggable functionality of the interface library.

I need to make a slider for selecting a minimum and maximum limits of
a range of values that:

* cope with 2 handles in the slider
* can snap the handles to notches while dragging, the size of which
doesn't change based on the position of either of the sliders
* will not allow the handles to either pass each other or overlap

So far this is as far as I have got:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleUntitled Document/title
/head
script type=text/javascript src=/js/jquery/jquery.js/script
script type=text/javascript src=/js/jquery/interface/
interface.js/script
style type=text/css
/* Sliders */
.slider {
width: 171px;
height: 58px;
position: relative;
margin: 2px;
padding: 0px;
overflow: hidden;
background: url(configurator%209/ui/configurator/range_chart.gif) no-
repeat top;
}
.slideDomain {
position: absolute;
height: 100%;
}
.leftDomain {
left: 0px;
}
.rightDomain {
right: 0px;
}
.slideHandle {
width: 19px;
height: 58px;
position: absolute;
font-size: 0;
line-height: 0;
overflow: hidden;
border: none;
top: 0px;
}
.leftHandle {
background: url(configurator%209/ui/configurator/
range_handle_left.gif) no-repeat bottom;
}
.rightHandle {
left: 152px;
background: url(configurator%209/ui/configurator/
range_handle_right.gif) no-repeat bottom;
}

/style
script type=text/javascript

function RangeSlider (slideContainer, slideMin, slideMax, fieldMin,
fieldMax, rangeMin, rangeMax)
{
var self= this;
self.container  = $(slideContainer);
self.handleMin  = $(slideMin);
self.handleMax  = $(slideMax);

self.notches= 10;
self.spacing= Math.round (self.container.width () / self.notches);

console.log (self.minLeft   = parseInt (self.handleMin.css ('left'),
10));
console.log (self.maxLeft   = parseInt (self.handleMax.css ('left'),
10));

var leftDraggable   = self.handleMin.Draggable ({
containment : 'parent',
grid: self.spacing,
onDrag  : function (newX)
{
if (newX = self.maxLeft)
{
console.log ('Left too far');
$('#dragHelper').css ('left', self.maxLeft - 
self.grid);
}
},
onChange: function ()
{
self.minLeft= parseInt (self.handleMin.css 
('left'), 10);
}
});
var rightDraggable  = self.handleMax.Draggable ({
containment : 'parent',
grid: self.spacing,
onDrag  : function (newX)
{
if (newX = self.minLeft)
{
console.log ('Right too far');
$('#dragHelper').css ('left', self.minLeft + 
self.grid);
}
},
onChange: function ()
{
self.maxLeft= parseInt (self.handleMax.css 
('left'), 10);
}
});
}

var test;
$(document).ready (function ()
{
test= new RangeSlider ('#slider1', '#left', '#right', 0, 0, 0, 0);
});
/script
body
/body
div class=slider id=slider1
  div class=slideHandle leftHandle id=leftnbsp;/div
  div class=slideHandle rightHandle id=rightnbsp;/div
/div
/html

At the moment I'm trying to implement code that wil restrict the
handle being dragged from sliding past the other one.  What I have
written does successfully detect when one handle is overlapping or
passing the other, but the code to reposition the drag helper to an
acceptible location doesn't seem to work.

Does anyone know what I'm doing wrong here?



[jQuery] Modals don't mask whole page with Ext and jQuery

2007-08-15 Thread Neil

Hi there.

I posted a bug concerning modals not masking the whole page with
jQuery on the Ext forum.

Jack Slocum has responded saying The problem was reported a while
back to jQuery. It has to do with viewport/document size not returning
the largest value. If the document height is smaller than the window
height, then the document height should be the window height. In
jQuery that is not the case. You may want to log a bug there.

The full write up on producing the bug is at 
http://extjs.com/forum/showthread.php?t=11086.

Any advice on an interim workaround until the core is fixed would be
really appreciated.

Regards,
Neil.



[jQuery] Selecting the current (this) dt on a collapsible menu

2007-08-15 Thread jorgeBadaBing

I adapted John's example of a collapsible menu but have a problem
selecting the current dt.

John's example can be found at: http://jquery.com/files/demo/dl-done.html

I pretty much has this so far:

pre
script
$(document).ready(function(){
$(div#Kcleftnav dt).addClass(productList);
$(div#Kcleftnav dd).hide();
$(div#Kcleftnav dt a).click(function(){
$(div#Kcleftnav
dt:first).removeClass(productList).addClass(menuSelected);
$(div#Kcleftnav dd:visible).slideUp(normal);
$(this).parent().next().slideDown(normal);
return false;
});

});
/script
/pre

As you can see on the fifth line, I remove the existing class that I
assigned to the menu and change the class so I can add a different
icon to the current dt tag. unfortunately I don't know how to say,
only do it to this dt

I also ran into the problem if once I think on another title (dt) the
previous one remains with the unchange icon, which looks like it's
open but is not.

Pretty much I only wanted to add a plus and minus to the left of each
dt on John's example.

I know I right now say on line 5: div#Kcleftnav dt:first, and is
not :first that I need but something like :this, I even tried but it
doesn't work, I also changed the whole div#Kcleftnav dt:first for
(this) but it didn't work either.

div#Kcleftnav dt:first seems to be the closes to what I want but
only work and changes the icon on the first dt of the list, I want it
to be the one that they click, no just the first one.

Any help with me appreciated guys,

thanks!


J.



[jQuery] Re: Issue with .ajax incrementally submitting.

2007-08-15 Thread deepreel

Come on folks please someone enlighten me as to why each time this
ajax is called the error, success functions are called (but the ajax
itself is not executed) n times.

The code below is in a click event. If I click once I get 1 error
response, if I click a second time I will get 2 exec's of the error
response, click a 3rd and 3 exec's of the error response

On Aug 14, 1:24 pm, deepreel [EMAIL PROTECTED] wrote:
 Correction the ajax isn't actually submitting multiple times but the
 function in the error function (when I test  an error use case) get
 called incrementally more times with each event.

 On Aug 14, 10:40 am, deepreel [EMAIL PROTECTED] wrote:

  Folks, I'm fiddling with jquery for the first time and have an issue:

  var dnsData=smode=clearnodehn=+hn+oldip=+ip+entry=+entry;
  $.ajax({
  url: UpdateEntry,
  type: POST,
  dataType: html,
  data: dnsData,
  success: 
  function(msg){

  
  alert(DNS Update Succeeded);

  },
  error: 
  function(msg){
  
  alert(Critical Error in DNS Update. No changes applied.
  Please manually check  UDNS for \n+hn+ set to 1.1.1.1);

  }
  });

  The preceeding code technically works but if I get an error from the
  UpdateEntry servlet it throws the alert, however the next time I
  trigger the same ajax call (without reloading the page) I get 2 error
  alerts, then 3 then 4 ever incrementing. JS debugging seems to
  indicate that the

  // Handle the global AJAX counter
  2058 if ( s.global  ! --jQuery.active )
  2059 jQuery.event.trigger( ajaxStop );

  jquery global counter is getting increased on each call so that it
  essentially counts down with each error function call until the point
  where ajaxStop is triggered.

  I'm sure I'm missing something obvious. Any guidance would be
  appreciated. Note I have not done any .ajaxSetup else where in the
  page the above is the entirety of my .ajax call.

  Cheers folks.

  P.S. thanks for the great tool.



[jQuery] Re: display Please wait while waiting for a database query.

2007-08-15 Thread VS

Hello,

I have a php web application and sometimes the database query will
take a while to process results.  Using JQuery, is it possible to
display a Please wait message and then clear it when the
database query completes ( the code comes out of an foreach
condition ).

Please let me know..

Thank you.
-VS.



[jQuery] Interface slider - get value of multiple handles

2007-08-15 Thread Simpel

Hi there!

so...I've been looking at the interface slider (http://
interface.eyecon.ro/demos/slider.html)

I'd like to use two horizontal sliders but how do I get the current
value for them, the onSlide function only seems to display the value
for the slider that was changed last, I wan't to be able to pull the
values for both handles whilst dragging one of them

/Joel



[jQuery] Re: Submit form via Ajax

2007-08-15 Thread Maggi

Mike Alsup, you are my hero! :)

On Aug 14, 1:19 pm, Mike Alsup [EMAIL PROTECTED] wrote:
 Magnus,

 Add

 tinyMCE.triggerSave();

 before you iterate the inputs.

 Mike

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



  Hey guys!

  I just wanted to check if someone knows how to implement TinyMCE into
  a Ajax Form Submit script?  It looks like TinyMCE ( the WYSIWYG
  editor ) writes the data in it's iframe into the hidden textarea but
  it does not do so until after the code below has finished:

  $('#new_textfield').submit(function() {
  var inputs = [];
  $(':input', this).each(function() {
  inputs.push(this.name + '=' + 
  escape(this.value));
  });
  console.log(inputs.join(''));
  return false;
  });

  So when I click Submit the first time, it just displays the textarea
  as empty, but the second time I click Submit it displays the text.

  Can anyone turn me into the right direction?

  Sincerely,
  Magnus



[jQuery] jQuery and UTF8

2007-08-15 Thread barophobia

Hello,

I've got some Japanese text in my MySQL database that shows up
correctly through phpMyAdmin as well as when it is loaded directly as
HTML.

However, when I load it through .load() it only shows up as question marks.

Is there an obvious solution? I couldn't find any good info on jQuery
and UTF8 when searching.

Also, when I try to add Japanese through AJAX it is saved (and
returned from the db) like %uD0A4%uC544.



Thanks,
Chris.


[jQuery] Re: input type=button / : which event is that?

2007-08-15 Thread lukek

Thanks Stephen. sorry about the typo. Surely this will only fire when
I click on the button? What about when you hit enter while the button
has focus? My question - badly put I know - was is there a rolled-into-
one event name for when a button is clicked or selected with the keys?



[jQuery] Re: Dimensions 1.1 Released

2007-08-15 Thread Michael Schwarz [MVP]

Ok, so I have first to create a new variable, check if it is null or
not, and then get the height?

var h = 0;
var ele = $(#id1:visible);
if(ele.length  0) h = ele.outerHeight({margin: true});
if(h  0) $(#id2).height(h);


instead I would like to write:

$(#id2).height($(#id1:visible).outerHeight({margin: true}));


When I use the .height method of jQuery I get null as return value,
that would be ok instead of throwing an error.

Michael







On Aug 13, 1:42 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
 The error has been tricky issue. Most jQuery functions operate on zero or
 more elements in a jQuery collection. However, some methods only operate on
 the first matched element and return some value. If a script is depending on
 a value from the offset method, there will be an error somewhere. I'm just
 trapping the error, otherwise it is very cryptic to those who haven't seen
 it before. returning anything like 0 instead of an error would just cause
 even more confusion because it would look like it was reporting a height or
 width of 0.

 Thanks for the feedback! :)

 --
 Brandon Aaron

 On 8/13/07, Michael Schwarz [MVP] [EMAIL PROTECTED] wrote:





  Hi,

  I love this, as I did a very similar plugin. Well, the only thing I
  don't like is the error() in all  methods. Maybe it should return 0
  instead, and somewhere else the plugin could be configured to throw an
  exception or return 0.

  Michael

  On Aug 13, 6:34 am, Brandon Aaron [EMAIL PROTECTED] wrote:
   I just released Dimensions 1.1. It includes an option to include margin
  for
   the outerWidth and outerHeight methods. I've also fixed the issues with
   Safari 3 and the offset method. The docs have also been udpated for 1.1.
  As
   usual you can grab the latest from the Dimensions project page. Note
  that
   this update requires jQuery 1.1.3.

   project page:http://jquery.com/plugins/project/dimensions/
   docs:http://brandonaaron.net/docs/dimensions/

   --
   Brandon Aaron- Hide quoted text -

 - Show quoted text -



[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread gradez28

Very nice! I have never bothered messing with compression before but
now that I'm writing a rather large web app i need to make it as lean
as possible. According to firebug I trimmed off 20% of my js size by
piping all the JS through this! :)



[jQuery] Do my emails make it to the list?

2007-08-15 Thread barophobia

I can see my emails in the Gmail interface but it doesn't seem that
they're actually making it to everyone else.

Please respond (off list).



Thanks,
Chris.


[jQuery] Re: Help with autocomplete

2007-08-15 Thread SteelSoftware

Bump,
Does anyone have any suggestions?

On Aug 13, 10:17 pm, SteelSoftware [EMAIL PROTECTED] wrote:
 Hi all,

 I'm having some trouble with theautocompleteplugin from
 bassistance.de
 I'm doing a multiple-select box, original code copied from the
 example, but there are a couple of things that I need changing:

 1. I don't want the result function to trigger when a new item is
 selected as it does in the example
 2. I want the get values function to be triggered from outside the
 div that the select box is in (it's currently result(function).next...

 Also, this current bit of code I've got doesn't want to work in Opera
 (9.2) but will work in FF/IE

 Anyhelpwould be great thanks, I've only just got into jQuery and I'm
 loving it, but some things are tricky (especially late at night!)

 Many thanks

 Steve
 Steel Software

 Code:

 $(document).ready(function(){
 function formatItem(row) {
 return row[0]+ (+row[2]+, +row[4]+ +row[3]+);
 }

 function formatResult(row) {
 return row[0];
 }
 function findValueCallback(event, data, formatted) {
 $(li).text( !data ? No match! : Selected:  +
 formatted).appendTo(#result);
 }
 $(#squadSearch).autocomplete(ajax/searchpeople.php, {
 delay: 150,
 multiple: true,
 mustMatch: true,
 autoFill: true,
 formatItem: formatItem,
 formatResult: formatResult,
 });
 // This line needs to be changed for the submit to work!!
 $(#squadSearch).result(findValueCallback).
 (input#submit).click(function() {
 $(this).prev().search();
 });

 });



[jQuery] Help with this ajax call

2007-08-15 Thread deepreel

Folks,

I'm missing something here but can't figure it.

The following is inside a $('#xx').click event handler that inside a
div that is originally hidden until a parent is clicked. The the
revealed #xx button is clicked firing this:

var dnsData=smode=clearnodehn=+hn+oldip=+ip+entry=+entry;
$.ajax({
url:
UpdateEntry,
type: POST,
dataType:
html,
data:
dnsData,
success:
function(msg){

 
alert(DNS Update Succeeded);

},
error:
function(msg){
 
alert(Critical Error in DNS Update. No changes applied.
Please manually check  UDNS for \n+hn+ set to 1.1.1.1);

}
});

The POST itself is working, but each time this event set is fired the
POST itself get's executed only once but either success or error local
function gets executed x times. i.e. first time I fire this event (in
an error condition) error gets called once, but if I click again it
get's fired twice, again and three times etc etc.

Or if I click away from the #xx button (which rehides it's parent div)
then reveal it again the same thing happens.

Debugging via Firebug seems to show that

// Handle the global AJAX counter
2058 if ( s.global  ! --jQuery.active )
2059 jQuery.event.trigger( ajaxStop );

jQuery.active is incrementing on each execution of the #xx button,
which then in turn decreases on each call to - for example the error
function - until finally ajaxStop is called.

I've tried setting global: false in the ajax above but to no avail.

also I have a .post in the same page that seems to show the same
behaviour.

I'm have no idea what is causing this, any help would be greatly
appreciated.

Cheers



[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread gradez28

Just curious, how exactly do you expect to be able to access a 0
object?
Are you thinking you can go: object.0.function()?
If so, regardless of how cool jQuery is, when an array's key uses
numerics, you simpy cannot access it as an object because objects must
start with an alpha character. I dont think there are any languages
that allow you do create/access an object that starts with a number.



On Aug 15, 1:29 am, pd [EMAIL PROTECTED] wrote:
 Hi All

 I've been hacking with jQuery on and off lately and I've now hit the
 annoying problem of not being able to access simple DOM 0 properties
 unless, apparently, using either of the following syntaxes:

 $('#foo')[0]

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

 Eventually after scratching my head each time, I've found this syntax
 answer again. However is this documented? I really find the jQuery
 documentation very handy but I do not remember seeing this crucial
 information within it.

 It seems from searching this group, I'm not the only person who
 perceives jQuery methods to provide additional functionality above
 JavaScript, but to still allow access to the simple properties we are
 all familiar with. If this is not the case, and it doesn't seem to be,
 these and other syntax 'shortcuts' really should be documented and
 very obviously at that, shouldn't they?

 I can access the wiki and I'm happy to add this information though I
 am not convinced I have a complete 'handle' on it.

 pd



[jQuery] Re: Problem with selectors in Internet Exploter

2007-08-15 Thread David Garcia Ortega

Hi George,

Thanks a lot for your answer, it did the trick!;)

I finally used your recomendation:

var iID_tutorial = $(this).siblings(input:checkbox).val();

   and works perfectly in Firefox and IE7.


Thanks again,

David.



[jQuery] More (or less) than I bargained for

2007-08-15 Thread Aaron Mackley

I need some brief help.

I am developing a web site and recently received a small app that builds 
a quiz and answers.  Users who take the quiz receive a detailed answer 
based on their questions and the answers that I have recorded. The user 
submits a First Name and an email address so that the analysis can be sent.

Here's the problem. The script does not contain the code to send the 
email either to me or to the user. Although I dabble in code, I have not 
used jQuery. I believe the code will be rather simple, but both my 
current stress level and time restraints suggest I ask for some help.

Is there someone that can look at this code and help me get this 
launched? I will try to compensate as necessary.



[jQuery] Re: Tabs not working

2007-08-15 Thread Klaus Hartl


Eridius wrote:


I am trying to use the Tabs plugin but it is not really working.  her eis my
demo:

http://www.apex-wowguild.com/dev

It work when you first click on the click but when you go back to a link, it
just does not shouw anything.  I am just using .tabs() and the html looks
good to me.


The html may look good to you, but it isn't. It's invalid, you're using 
the id one twice in your document (once for the tabs) and that is why 
the tabs do not work as expected.


Please make sure to validate your HTML! That is once again an example 
why standards are important and how invalid HTML has effect on scripting 
as well.


Here's a link to the W3C HTML validator:
http://validator.w3.org/

If you've installed the Web Developer Toolbar validating is as easy as 
hitting a key stroke.



--Klaus



[jQuery] Re: More (or less) than I bargained for

2007-08-15 Thread Alexandre Plennevaux

Aaron, you would have to use a serverside language such as php or ruby on
rails in order to send an email. Javascript can't help you in this matter. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Aaron Mackley
Sent: mercredi 15 août 2007 7:39
To: jquery-en@googlegroups.com
Subject: [jQuery] More (or less) than I bargained for


I need some brief help.

I am developing a web site and recently received a small app that builds a
quiz and answers.  Users who take the quiz receive a detailed answer based
on their questions and the answers that I have recorded. The user submits a
First Name and an email address so that the analysis can be sent.

Here's the problem. The script does not contain the code to send the email
either to me or to the user. Although I dabble in code, I have not used
jQuery. I believe the code will be rather simple, but both my current stress
level and time restraints suggest I ask for some help.

Is there someone that can look at this code and help me get this launched? I
will try to compensate as necessary.

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.483 / Base de données virus: 269.11.19/953 - Date: 14/08/2007
17:19
 



[jQuery] Re: Issue with .ajax incrementally submitting.

2007-08-15 Thread Mike Alsup

deepreel,

There must be something you're not telling us.  Please make a page
available publicly if possible.  Strip it down to the bare bones -
just enough to exhibit the problem you're seeing.

Mike


On 8/15/07, deepreel [EMAIL PROTECTED] wrote:

 Come on folks please someone enlighten me as to why each time this
 ajax is called the error, success functions are called (but the ajax
 itself is not executed) n times.

 The code below is in a click event. If I click once I get 1 error
 response, if I click a second time I will get 2 exec's of the error
 response, click a 3rd and 3 exec's of the error response

 On Aug 14, 1:24 pm, deepreel [EMAIL PROTECTED] wrote:
  Correction the ajax isn't actually submitting multiple times but the
  function in the error function (when I test  an error use case) get
  called incrementally more times with each event.
 
  On Aug 14, 10:40 am, deepreel [EMAIL PROTECTED] wrote:
 
   Folks, I'm fiddling with jquery for the first time and have an issue:
 
   var dnsData=smode=clearnodehn=+hn+oldip=+ip+entry=+entry;
   $.ajax({
   url: 
   UpdateEntry,
   type: POST,
   dataType: html,
   data: dnsData,
   success: 
   function(msg){
 
   
   alert(DNS Update Succeeded);
 
   },
   error: 
   function(msg){
   
   alert(Critical Error in DNS Update. No changes applied.
   Please manually check  UDNS for \n+hn+ set to 1.1.1.1);
 
   }
   });
 
   The preceeding code technically works but if I get an error from the
   UpdateEntry servlet it throws the alert, however the next time I
   trigger the same ajax call (without reloading the page) I get 2 error
   alerts, then 3 then 4 ever incrementing. JS debugging seems to
   indicate that the
 
   // Handle the global AJAX counter
   2058 if ( s.global  ! --jQuery.active )
   2059 jQuery.event.trigger( ajaxStop );
 
   jquery global counter is getting increased on each call so that it
   essentially counts down with each error function call until the point
   where ajaxStop is triggered.
 
   I'm sure I'm missing something obvious. Any guidance would be
   appreciated. Note I have not done any .ajaxSetup else where in the
   page the above is the entirety of my .ajax call.
 
   Cheers folks.
 
   P.S. thanks for the great tool.




[jQuery] Re: Modals don't mask whole page with Ext and jQuery

2007-08-15 Thread Brandon Aaron
I responded to the thread over on the ext forums. Here is what I said:

The jQuery Dimensions plugin simply returns the document height or the
window height. Returning the Math.max( $(document).height(),
$(window).height() ); for $(document).height() would not return the actual
document height.

--
Brandon Aaron

On 8/14/07, Neil [EMAIL PROTECTED] wrote:


 Hi there.

 I posted a bug concerning modals not masking the whole page with
 jQuery on the Ext forum.

 Jack Slocum has responded saying The problem was reported a while
 back to jQuery. It has to do with viewport/document size not returning
 the largest value. If the document height is smaller than the window
 height, then the document height should be the window height. In
 jQuery that is not the case. You may want to log a bug there.

 The full write up on producing the bug is at
 http://extjs.com/forum/showthread.php?t=11086.

 Any advice on an interim workaround until the core is fixed would be
 really appreciated.

 Regards,
 Neil.




[jQuery] Re: input type=button / : which event is that?

2007-08-15 Thread Mike Alsup

is there a rolled-into-
 one event name for when a button is clicked or selected with the keys?

click is that event.


[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread Brandon Aaron
Thanks for sharing this. Use the minified version instead of the packed
version for even better file size savings. :)

--
Brandon Aaron

On 8/15/07, Stephan Beal [EMAIL PROTECTED] wrote:


 Hi, all!

 i'm working on re-designing the web site for my mother's company,
 which was horribly neglected/abused by the previous webmaster, and i
 came across an interesting problem...

 A part of the refactoring is to use jQuery for parts of the site.
 However, since all of the pages use the same site layout template
 (which includes the headers/script tags) yet most of the site won't
 actually use the JS features, i wanted to make the jQ download as tiny
 as possible.

 Unfortunately, i don't have admin rights on my server so i cannot
 activate mod_gzip/mod_deflate to gzip the stuff on the fly. But here's
 an easy workaround...

 Create a PHP file called jquery.php:

 ?php
   ob_start( 'ob_gzhandler' );
   echo join('',file('jquery-1.1.3.1.pack.js'));
   ob_end_flush();
 ?

 Now, in the main site layout template i have:

 script type='text/javascript' src='/include/js/jquery.php'/script

 Firebug confirms that the jQ transfer is then 12k, which is tolerable
 for my purposes.

 It would be only a tiny amount of extra work to integrate the PHP port
 of Dean Edwards' packer, such that the packing is done each time
 jquery.php is called, but that seems like overkill to me.

 This approach could just as easily be used to combine all required JS
 scripts on the fly (just be sure to insert a ';' after each one to
 accommodate scripts which don't have them), then gzip them, to help
 reduce the overall download overhead.




[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread Stephan Beal

On Aug 15, 2:33 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
 Thanks for sharing this. Use the minified version instead of the packed
 version for even better file size savings. :)

i experimented on that. i expected the new YUI minifier to give better
compression (as it does on all of my plugins), but it only compresses
jQ to 30k. i got the best jQ compression using a PHP port of the
Edwards Packer:

http://wanderinghorse.net/computing/javascript/#packers

In any case, the different pack/min techniques will give different
results on different inputs. On very small JS files MIN is normally
better because of the PACK overhead (just under 200 bytes, i think).
On large files, PACK tends to beat out MIN, but this isn't always so.
YUI minifier is damned good, at least on my code, but it seems to not
be the best packer for jQ. Anyway... the point is simply to experiment
and find the best one for your purposes. A couple K either way
probably isn't going to kill anyone.



[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread Brandon Aaron
Yeah, the packer does a good job initially but doesn't do a good job of
getting gzipped. At least with my testing, I'm able to get a better file
size by using the min version + gzip. jQuery is only around 11k doing it
that way.

--
Brandon Aaron

On 8/15/07, Stephan Beal [EMAIL PROTECTED] wrote:


 On Aug 15, 2:33 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
  Thanks for sharing this. Use the minified version instead of the packed
  version for even better file size savings. :)

 i experimented on that. i expected the new YUI minifier to give better
 compression (as it does on all of my plugins), but it only compresses
 jQ to 30k. i got the best jQ compression using a PHP port of the
 Edwards Packer:

 http://wanderinghorse.net/computing/javascript/#packers

 In any case, the different pack/min techniques will give different
 results on different inputs. On very small JS files MIN is normally
 better because of the PACK overhead (just under 200 bytes, i think).
 On large files, PACK tends to beat out MIN, but this isn't always so.
 YUI minifier is damned good, at least on my code, but it seems to not
 be the best packer for jQ. Anyway... the point is simply to experiment
 and find the best one for your purposes. A couple K either way
 probably isn't going to kill anyone.




[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread Joel Birch
On 8/15/07, Brandon Aaron [EMAIL PROTECTED] wrote:

 Yeah, the packer does a good job initially but doesn't do a good job of
 getting gzipped. At least with my testing, I'm able to get a better file
 size by using the min version + gzip. jQuery is only around 11k doing it
 that way.

 --
 Brandon Aaron


I've noticed this too. I'm sticking with jsMin and gzip, myself.

Joel Birch


[jQuery] Re: Do my emails make it to the list?

2007-08-15 Thread Andy Matthews

This one did. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of barophobia
Sent: Wednesday, August 15, 2007 12:36 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Do my emails make it to the list?


I can see my emails in the Gmail interface but it doesn't seem that they're
actually making it to everyone else.

Please respond (off list).



Thanks,
Chris.




[jQuery] Re: Draggables help

2007-08-15 Thread Gordon

After scratching my head over this for a while I thought maybe I would
have more luck with plan B.  I could give each handle its own div
inside the slider div and allow each slider to slide only inside that
region.  by adjusting the width of the container divs I could get
notched sliders that don't overlap each other quite easily.

The only thing is I've hit an enormous snag.  Each of the domain divs
stack up on top of each other inside the slider div, and as soon as
you slide the handle in the div that's behind the other div you can no
longer drag it because the front div is in the way.

Here is the revised code:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleUntitled Document/title
/head
script type=text/javascript src=/js/jquery/jquery.js/script
script type=text/javascript src=/js/jquery/interface/
interface.js/script
style type=text/css
/* Sliders */
.slider {
width: 171px;
height: 58px;
position: relative;
margin: 2px;
padding: 0px;
overflow: hidden;
background: url(configurator%209/ui/configurator/range_chart.gif) no-
repeat top;
}
.slider .domain {
position: absolute;
top: 0;
width: 152px;
height: 100%;
opacity: 0.3;
}
.slider .domain.left {
background: yellow;
left: 0px;
}
.slider .domain.right {
background: blue;
right: 0px;
}
.slideHandle {
width: 19px;
height: 58px;
position: absolute;
font-size: 0;
line-height: 0;
overflow: hidden;
border: none;
top: 0px;
}
.leftHandle {
background: url(configurator%209/ui/configurator/
range_handle_left.gif) no-repeat bottom;
}
.rightHandle {
left: 133px;
background: url(configurator%209/ui/configurator/
range_handle_right.gif) no-repeat bottom;
}

/style
script type=text/javascript

$(document).ready (function ()
{
$('#left, #right').Draggable ({
containment : 'parent',
grid: 17
});
//test  = new RangeSlider ('#slider1', '#left', '#right', 0, 0, 0, 0);
});

/script
body
/body
div class=slider id=slider1
  div class=domain left
div class=slideHandle leftHandle id=leftnbsp;/div
  /div
  div class=domain right
div class=slideHandle rightHandle id=rightnbsp;/div
  /div
/div
/html

Is it possible to get a click through the front layer to the handle
behind?

On Aug 15, 12:41 pm, Gordon [EMAIL PROTECTED] wrote:
 As I just can't track down a javascript slider that can cope with two
 handles satisfactorially, I am trying to implement my own using just
 the Draggable functionality of the interface library.

 I need to make a slider for selecting a minimum and maximum limits of
 a range of values that:

 * cope with 2 handles in the slider
 * can snap the handles to notches while dragging, the size of which
 doesn't change based on the position of either of the sliders
 * will not allow the handles to either pass each other or overlap

 So far this is as far as I have got:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/
 TR/xhtml11/DTD/xhtml11.dtd
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html; charset=utf-8 /
 titleUntitled Document/title
 /head
 script type=text/javascript src=/js/jquery/jquery.js/script
 script type=text/javascript src=/js/jquery/interface/
 interface.js/script
 style type=text/css
 /* Sliders */
 .slider {
 width: 171px;
 height: 58px;
 position: relative;
 margin: 2px;
 padding: 0px;
 overflow: hidden;
 background: url(configurator%209/ui/configurator/range_chart.gif) no-
 repeat top;}

 .slideDomain {
 position: absolute;
 height: 100%;}

 .leftDomain {
 left: 0px;}

 .rightDomain {
 right: 0px;}

 .slideHandle {
 width: 19px;
 height: 58px;
 position: absolute;
 font-size: 0;
 line-height: 0;
 overflow: hidden;
 border: none;
 top: 0px;}

 .leftHandle {
 background: url(configurator%209/ui/configurator/
 range_handle_left.gif) no-repeat bottom;}

 .rightHandle {
 left: 152px;
 background: url(configurator%209/ui/configurator/
 range_handle_right.gif) no-repeat bottom;

 }

 /style
 script type=text/javascript

 function RangeSlider (slideContainer, slideMin, slideMax, fieldMin,
 fieldMax, rangeMin, rangeMax)
 {
 var self= this;
 self.container  = $(slideContainer);
 self.handleMin  = $(slideMin);
 self.handleMax  = $(slideMax);

 self.notches= 10;
 self.spacing= Math.round (self.container.width () / self.notches);

 console.log (self.minLeft   = parseInt (self.handleMin.css 
 

[jQuery] Question about dynamic form input

2007-08-15 Thread Ruben S.

Hi, i have a classical input, for example :

input type=text name=something id=something /

I would like to show in a DIV the word ( letter by letter ) wroted in
that input but in REAL TIME.

For example if i write the word Internet, when i write the first
letter I, simultaneously that letter appears in the div too, the
same thing with the other letters.

How can i do that ??
Thanx in advance!!



[jQuery] Re: Do my emails make it to the list?

2007-08-15 Thread Ty

No clue what's up with the G-Groups sometimes...
I used to able to put in my profile name tzmedia and find all of my
posts.
It's almost impossible for me to find any of my posts since sometime
in July, unless I can remember other keywords in the post.
If you click reply to author, I think those get emailed directly to
the author and not the group, or posted in the thread.
Other than that they should be showing up.
A real hosted forum would get my vote for the thing to do.
I'm not suggesting I spring for the hosting on it though that's for
sure.
I've made some stray posts to Nabble, and other old group areas, maybe
you've been doing that.
You almost forget you're in an old area (Area 51 maybe?!¡)
Those threads and group are still active even though they are not the
most currently official group which would be here on Google.

On Aug 15, 1:35 am, barophobia [EMAIL PROTECTED] wrote:
 I can see my emails in the Gmail interface but it doesn't seem that
 they're actually making it to everyone else.

 Please respond (off list).

 Thanks,
 Chris.



[jQuery] Re: Question about dynamic form input

2007-08-15 Thread Karl Swedberg
I wrote about a way to do this a while back on learningjquery.com.  
Perhaps that will help?


http://www.learningjquery.com/2006/11/really-simple-live-comment-preview


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



On Aug 15, 2007, at 9:34 AM, Ruben S. wrote:



Hi, i have a classical input, for example :

input type=text name=something id=something /

I would like to show in a DIV the word ( letter by letter ) wroted in
that input but in REAL TIME.

For example if i write the word Internet, when i write the first
letter I, simultaneously that letter appears in the div too, the
same thing with the other letters.

How can i do that ??
Thanx in advance!!





[jQuery] Can someone assist me with this code issue?

2007-08-15 Thread deepreel

Folks,

I'm missing something here but can't figure it.

The following is inside a $('#xx').click event handler that inside a
div that is originally hidden until a parent is clicked. The the
revealed #xx button is clicked firing this:

var dnsData=smode=clearnodehn=+hn+oldip=+ip+entry=+entry;
$.ajax({
url:
UpdateEntry,
type: POST,
dataType:
html,
data:
dnsData,
success:
function(msg){

 
alert(DNS Update Succeeded);

},
error:
function(msg){
 
alert(Critical Error in DNS Update. No changes applied.
Please manually check  UDNS for \n+hn+ set to 1.1.1.1);

}
});

The POST itself is working, but each time this event set is fired the
POST itself get's executed only once but either success or error local
function gets executed x times. i.e. first time I fire this event (in
an error condition) error gets called once, but if I click again it
get's fired twice, again and three times etc etc.

Or if I click away from the #xx button (which rehides it's parent div)
then reveal it again the same thing happens.

Debugging via Firebug seems to show that

// Handle the global AJAX counter
2058 if ( s.global  ! --jQuery.active )
2059 jQuery.event.trigger( ajaxStop );

jQuery.active is incrementing on each execution of the #xx button,
which then in turn decreases on each call to - for example the error
function - until finally ajaxStop is called.

I've tried setting global: false in the ajax above but to no avail.

also I have a .post in the same page that seems to show the same
behaviour.

I'm have no idea what is causing this, any help would be greatly
appreciated.

Cheers



[jQuery] Re: Selecting the current (this) dt on a collapsible menu

2007-08-15 Thread jorgeBadaBing

Anyone has any thought on what I can do here?



On Aug 14, 4:41 pm, jorgeBadaBing [EMAIL PROTECTED] wrote:
 I adapted John's example of a collapsible menu but have a problem
 selecting the current dt.

 John's example can be found at:http://jquery.com/files/demo/dl-done.html

 I pretty much has this so far:

 pre
 script
 $(document).ready(function(){
 $(div#Kcleftnav dt).addClass(productList);
 $(div#Kcleftnav dd).hide();
 $(div#Kcleftnav dt a).click(function(){
 $(div#Kcleftnav
 dt:first).removeClass(productList).addClass(menuSelected);
 $(div#Kcleftnav dd:visible).slideUp(normal);
 $(this).parent().next().slideDown(normal);
 return false;
 });

 });
 /script
 /pre

 As you can see on the fifth line, I remove the existing class that I
 assigned to the menu and change the class so I can add a different
 icon to the current dt tag. unfortunately I don't know how to say,
 only do it to this dt

 I also ran into the problem if once I think on another title (dt) the
 previous one remains with the unchange icon, which looks like it's
 open but is not.

 Pretty much I only wanted to add a plus and minus to the left of each
 dt on John's example.

 I know I right now say on line 5: div#Kcleftnav dt:first, and is
 not :first that I need but something like :this, I even tried but it
 doesn't work, I also changed the whole div#Kcleftnav dt:first for
 (this) but it didn't work either.

 div#Kcleftnav dt:first seems to be the closes to what I want but
 only work and changes the icon on the first dt of the list, I want it
 to be the one that they click, no just the first one.

 Any help with me appreciated guys,

 thanks!

 J.



[jQuery] Re: Text node selector?

2007-08-15 Thread Thomas Hooper

This bugs me too, I have no way of changing the text part of the
following without effecting the image:
pimg src=example.jpg / Example text/p

After some digging around I found this thread, but also of interest,
this plugin:
http://dev.jquery.com/log/trunk/plugins/textNodes/jquery.textNodes.js?rev=2052



[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread Stephan Beal

On Aug 15, 3:33 pm, xavier [EMAIL PROTECTED] wrote:
 This means that :
 1) you assume all clients are able to deal with compressed pages

No - PHP does that negotiation automatically (supposedly) and ignores
the gzip if it thinks the client can't handle it.

 2) your server is going to compress it for each visitor.

Why wouldn't they?

 3) the headers might or might not be properly dealing with its type.

i don't understand what you mean by this. The HTTP response header
from the PHP script?

 With mod_rewrite, they are nice tricks to have a compressed file and
 serve it instead of the normal file if needed.

 Have you tried compressing the js file and send it instead of the file
 without using mod_compress/mod_rewrite ?

i haven't tried that because i wouldn't expect sub-optimal browsers to
be able to grok it (by that i mean MSIE/Safari/Opera). Since i don't
have those browsers to test, i don't want to try anything too tricky
which might break those browsers.


@Joel/Brandon:

after more experimentation, i am getting better compression if i use
the YUImin and ob_gzhandler. The difference is minimal compared to
jsmin, but there is a difference. e.g.

jquery 1.1.3.1:
YUImin + gzip: 10896 bytes
jsmin + gzip: 11505
packer + gzip: 11486




[jQuery] Re: Checking for popup blocker when using click()

2007-08-15 Thread SeViR


The proper event for form submittion is:

HTML:
form id=myForm action= method=post
input type=submit value=send
/form

JS:
$(#myForm).submit(function(){

   return false;  //- if return false cancel submittion. By example 
for AJAX submittion.

});

When you click in submit button, submit event is triggered. You can not
need catch the click event in input button :). This is no-intrusive 
JavaScript

(works with JS disabled).

Geoff escribió:

I'm very interested in your second example with the $
(a.external).click... how would you do a similar thing when
submitting a form? I'm actually calling click() on a input
type=submit/

Thanks :)

Geoff

On Aug 14, 7:09 am, SeViR [EMAIL PROTECTED] wrote:
  



  



--
Best Regards,
José Francisco Rives Lirola sevir1ATgmail.com

SeViR CW · Computer Design
http://www.sevir.org
 
Murcia - Spain




[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread James Dempster

Before ob_gzhandler() actually sends compressed data, it determines
what type of content encoding the browser will accept (gzip,
deflate or none at all) and will return its output accordingly.

From http://uk.php.net/ob_gzhandler

On Aug 15, 2:33 pm, xavier [EMAIL PROTECTED] wrote:
 This means that :
 1) you assume all clients are able to deal with compressed pages
 2) your server is going to compress it for each visitor.
 3) the headers might or might not be properly dealing with its type.

 With mod_rewrite, they are nice tricks to have a compressed file and
 serve it instead of the normal file if needed.

 Have you tried compressing the js file and send it instead of the file
 without using mod_compress/mod_rewrite ?

 X+

 On Aug 15, 11:08 am, Stephan Beal [EMAIL PROTECTED] wrote:

  Hi, all!

  i'm working on re-designing the web site for my mother's company,
  which was horribly neglected/abused by the previous webmaster, and i
  came across an interesting problem...

  A part of the refactoring is to use jQuery for parts of the site.
  However, since all of the pages use the same site layout template
  (which includes the headers/script tags) yet most of the site won't
  actually use the JS features, i wanted to make the jQ download as tiny
  as possible.

  Unfortunately, i don't have admin rights on my server so i cannot
  activate mod_gzip/mod_deflate to gzip the stuff on the fly. But here's
  an easy workaround...

  Create a PHP file called jquery.php:

  ?php
ob_start( 'ob_gzhandler' );
echo join('',file('jquery-1.1.3.1.pack.js'));
ob_end_flush();
  ?

  Now, in the main site layout template i have:

  script type='text/javascript' src='/include/js/jquery.php'/script

  Firebug confirms that the jQ transfer is then 12k, which is tolerable
  for my purposes.

  It would be only a tiny amount of extra work to integrate the PHP port
  of Dean Edwards' packer, such that the packing is done each time
  jquery.php is called, but that seems like overkill to me.

  This approach could just as easily be used to combine all required JS
  scripts on the fly (just be sure to insert a ';' after each one to
  accommodate scripts which don't have them), then gzip them, to help
  reduce the overall download overhead.



[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread Joel Birch
On 8/15/07, Stephan Beal [EMAIL PROTECTED] wrote:

 @Joel/Brandon:

 after more experimentation, i am getting better compression if i use
 the YUImin and ob_gzhandler. The difference is minimal compared to
 jsmin, but there is a difference. e.g.

 jquery 1.1.3.1:
 YUImin + gzip: 10896 bytes
 jsmin + gzip: 11505
 packer + gzip: 11486


Good to know. Thanks!

Joel Birch.


[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread xavier

This means that :
1) you assume all clients are able to deal with compressed pages
2) your server is going to compress it for each visitor.
3) the headers might or might not be properly dealing with its type.

With mod_rewrite, they are nice tricks to have a compressed file and
serve it instead of the normal file if needed.

Have you tried compressing the js file and send it instead of the file
without using mod_compress/mod_rewrite ?

X+

On Aug 15, 11:08 am, Stephan Beal [EMAIL PROTECTED] wrote:
 Hi, all!

 i'm working on re-designing the web site for my mother's company,
 which was horribly neglected/abused by the previous webmaster, and i
 came across an interesting problem...

 A part of the refactoring is to use jQuery for parts of the site.
 However, since all of the pages use the same site layout template
 (which includes the headers/script tags) yet most of the site won't
 actually use the JS features, i wanted to make the jQ download as tiny
 as possible.

 Unfortunately, i don't have admin rights on my server so i cannot
 activate mod_gzip/mod_deflate to gzip the stuff on the fly. But here's
 an easy workaround...

 Create a PHP file called jquery.php:

 ?php
   ob_start( 'ob_gzhandler' );
   echo join('',file('jquery-1.1.3.1.pack.js'));
   ob_end_flush();
 ?

 Now, in the main site layout template i have:

 script type='text/javascript' src='/include/js/jquery.php'/script

 Firebug confirms that the jQ transfer is then 12k, which is tolerable
 for my purposes.

 It would be only a tiny amount of extra work to integrate the PHP port
 of Dean Edwards' packer, such that the packing is done each time
 jquery.php is called, but that seems like overkill to me.

 This approach could just as easily be used to combine all required JS
 scripts on the fly (just be sure to insert a ';' after each one to
 accommodate scripts which don't have them), then gzip them, to help
 reduce the overall download overhead.



[jQuery] Re: display Please wait while waiting for a database query.

2007-08-15 Thread SeViR


In my pages I have this code. Automatically in AJAX calls, the message
is shown and removed on AJAX call finalizes.

HTML:
div id=waitmessagePlease wait/div

JS:
//Configuration for AJAX calls
$().ajaxSend(function(r,s){
   $(#waitmessage).show();
});

$().ajaxStop(function(r,s){
   $(#waitmessage).hide();
});

$().ajaxError(function(r,s){
   setTimeout($('#waitmessage').hide();,6000);
});


VS escribió:

Hello,

I have a php web application and sometimes the database query will
take a while to process results.  Using JQuery, is it possible to
display a Please wait message and then clear it when the
database query completes ( the code comes out of an foreach
condition ).

Please let me know..

Thank you.
-VS.


  



--
Best Regards,
José Francisco Rives Lirola sevir1ATgmail.com

SeViR CW · Computer Design
http://www.sevir.org
 
Murcia - Spain




[jQuery] Re: Do my emails make it to the list?

2007-08-15 Thread Robert O'Rourke


Ty wrote:

No clue what's up with the G-Groups sometimes...
I used to able to put in my profile name tzmedia and find all of my
posts.
It's almost impossible for me to find any of my posts since sometime
in July, unless I can remember other keywords in the post.
If you click reply to author, I think those get emailed directly to
the author and not the group, or posted in the thread.
Other than that they should be showing up.
A real hosted forum would get my vote for the thing to do.
I'm not suggesting I spring for the hosting on it though that's for
sure.
I've made some stray posts to Nabble, and other old group areas, maybe
you've been doing that.
You almost forget you're in an old area (Area 51 maybe?!¡)
Those threads and group are still active even though they are not the
most currently official group which would be here on Google.

  


I've been having no problems with the mailing list because I use it via 
Thunderbird which has an excellent (and super fast) filtering system for 
your inboxes. Is that a possibility for you or is it a public computer?


Rob


[jQuery] Re: Price levels and price breaks

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

I've done the following code in Coldfusion:

cfset tilePrice = ListGetAt(productPricing.priceLevels,7)
cfloop from=1 to=#ListLen(productPricing.priceBreaks)-1#
index=i
   cfif quantity GTE ListGetAt(productPricing.priceBreaks,i) AND
quantity LT ListGetAt(productPricing.priceBreaks,i+1) 
   cfset tilePrice = ListGetAt(productPricing.priceLevels,i)
   /cfif
/cfloop

Now, I'd like to do the same thing, but in Javascript / Jquery.  Can
someone post code that will do this same sort of query/operation in
Javascript?

I've been working (in my free time) on a Calculation plug-in:
http://www.pengoworks.com/workshop/jquery/calculation.plugin.htm

The interesting thing about the plug-in is that it will parse numeric values
from either form fields or from HTML element.

Take a look at the Qty/Product/Price/Total table. The code that hooks up the
Total column is:

// update the total column
$([EMAIL PROTECTED]).calc(
// the equation to calculate
qty * price,

// define the variables
{
qty: $([EMAIL PROTECTED]),
price: $([EMAIL PROTECTED])
},

// the formatting callback
function (s){
return $ + s;
},

// the finish callback
function ($this){
// sum the total of the $([EMAIL PROTECTED]) selector
var sum = $this.sum();

$(#grandTotal).text(
// round the results to 2 digits
$ + Math.round(sum*100)/100
);
}
);

When you build your equations you define your variables in an object that
with the var names being keys in the object. The keys can be either a valid
jQuery object, array of values, static value or another variable.

If the variables are an array and their array length is the same length as
the main selector in the calc() method--in this case
$([EMAIL PROTECTED])--then it will use the correlating array index values,
otherwise it'll just use the first value in the array.

This is just something I've been playing with. I want to add event handlers
to any of the elements that are input elements so that changes to the
calculations would be reflected in real time.

There's also some aggregation functions (sum  avg) built in to this plug-in
as well.

-Dan



[jQuery] Re: serverCookieJar, thoughts please

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

James,

after Dan G. Switzer, II mentioned here
http://groups.google.com/group/jquery-
en/browse_frm/thread/cf786440e6154366/16e79411ae8b118d#16e79411ae8b118d
regarding cookies being sent with every request and the 4KB limit it
got me thinking, maybe store this on the server and make one request
for it each page load, it might make more sense then sending it
backwards and forwards all the time.

So I tried to make serverCookieJar example here
http://www.jdempster.com/wp-
content/uploads/2007/08/jquery.servercookiejar.example.html
http://www.jdempster.com/wp-
content/uploads/2007/08/jquery.servercookiejar.js

I'm abit unsure about the design regarding line 50  68 where I make a
synchronous ajax request which could tie the browser up until the
request is complete. I think I can safely remove this from the save
function. But for the load function it's important that this data is
brought down before anything else is done.

What are peoples thoughts on this?

I'd be more interested in seeing work done to utilize other local storage
methods.

For example, Flash has a local storage mode:
http://www.macromedia.com/support/documentation/en/flashplayer/help/help02.h
tml

I've seen other people write JS wrappers to the Flash storage mechanism.

There's also projects like Google Gears:
http://code.google.com/apis/gears/

There's a database module, which to quote Google:

The Database module provides browser-local relational data storage to your
JavaScript web application. Google Gears uses the open source SQLite
database system.

-Dan



[jQuery] Re: Do my emails make it to the list?

2007-08-15 Thread Jonathan Sharp
The reason there's a delay is that new members posts are moderated to fight
spam. After x number of valid posts the moderation restriction is removed.
I've removed this restriction for your account.

Cheers,
-js


On 8/15/07, barophobia [EMAIL PROTECTED] wrote:


 I can see my emails in the Gmail interface but it doesn't seem that
 they're actually making it to everyone else.

 Please respond (off list).



 Thanks,
 Chris.



[jQuery] Some snippets for newbies, Part 1 of N

2007-08-15 Thread Stephan Beal

Hi, all!

i'm working on rewriting the web site for my mother's business and i'm
finally getting to integrate some jQuery in a production site.
Unfortunately, i don't have a link to show anything (it's on an
internal test server), but i wanted to share some of the tidbits with
the n00bs in the crowd, to show them just how damned simple it can be
to create impressive (or just convenient) effects with jQuery...


Part 1a, tagging anchors with an image.


My mother's site hosts lots of PDF files (house plans - she owns a
house-building company). Rather than label each of the links with
something like PDF format, it was a tiny, tiny job to add a small
PDF icon next to each and every link in the site:

jQuery(function(){
$('[EMAIL PROTECTED]')
.append(img src='/img/pdf.png' height='16' width='16'
class='no_decoration'/);
});

Where 'no_decoration' is to differentiate these images from the (many)
other images which have a stylized border:

img.no_decoration {
  border: none;
}

When it comes to doing more with less, GNU Make is one of the few
other tools which i consider to be as expressive as jQuery.


Part 1b:


i wanted to tinker with a slide-show like feature. After playing with
the Cycle plugin, i found that it wouldn't do the job for me because
i'm working with images of many different sizes (Cycle appears to only
work well when all images are the same size). So i threw together a
most-minimalistic fadeIn/fadeOut slideshow mini-plugin and thought it
might be informative to the n00bs...

jQuery.fn.imageFader = function( options ) {
options = jQuery.extend({
fadeOutSpeed:750,
fadeInSpeed:500,
delay:4500
},options);
var imgs = jQuery('img',this);
imgs.gt(0).hide();
var pos = 0;
var current = 0;
function cycle() {
function doIn(to) {
imgs.eq(to).fadeIn( options.fadeInSpeed );
}
function doOut(from,to) {
imgs.eq(from).fadeOut( options.fadeOutSpeed, function()
{doIn(to)} );
}
pos = (pos = (imgs.length-1)) ? 0 : ++pos;
doOut( current, pos );
current = pos;
};
setInterval( cycle, options.delay );
return this;
};

Just populate a DIV with some images:

div id='MyImages'img .../img .../img ...//div

And:

$('#MyImages').imageFader();

Viola!

Again, few tools let you accomplish so much with so little code. Plus
this plugin degrades reasonably well in the absence of javascript -
instead of a slideshow you get all of your images plopped down side-by-
side.

(Reminder: don't use that plugin for real-life sites - use one of the
several excellent plugins already available for the job. This is for
demonstration purposes only.)



The end


i've only been using jQuery about 5 weeks now, and already it's at the
top of my all-time list of favourite tools, right alongside emacs,
firefox, GNU Make and sqlite.

Happy hacking!



[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread Klaus Hartl


gradez28 wrote:

Just curious, how exactly do you expect to be able to access a 0
object?
Are you thinking you can go: object.0.function()?
If so, regardless of how cool jQuery is, when an array's key uses
numerics, you simpy cannot access it as an object because objects must
start with an alpha character. I dont think there are any languages
that allow you do create/access an object that starts with a number.


That works pretty fine:

var o = {};
o['0property'] = 'bar';
o['1'] = 'one';


--Klaus



[jQuery] [ANNOUNCE] New jQuery Plugins Found

2007-08-15 Thread Rey Bango


AjaxRain has really been digging up some great plugins which I never see 
announced. Check these out:


jQuery Image Strip
http://blog.joshuaeichorn.com/archives/2007/01/11/jquery-image-strip/

jQuery Share It!
http://www.joanpiedra.com/jquery/shareit/

jQuery Thumbs
http://joanpiedra.com/jquery/thumbs/

jQuery flickrGallery
http://ptflickrgallery.sourceforge.net/web/index.html


[jQuery] Charting with jQuery?

2007-08-15 Thread Andy Matthews
I found a demo plugin here:
http://www.reach1to1.com/sandbox/jquery/jqchart/
 
Looks like the last update was back in March. Does anyone know if this
author has released anything newer than this. Alternately, are there any
other charting plugins available that I might not know about?
 

 
Andy Matthews
Senior ColdFusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249
[EMAIL PROTECTED]
www.dealerskins.com http://www.dealerskins.com/ 
 
dealerskinslogo.bmp

[jQuery] Re: Tabs not working

2007-08-15 Thread Eridius


ok but now have another problem.  when i set remote to true, the page keeps
outputting itself over and over and over this crash.  anyone else having
issue with remote?


Klaus Hartl wrote:
 
 
 Eridius wrote:
 
 I am trying to use the Tabs plugin but it is not really working.  her eis
 my
 demo:
 
 http://www.apex-wowguild.com/dev
 
 It work when you first click on the click but when you go back to a link,
 it
 just does not shouw anything.  I am just using .tabs() and the html looks
 good to me.
 
 The html may look good to you, but it isn't. It's invalid, you're using 
 the id one twice in your document (once for the tabs) and that is why 
 the tabs do not work as expected.
 
 Please make sure to validate your HTML! That is once again an example 
 why standards are important and how invalid HTML has effect on scripting 
 as well.
 
 Here's a link to the W3C HTML validator:
 http://validator.w3.org/
 
 If you've installed the Web Developer Toolbar validating is as easy as 
 hitting a key stroke.
 
 
 --Klaus
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tabs-not-working-tf4270943s15494.html#a12164434
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Draggables help

2007-08-15 Thread Gordon

I realised in the end it's not really a problem because dragging the
sliders trigger a resizing of the divs used to define the domain so
the handles still remain grabbable when that part of the object is
implemented.

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleUntitled Document/title
/head
script type=text/javascript src=/js/jquery/jquery.js/script
script type=text/javascript src=/js/jquery/interface/
interface.js/script
style type=text/css
/* Sliders */
.slider {
width: 171px;
height: 58px;
position: relative;
margin: 2px;
padding: 0px;
overflow: hidden;
background: url(ui/configurator/range_chart.gif) no-repeat top;
}
.slifer .domain {
position: absolute;
height: 100%;
}
.slider .domain {
position: absolute;
top: 0;
width: 152px;
height: 100%;
/*opacity: 0.3;*/
/*filter: alpha (opacity=30);*/
}
.slider .domain.left {
/*background: yellow;*/
left: 0px;
}
.slider .domain.right {
/*background: cyan;*/
right: 0px;
}
.slideHandle {
width: 19px;
height: 58px;
position: absolute;
font-size: 0;
line-height: 0;
overflow: hidden;
border: none;
top: 0px;
}
.leftHandle {
background: url(ui/configurator/range_handle_left.gif) no-repeat
bottom;
}
.rightHandle {
left: 133px;
background: url(ui/configurator/range_handle_right.gif) no-repeat
bottom;
}

/style
script type=text/javascript

function RangeSlider (slideElem, slideMin, slideMax, fieldMin,
fieldMax, rangeMin, rangeMax, step)
{
var self= this;
// DOM elements
self.container  = $(slideElem);
self.domainLeft = $('.left', self.container);
self.domainRight= $('.right', self.container);
self.handleMin  = $(slideMin);
self.handleMax  = $(slideMax);

// Widths
self.sliderWidth= self.container.width ();
self.handleWidth= self.handleMin.width ();
self.dmnLeftWidth   = self.domainLeft.width ();
self.dmnRightWidth  = self.domainRight.width ();

self.dmnLeftSize= function ()
// resize left domain
{
// Calculate left domain width
var newWidth= self.sliderWidth
- self.dmnRightWidth
+ parseInt (self.handleMax.css 
('left'));
// Resize the left hand domain
self.domainLeft.width (self.dmnLeftWidth= newWidth);
};
self.dmnRightSize   = function ()
// Resize right domain
{
// Calsulate right domain width and handle offset
var newWidth= self.sliderWidth
- self.handleWidth
- parseInt (self.handleMin.css 
('left'), 10);
var widthChange = self.dmnRightWidth - newWidth;
// Resize the right hand domain
self.domainRight.width (self.dmnRightWidth  = newWidth);
// Reposition the right drag handle to maintain its relative
position
self.handleMax.css ('left', parseInt (self.handleMax.css 
('left'),
10) - widthChange);
};
self.initHandle = function (handle)
// Initialize a handle
{
handle.Draggable (
{
containment : 'parent',
grid: step,
onChange: function ()
{
switch (this.id)
{
case self.handleMin [0].id  :
self.dmnRightSize ();
break;
case self.handleMax [0].id  :
self.dmnLeftSize ();
break;
}
}
});
};

self.initHandle (self.handleMin);
self.initHandle (self.handleMax);
}

var test;

$(document).ready (function ()
{
test1   = new RangeSlider ('#slider1', '#left1', '#right1', 0, 0, 0, 0,
0);
test2   = new RangeSlider ('#slider2', '#left2', '#right2', 0, 0, 0, 0,
17);
test3   = new RangeSlider ('#slider3', '#left3', '#right3', 0, 0, 0, 0,
0);
test4   = new RangeSlider ('#slider4', '#left4', '#right4', 0, 0, 0, 0,
17);

[jQuery] Nice jQuery writeup

2007-08-15 Thread Priest, James (NIH/NIEHS) [C]

I didn't write this but saw it on Reddit while browsing at lunch:

http://simonwillison.net/2007/Aug/15/jquery/


Jim


[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread Michael Geary

 From: pd
 
 I've been hacking with jQuery on and off lately and I've now 
 hit the annoying problem of not being able to access simple 
 DOM 0 properties unless, apparently, using either of the 
 following syntaxes:
 
 $('#foo')[0]
 
 $('#foo').get(0)

pd, just to help clarify... The $() function returns an array of DOM
elements. You access elements of an array, of course, by using [n].

I don't know if I would call this an annoying problem, it's just the way
it is.

Imagine this code:

   var myArray = [
  document.getElementById('foo'),
  document.getElementById('goo')
   ];

Now you have an array of two elements, [0] and [1], and each element is a
reference to a DOM element.

If you want the first element of the array, you would use:

   myArray[0]

And you could access DOM properties with:

   alert( myArray[0].id );  // alerts 'foo'

Or you could do:

   var firstElement = myArray[0];
   alert( firstElement.id );  // alerts 'foo'

What you couldn't do:

  alert( myArray.id );  // alerts undefined

After all, myArray is not a DOM element, it's an *array* of DOM elements.

A jQuery object returned by $() is no different. Whenever you see $(), think
array of DOM elements.

(Well, it is slightly different - it is not an actual JavaScript Array
object, but it does have .length and [n] properties so it works like an
array for these purposes.)

-Mike



[jQuery] Re: question about selectors

2007-08-15 Thread Glen Lipka
Ooops; sorry, i forgot one part.
$(table).filter(table:lt(2)).find(tr
td:first-child).css(border,3px solid red);

Thanks John, first-child worked perfect.

Glen


On 8/15/07, Glen Lipka [EMAIL PROTECTED] wrote:

 Whipped up a demo
 http://www.commadot.com/jquery/selectors/tableCount.htm

   $(table).filter(table:lt(2)).find(td:first).css(border,3px
 solid red);

 Glen

 On 8/15/07, Guapo [EMAIL PROTECTED] wrote:
 
 
 
 
  there are three 3*3 tables. how to select the first cell in every row
  in the first two talbe?
  i tried $(table:lt(2) tr td:first), but failed? who can explain it?
  great thanks.
  ==
  table
  tr
  td/td
  td/td
  td/td
  /tr
  tr
  td/td
  td/td
  td/td
  /tr
  tr
  td/td
  td/td
  td/td
  /tr
  /table
 
  table
  tr
  td/td
  td/td
  td/td
  /tr
  tr
  td/td
  td/td
  td/td
  /tr
  tr
  td/td
  td/td
  td/td
  /tr
  /table
 
  table
  tr
  td/td
  td/td
  td/td
  /tr
  tr
  td/td
  td/td
  td/td
  /tr
  tr
  td/td
  td/td
  td/td
  /tr
  /table
 
 



[jQuery] Help with show/hide script

2007-08-15 Thread Priest, James (NIH/NIEHS) [C]

I'm skipping around the jQuery book (finally!) and working on converting
an existing PDF manual into an HTML doc - I created the following script
to show/hide a table of contents - and widen the page content using a
toggle:

script
 $(document).ready(function() {
 $('#mybutton').toggle( function() {
$('#toc').slideDown(slow);
$(#manual).removeClass(bodywide).addClass(bodytoc);
$('#mybutton').empty().prepend(Hide TOC);
 }, function() {
$('#toc').hide();
$(#manual).removeClass(bodytoc).addClass(bodywide);
$('#mybutton').empty().prepend(Show TOC);
 });
$('#mybutton').trigger(click);
$('.thickbox').after('p class=imgtext(click image to
enlarge)/p');
   });
/script


It works - but if I rapidly click on the 'Show/Hide TOC' element -
sometimes the TOC will still be visible...

Looking in the book I see a similar example with the headline rotator.
They set a variable and then check that when the function executes (on
hover) to see if it's already been thrown.  But I'm stuck in
implementing something like that with the toggle...

Any ideas or suggestions?

Thanks!!
Jim


[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread Michael Geary

  From: Erik Beeson
  The [n] syntax is just a shortcut for 
  .get(n):http://docs.jquery.com/Core#get.28_num_.29

 From: Gordon
 
 I would imagine that the [] syntax would be a bit faster than the
 get() syntax, on the grounds that the former is simply 
 addressing an array, whereas the latter is calling a function 
 and getting the returned result.  I'll have to try 
 benchmarking them in a loop when I've got some free time.

[] is definitely faster, as well as being more concise and straightforward.
No need to benchmark unless you want to know just how much faster. There's
really never any reason to use .get(n) instead of [n].

Here's the code for .get():

   get: function( num ) {
  return num == undefined ?
 // Return a 'clean' array
 jQuery.makeArray( this ) :
 // Return just the object
 this[num];
   },

-Mike



[jQuery] Re: question about selectors

2007-08-15 Thread John Resig

Try using :first-child instead of :first as :first will only ever
return one element - whereas :first-child returns the first element in
the 'row'.

--John

On 8/15/07, Guapo [EMAIL PROTECTED] wrote:



 there are three 3*3 tables. how to select the first cell in every row
 in the first two talbe?
 i tried $(table:lt(2) tr td:first), but failed? who can explain it?
 great thanks.
 ==
 table
 tr
 td/td
 td/td
 td/td
 /tr
 tr
 td/td
 td/td
 td/td
 /tr
 tr
 td/td
 td/td
 td/td
 /tr
 /table

 table
 tr
 td/td
 td/td
 td/td
 /tr
 tr
 td/td
 td/td
 td/td
 /tr
 tr
 td/td
 td/td
 td/td
 /tr
 /table

 table
 tr
 td/td
 td/td
 td/td
 /tr
 tr
 td/td
 td/td
 td/td
 /tr
 tr
 td/td
 td/td
 td/td
 /tr
 /table




[jQuery] Re: Updated Plugin: jQuery Timers. jQuery-oriented setTimeout/setInterval

2007-08-15 Thread Rey Bango


Blair,

I have to say this was the best part of your plugin's docs:

This plugin is licenced with the WTFPL. In short, do whatever the f**k 
you want with it.


I laughed my butt off on that one. ;)

Rey

Blair Mitchelmore wrote:

I released this a couple days ago but as was discussed on a previous
thread http://groups.google.com/group/jquery-en/browse_thread/thread/
ea0e4f59bb87cf6e there were some method naming issues and I also
wanted to add a feature that another setInterval wrapper had. Lucky I
did, because I discovered a preexisting bug which had gone unnoticed
and fixed in the new release. The plugin has been renamed along with
the methods it defines. The url for the source file has been changed
as well to mirror the naming changes. I talked up some of the features
of the plugin in the earlier thread and I've now rewritten the demo
page to explain some of that better so hopefully you enjoy.

Demo page: http://jquery.offput.ca/every
Source file: http://jquery.offput.ca/js/jquery.timers.js

-blair




[jQuery] Re: Modals don't mask whole page with Ext and jQuery

2007-08-15 Thread Wizzud


Brandon,
There is actually a slight problem in this particular scenario, because
$(document).height() is returning 0.
Ext's jquery adaptor IS maxing out window and document, but because document
is returning 0, window height is being used as the greater.
The only property I can find (using FireBug) that returns a height value in
this scenario is document.documentElement.scrollHeight.

Using the code given in the EXT forum, I put in some tests...
Ext.onReady(function(){
  var vw = $(window).width()
, vh = $(window).height()
, bw = $(document).width()
, bh = $(document).height()
, d = document.documentElement.scrollHeight
;
  Ext.MessageBox.confirm('Confirm', 'Scroll the page up and down to see
below the mask');
});

Breaking at Ext.MessageBox showed 

vh = 529
bh = 0
d = 1320

Width values seem to be fine.

I've only looked at this (briefly) in Firefox, no other browser.
I don't know if this will help at all.


Brandon Aaron wrote:
 
 I responded to the thread over on the ext forums. Here is what I said:
 
 The jQuery Dimensions plugin simply returns the document height or the
 window height. Returning the Math.max( $(document).height(),
 $(window).height() ); for $(document).height() would not return the actual
 document height.
 
 --
 Brandon Aaron
 
 On 8/14/07, Neil [EMAIL PROTECTED] wrote:


 Hi there.

 I posted a bug concerning modals not masking the whole page with
 jQuery on the Ext forum.

 Jack Slocum has responded saying The problem was reported a while
 back to jQuery. It has to do with viewport/document size not returning
 the largest value. If the document height is smaller than the window
 height, then the document height should be the window height. In
 jQuery that is not the case. You may want to log a bug there.

 The full write up on producing the bug is at
 http://extjs.com/forum/showthread.php?t=11086.

 Any advice on an interim workaround until the core is fixed would be
 really appreciated.

 Regards,
 Neil.


 
 

-- 
View this message in context: 
http://www.nabble.com/Modals-don%27t-mask-whole-page-with-Ext-and-jQuery-tf4272596s15494.html#a12167179
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] About the author of the recent jQuery article - Please Read

2007-08-15 Thread Rey Bango


A couple of people have posted about the recent jQuery writeup by Simon 
Willison:


http://simonwillison.net/2007/Aug/15/jquery/

Just to let everyone know, Simon Willison is a BIG WIG in the JavaScript 
community. He's been a long long time JS coder - blogging and releasing 
stuff back before it was cool - he helped to co-create Django, worked at 
Yahoo, and now does freelance work (doing work for Wordpress, Mozilla, 
and others). As John said, he's got huge cred in the JS community.


As of today his article is the #1 link on del.icio.us:

http://del.icio.us/url/ab0dd7b1d9b07607b6736a909284f043

So if he like jQuery, it really is a GOOD thing.

Rey...



[jQuery] Re: Modals don't mask whole page with Ext and jQuery

2007-08-15 Thread Brandon Aaron
Ahh thanks Wizzud, I'll dig a little deeper. Thanks.

--
Brandon Aaron

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



 Brandon,
 There is actually a slight problem in this particular scenario, because
 $(document).height() is returning 0.
 Ext's jquery adaptor IS maxing out window and document, but because
 document
 is returning 0, window height is being used as the greater.
 The only property I can find (using FireBug) that returns a height value
 in
 this scenario is document.documentElement.scrollHeight.

 Using the code given in the EXT forum, I put in some tests...
 Ext.onReady(function(){
   var vw = $(window).width()
 , vh = $(window).height()
 , bw = $(document).width()
 , bh = $(document).height()
 , d = document.documentElement.scrollHeight
 ;
   Ext.MessageBox.confirm('Confirm', 'Scroll the page up and down to
 see
 below the mask');
 });

 Breaking at Ext.MessageBox showed

 vh = 529
 bh = 0
 d = 1320

 Width values seem to be fine.

 I've only looked at this (briefly) in Firefox, no other browser.
 I don't know if this will help at all.


 Brandon Aaron wrote:
 
  I responded to the thread over on the ext forums. Here is what I said:
 
  The jQuery Dimensions plugin simply returns the document height or the
  window height. Returning the Math.max( $(document).height(),
  $(window).height() ); for $(document).height() would not return the
 actual
  document height.
 
  --
  Brandon Aaron
 
  On 8/14/07, Neil [EMAIL PROTECTED] wrote:
 
 
  Hi there.
 
  I posted a bug concerning modals not masking the whole page with
  jQuery on the Ext forum.
 
  Jack Slocum has responded saying The problem was reported a while
  back to jQuery. It has to do with viewport/document size not returning
  the largest value. If the document height is smaller than the window
  height, then the document height should be the window height. In
  jQuery that is not the case. You may want to log a bug there.
 
  The full write up on producing the bug is at
  http://extjs.com/forum/showthread.php?t=11086.
 
  Any advice on an interim workaround until the core is fixed would be
  really appreciated.
 
  Regards,
  Neil.
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Modals-don%27t-mask-whole-page-with-Ext-and-jQuery-tf4272596s15494.html#a12167179
 Sent from the JQuery mailing list archive at Nabble.com.




[jQuery] Re: Updated Plugin: jQuery Timers. jQuery-oriented setTimeout/setInterval

2007-08-15 Thread Tane Piper

I moved my code over to this licence recently but I'm hosted on google code.

Google take the *very* strong view of licence prolifiration and warned
me that if I didn't change back to one of the 8 licences that they
have listed my project would be thrown off their site.  So just a
warning to anyone who would like to use this licence, google code
won't host you.


On 15/08/07, Rey Bango [EMAIL PROTECTED] wrote:

 Blair,

 I have to say this was the best part of your plugin's docs:

 This plugin is licenced with the WTFPL. In short, do whatever the f**k
 you want with it.

 I laughed my butt off on that one. ;)

 Rey

 Blair Mitchelmore wrote:
  I released this a couple days ago but as was discussed on a previous
  thread http://groups.google.com/group/jquery-en/browse_thread/thread/
  ea0e4f59bb87cf6e there were some method naming issues and I also
  wanted to add a feature that another setInterval wrapper had. Lucky I
  did, because I discovered a preexisting bug which had gone unnoticed
  and fixed in the new release. The plugin has been renamed along with
  the methods it defines. The url for the source file has been changed
  as well to mirror the naming changes. I talked up some of the features
  of the plugin in the earlier thread and I've now rewritten the demo
  page to explain some of that better so hopefully you enjoy.
 
  Demo page: http://jquery.offput.ca/every
  Source file: http://jquery.offput.ca/js/jquery.timers.js
 
  -blair
 
 



-- 
Tane Piper
http://digitalspaghetti.me.uk

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


[jQuery] Re: About the author of the recent jQuery article - Please Read

2007-08-15 Thread Tane Piper

I noticed his site has a LOT of articles going back to 2002 (infact
while looking at the article, I found one about OpenID that really
helped me out).

Fantastic to know we have friends in high places :)


On 15/08/07, Rey Bango [EMAIL PROTECTED] wrote:

 A couple of people have posted about the recent jQuery writeup by Simon
 Willison:

 http://simonwillison.net/2007/Aug/15/jquery/

 Just to let everyone know, Simon Willison is a BIG WIG in the JavaScript
 community. He's been a long long time JS coder - blogging and releasing
 stuff back before it was cool - he helped to co-create Django, worked at
 Yahoo, and now does freelance work (doing work for Wordpress, Mozilla,
 and others). As John said, he's got huge cred in the JS community.

 As of today his article is the #1 link on del.icio.us:

 http://del.icio.us/url/ab0dd7b1d9b07607b6736a909284f043

 So if he like jQuery, it really is a GOOD thing.

 Rey...




-- 
Tane Piper
http://digitalspaghetti.me.uk

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


[jQuery] Re: Updated Plugin: jQuery Timers. jQuery-oriented setTimeout/setInterval

2007-08-15 Thread Sean Catchpole
Looks great Blair, excellent plugin. Thanks

~Sean


[jQuery] Re: How to test if plugin X is loaded ?

2007-08-15 Thread Erik Beeson
Because I think it would be much cleaner to just load the plugins that you
want in the first place...

--Erik


On 8/15/07, xavier [EMAIL PROTECTED] wrote:


 Thanks, didn't search the doc at the right place (was looking into
 core, that's under ajax).

 Why would you question if I really want to do that ? What would be the
 reason/risk of doing it ?

 X+

 On Aug 15, 1:09 am, Erik Beeson [EMAIL PROTECTED] wrote:
  I question whether or not you really want to be doing that... But here's
  both questions in one go:
 
  if(!$.isFunction($.fn['pluginName'])) {
$.getScript('/path/to/plugin', function() {
  alert('Plugin ready');
});} else {
 
alert('Plugin ready');
 
  }
 
  That assumes the plugin is on the same domain as the current page. If
 not,
  getScript won't work, so you'd have to do something like:
 
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '/path/to/plugin';
$('head')[0].appendChild(script);
 
  But then you don't get the nice callback stuff to ensure that it's
 loaded.
 
  --Erik
 
  On 8/14/07, Benjamin Sterling [EMAIL PROTECTED] wrote:
 
 
 
   Xavier,
   For question #1:  if(typeof $.fn.tableSorter == 'function')
 
   question #2: yes, you just need to know the path to the file and do a
   document.write('script...
 
   On 8/14/07, xavier [EMAIL PROTECTED] wrote:
 
Hello,
 
I'd like to be able to test if a specific plug in is loaded before
calling some of its properties (to avoid throwing an error).
 
Second question, is it possible to load it if missing ?
 
Use case:
 
I have a bit of template that have a sortable table of users, and
another one that list groups. They both have a sortable table, and
might be included into the same page or used separately.
 
I'd rather not load on all the pages the sortable table plugin, so I
have to be able to detect on each of these template if the plugin is
already loaded or if I have to load it (or not call the
 .tableSorter()
method).
 
Any suggestion ?
 
Thanks in advance,
 
X+
 
   --
   Benjamin Sterling
  http://www.KenzoMedia.com
  http://www.KenzoHosting.com




[jQuery] jQuery Form Plugin Repository: Compressed versions?

2007-08-15 Thread Pogo

Anyone know where to get the compressed version of this plugin:

http://www.malsup.com/jquery/form/

???



[jQuery] Re: display Please wait while waiting for a database query.

2007-08-15 Thread seedy


there is a great plugin that will do this for you called blockUI
http://www.malsup.com/jquery/block/


VS YR wrote:
 
 
 Hello,
 
 I have a php web application and sometimes the database query will
 take a while to process results.  Using JQuery, is it possible to
 display a Please wait message and then clear it when the
 database query completes ( the code comes out of an foreach
 condition ).
 
 Please let me know..
 
 Thank you.
 -VS.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Re%3A-display-%22Please-wait%22-while-waiting-for-a-database-query.-tf4272597s15494.html#a12165622
Sent from the JQuery mailing list archive at Nabble.com.



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

2007-08-15 Thread [EMAIL PROTECTED]

Hi,

Thank you for your reply -- this solution presents itself exactly what
I was looking for.

Can't wait to use the jquery plug-in version -- do you have any idea
when you might have that available?

Matthew

On Aug 14, 2:48 am, Kelvin Luck [EMAIL PROTECTED] wrote:
 Hi,

 You can do this if you are using my jScrollPane and it's scrollTo method:

 http://kelvinluck.com/assets/jquery/jScrollPane/scrollTo.html

 I'm just about to make an improvement which will allow you to pass in a
 jQuery selector for the object you want to scroll to as well as a pixel
 position - keep an eye on the following ticket to know when it's been added:

 http://jquery.com/plugins/node/348

 Hope that helps,

 Kelvin :)

 [EMAIL PROTECTED] wrote:
  Hi,

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

  Is there a way to scroll a div area (which has an overflow:auto) to an
  anchor point within the div without scrolling the page (i.e., the page
  should remain stationary)?  In other words, is there a way to use
  jquery to animate the div when an anchor tag is clicked?

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

  Any ideas?

  Thanks in advance,
  Matthew



[jQuery] n00b question on $().clone

2007-08-15 Thread jenlindner

hi, how does one check for the presence of a clone? i need to drag
copies of items from one list to another, then make the second list
sortable. so, i've been using the revert:true inside the draggable and
on drop creating a clone of each item - but, i want to prevent cloning
the same item twice. i want to check to see if an item's clone exists
before creating one, and only do so if it doesn't. i've been trying
this kind of thing:

if ( $j('#sort_list').find($j(drag).clone()) ){
$j(drag).clone().appendTo(this);
}

but it does not return false. i also tried working with .index == -1,
but never got that either. do my items need to have unique ids in
order for this to work?

thanks,
jen



[jQuery] ORing selectors

2007-08-15 Thread rickdog

What is the cleanest way for ORing select results, e.g. returning all
DIVs with id=X or class=Y?



[jQuery] Do my emails make it to the list?

2007-08-15 Thread Göran Törnquist
Is that the reason why I haven't had any 
responses to my post (and repost) about problems 
with 3D Carousel?

/Göran

The reason there's a delay is that new members 
posts are moderated to fight spam. After x 
number of valid posts the moderation 
restriction is removed. I've removed this 
restriction for your account.

Cheers,
-js


On 8/15/07, barophobia 
mailto:[EMAIL PROTECTED][EMAIL PROTECTED] 
wrote:


I can see my emails in the Gmail interface but it doesn't seem that
they're actually making it to everyone else.

Please respond (off list).



Thanks,
Chris.



--
This message has been scanned for viruses and
dangerous content by http://www.mailscanner.info/MailScanner, and is
believed to be clean.


--
-
Göran Törnquist
Stockby Hantverksby 4
181 75 Lidingö

0733-86 04 70
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



[jQuery] Re: Interface Drag/Drop Animation

2007-08-15 Thread Erik Beeson
This just came up a week ago, too. Here's the previous thread that offers a
few solutions:

http://groups.google.com/group/jquery-en/browse_thread/thread/44bb914d6c8718d2

--Erik


On 8/15/07, Collin Allen [EMAIL PROTECTED] wrote:


 Quick question about the Interface Drag+Drop methods:  When I use
 {revert:true,fx:300} to make the draggable fly back to the starting
 point, is there a way to cancel that animation of the draggable is
 successfully placed on a droppable?  By default it accepts and still
 runs the revert animation, but I want the draggable to stick to
 the droppable and only revert if the user drops outside of a droppable
 area.  Is this possible?

 Thanks!




[jQuery] Re: Do my emails make it to the list?

2007-08-15 Thread Jonathan Sharp
No, probably not. Your messages are posted, just not immediately. We're
pretty good at moderating posts quickly. Sometimes googlegroups seems a
little lagged.

Cheers,
-js


On 8/15/07, Göran Törnquist [EMAIL PROTECTED] wrote:

  Is that the reason why I haven't had any responses to my post (and
 repost) about problems with 3D Carousel?


 /Göran



 The reason there's a delay is that new members posts are moderated to
 fight spam. After x number of valid posts the moderation restriction is
 removed. I've removed this restriction for your account.



 Cheers,

 -js



 On 8/15/07,* barophobia* [EMAIL PROTECTED] wrote:


 I can see my emails in the Gmail interface but it doesn't seem that
 they're actually making it to everyone else.

 Please respond (off list).



 Thanks,
 Chris.



 --
 This message has been scanned for viruses and
 dangerous content by *MailScanner* http://www.mailscanner.info/, and is
 believed to be clean.






 --

 -
 Göran Törnquist
 Stockby Hantverksby 4
 181 75 Lidingö

 0733-86 04 70

 --
 This message has been scanned for viruses and
 dangerous content by *MailScanner* http://www.mailscanner.info/, and is
 believed to be clean.


[jQuery] Re: jQuery Form Plugin Repository: Compressed versions?

2007-08-15 Thread Josh Nathanson



Anyone know where to get the compressed version of this plugin:

http://www.malsup.com/jquery/form/


I asked that myself recently and got no reply.  I ended up just packing it 
myself.  If you don't have the Dean Edwards packer url, here it is:


http://dean.edwards.name/packer/

-- Josh 



[jQuery] Re: jQuery Form Plugin Repository: Compressed versions?

2007-08-15 Thread Rey Bango


If its not available, all you need to do is run it through Dean Edward's 
Packer http://dean.edwards.name/packer/


Rey...

Pogo wrote:

Anyone know where to get the compressed version of this plugin:

http://www.malsup.com/jquery/form/

???




[jQuery] Re: Selector question should be easy

2007-08-15 Thread Klaus Hartl


Mike Alsup wrote:

You need to add the '#' for id selection.

$(div :not('#myID'));

Mike


Mike, I'm not so sure about the white space before the colon, 
theoretically div :not(#myId) would select all children of div that do 
not have that particular id?



--Klaus


[jQuery] Re: Updated Plugin: jQuery Timers. jQuery-oriented setTimeout/setInterval

2007-08-15 Thread Bernd Matzner

Hi,

 Google take the *very* strong view of licence prolifiration and warned
 me that if I didn't change back to one of the 8 licences that they
 have listed my project would be thrown off their site.  

Interesting. Doesn't the MIT license, which jQuery itself is licensed
under, provide a max of freedom, except of course for keeping the
license information and a reference to the original author? The latter
seems absolutely appropriate if someone wants to use the author's
work, and the disclaimer would keep any author from legal issues. So,
while the WTFPL is an intruiging approach, wouldn't the MIT license
achieve what you, and Blair have in mind when licensing under WTFPL?

Bernd



[jQuery] Re: Updated Plugin: jQuery Timers. jQuery-oriented setTimeout/setInterval

2007-08-15 Thread Jean

so sad =/
i liked so much that licence lol


On 8/15/07, Tane Piper [EMAIL PROTECTED] wrote:

 I moved my code over to this licence recently but I'm hosted on google code.

 Google take the *very* strong view of licence prolifiration and warned
 me that if I didn't change back to one of the 8 licences that they
 have listed my project would be thrown off their site.  So just a
 warning to anyone who would like to use this licence, google code
 won't host you.


 On 15/08/07, Rey Bango [EMAIL PROTECTED] wrote:
 
  Blair,
 
  I have to say this was the best part of your plugin's docs:
 
  This plugin is licenced with the WTFPL. In short, do whatever the f**k
  you want with it.
 
  I laughed my butt off on that one. ;)
 
  Rey
 
  Blair Mitchelmore wrote:
   I released this a couple days ago but as was discussed on a previous
   thread http://groups.google.com/group/jquery-en/browse_thread/thread/
   ea0e4f59bb87cf6e there were some method naming issues and I also
   wanted to add a feature that another setInterval wrapper had. Lucky I
   did, because I discovered a preexisting bug which had gone unnoticed
   and fixed in the new release. The plugin has been renamed along with
   the methods it defines. The url for the source file has been changed
   as well to mirror the naming changes. I talked up some of the features
   of the plugin in the earlier thread and I've now rewritten the demo
   page to explain some of that better so hopefully you enjoy.
  
   Demo page: http://jquery.offput.ca/every
   Source file: http://jquery.offput.ca/js/jquery.timers.js
  
   -blair
  
  
 


 --
 Tane Piper
 http://digitalspaghetti.me.uk

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



-- 

[]´s Jean
www.suissa.info

   Ethereal Agency
www.etherealagency.com


[jQuery] Re: About the author of the recent jQuery article - Please Read

2007-08-15 Thread Klaus Hartl


Tane Piper wrote:

I noticed his site has a LOT of articles going back to 2002 (infact
while looking at the article, I found one about OpenID that really
helped me out).

Fantastic to know we have friends in high places :)


From what I remember Simon Willison was the first to come up with a 
documentGetElementsBySelector function... he could be seen as jQuery's 
ancestor :-)


On the earlier jQuery page John also mentioned him as inspiration, but I 
can't find it anymore.



--Klaus


[jQuery] Re: ORing selectors

2007-08-15 Thread Erik Beeson
For the record, that's documented here:

http://docs.jquery.com/DOM/Traversing/Selectors#CSS_Selectors

--Erik


On 8/15/07, Erik Beeson [EMAIL PROTECTED] wrote:

 $('#X,.Y')

 --Erik

 On 8/15/07, rickdog [EMAIL PROTECTED] wrote:
 
 
  What is the cleanest way for ORing select results, e.g. returning all
  DIVs with id=X or class=Y?
 
 



[jQuery] Re: n00b question on $().clone

2007-08-15 Thread Erik Beeson
Yes, I suggest you have unique IDs. Maybe something like (untested):

olli id=item1.../lili id=item2.../li/ol

Then on drop do something like:

var newId = 'sort_list_' + drag.id;
if($('#' + newId).length == 0) { // doesn't exist in this list yet
  $(drag).clone().attr('id', newId).appendTo(this);
}

--Erik


On 8/15/07, jenlindner [EMAIL PROTECTED] wrote:


 hi, how does one check for the presence of a clone? i need to drag
 copies of items from one list to another, then make the second list
 sortable. so, i've been using the revert:true inside the draggable and
 on drop creating a clone of each item - but, i want to prevent cloning
 the same item twice. i want to check to see if an item's clone exists
 before creating one, and only do so if it doesn't. i've been trying
 this kind of thing:

 if ( $j('#sort_list').find($j(drag).clone()) ){
 $j(drag).clone().appendTo(this);
 }

 but it does not return false. i also tried working with .index == -1,
 but never got that either. do my items need to have unique ids in
 order for this to work?

 thanks,
 jen




[jQuery] Re: ORing selectors

2007-08-15 Thread Matt Stith
I would do something like

$(#X).add(.Y);

On 8/15/07, rickdog [EMAIL PROTECTED] wrote:


 What is the cleanest way for ORing select results, e.g. returning all
 DIVs with id=X or class=Y?




[jQuery] Re: ORing selectors

2007-08-15 Thread Erik Beeson
$('#X,.Y')

--Erik

On 8/15/07, rickdog [EMAIL PROTECTED] wrote:


 What is the cleanest way for ORing select results, e.g. returning all
 DIVs with id=X or class=Y?




[jQuery] Re: ORing selectors

2007-08-15 Thread Klaus Hartl


Matt Stith wrote:

I would do something like

$(#X).add(.Y);



Just group the selectors:

$('#X, .Y')



--Klaus


[jQuery] Re: Interface slider - get value of multiple handles

2007-08-15 Thread Geoffrey Knutzen

I don't think you can get both values using onSlide(). 
You need to keep track of both values somewhere else and update those values
as you slide. 

It gets tricky when the sliders cross, but you can work through it

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Simpel
Sent: Wednesday, August 15, 2007 1:42 AM
To: jQuery (English)
Cc: [EMAIL PROTECTED]
Subject: [jQuery] Interface slider - get value of multiple handles


Hi there!

so...I've been looking at the interface slider (http://
interface.eyecon.ro/demos/slider.html)

I'd like to use two horizontal sliders but how do I get the current
value for them, the onSlide function only seems to display the value
for the slider that was changed last, I wan't to be able to pull the
values for both handles whilst dragging one of them

/Joel



[jQuery] Re: About the author of the recent jQuery article - Please Read

2007-08-15 Thread Mike Alsup

Indeed.  behavior.js was based on Simon's work and I loved that piece
of code.  It's what I used before jQuery.

Mike

  From what I remember Simon Willison was the first to come up with a
 documentGetElementsBySelector function... he could be seen as jQuery's
 ancestor :-)


[jQuery] Re: Selector question should be easy

2007-08-15 Thread Klaus Hartl


Mitch wrote:

Does anyone have a way to select

all divs except one with a specific ID?

I want something like

$(* :not(myID)).click

or

$(div :not(myID)).click

I have tried :not but have not been able to get it to work on IDs,
seems that it just works on elements.

thanks

Mitch





Try

$(div:not('#myID'))


--Klaus



[jQuery] Re: Selector question should be easy

2007-08-15 Thread Mike Alsup

You need to add the '#' for id selection.

$(div :not('#myID'));

Mike


On 8/15/07, Mitch [EMAIL PROTECTED] wrote:

 Does anyone have a way to select

 all divs except one with a specific ID?

 I want something like

 $(* :not(myID)).click

 or

 $(div :not(myID)).click

 I have tried :not but have not been able to get it to work on IDs,
 seems that it just works on elements.

 thanks

 Mitch




[jQuery] Re: Tweaks to jCarouselLite

2007-08-15 Thread Ganeshji Marwaha
Hi Kelvin,

The link that you have posted for the modified version of jCarouselLite and
for the patch is not reachable. The server is timing out i guess.

I would really like to take a look at the changes and the page in which it
wasn't working. This will help me fix the plugin for everyones benefit.

Thanks,
GTG

On 8/15/07, Kelvin Luck [EMAIL PROTECTED] wrote:


 Hi,

 I've just tried to implement jCarouselLite [1] on a project I'm working
 on. Nice plugin - perfect for my needs of a lightweight carousel for
 this project :)

 But I came across a couple of problems. For some reason, when I set
 circular to false the carousel stopped animating for me. Not sure why as
 it works on the example on the authors site - maybe because my carousel
 had more items in... Or maybe because I have more than one carousel on
 the page...

 I also wanted to update the state of the previous and next buttons when
 the plugin initialised and set them to disabled if necessary. So I made
 a couple of changes to the plugin - you can get the changed file here:

 http://kelvinluck.com/assets/jquery/jCarouselLite/jquery.jcarousellite.js

 And a patch showing the changes here:


 http://kelvinluck.com/assets/jquery/jCarouselLite/jquery.jcarousellite.js.patch

 Hope that's helpful,

 Kelvin :)

 [1] http://www.gmarwaha.com/jquery/jcarousellite/



  1   2   >