[jQuery] Naming plugin files

2006-08-15 Thread Dylan Verheul
I've looked at quite afew plugins lately. Some of them I want to
include in the PHP framework for Waarneming.nl I'm working on. What
strikes me, is that all of them have a different naming system for
files.

I suggest we set a naming standard for jQuery plugin files that
clearly marks them as dependant on jquery.js, and easily recognizable
for what they are:

jquery.plugin.js

So editable would be in jquery.editable.js, DOM would be in jquery.dom.js.

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


Re: [jQuery] Naming plugin files

2006-08-15 Thread Dimitar Spassov
What about these names: So editable would be in jquery.editable.js, DOM would be in jquery.dom.js.jq.editable.js, DOM would be in jq.dom.js.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Naming plugin files

2006-08-15 Thread Dylan Verheul
They don't line up nicely with jquery.js :-)

On 8/15/06, Dimitar Spassov [EMAIL PROTECTED] wrote:
 What about these names:


  So editable would be in jquery.editable.js, DOM would be in jquery.dom.js.
 jq.editable.js, DOM would be in jq.dom.js.

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




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


Re: [jQuery] Textarea: redux

2006-08-15 Thread Chad Lansford
I've tried everything I can think of, and I'm still having no luck. I am at my wits end!If I set the textarea's value to abc ($('#SendMessage1_txtMessageBody
).val(abc)), it shows up in the textarea correctly. But when I change the value in the textarea, and try to get the updated value ($(#SendMessage1_txtMessageBody
).val()) I still get back abc and not the updated value.Has anybody seen this before? Does anyone know if they ever got this problem solved from the following discussion? 
http://jquery.com/discuss/2006-July/008603/
Thanks again,ChadOn 8/11/06, ashutosh bijoor [EMAIL PROTECTED] wrote:
A much neater way to do what you need is to use the Form Serializer. This allows you to get values of all the inputs at one go, and you can then submit them. And there is also a de-serializer plugin that allows you to set values from a JSON into the form.
The form serializer is in the svn version in form.js. The deserializer is in the plugins directory at
http://proj.jquery.com/plugins/RegardsAshutosh
On 8/12/06, Matt Stith [EMAIL PROTECTED] wrote:

jQuery might be a little slow for this need, try using regular DOM selectors, it would be faster and easier.On 8/10/06, 
Chad Lansford 
[EMAIL PROTECTED] wrote:
I'm new to jQuery, and I'm having a problem grabbing the value from a textbox or textarea.
I searched the past discussions and found this issue:http://jquery.com/discuss/2006-July/008603/
This is basically what's happening to me, but I couldn't find the resolution I was hoping for in the past discussions. The interesting thing is that the same thing happens if I try to use document.getElementById



('elemid').value; - so... it may or may not be a jQuery issue at all.Anyway, I'd appreciate any help you all could offer... I'm pulling my hair out...Here's the code snippets:HTML:input name=SendMessage1:hdnID id=SendMessage1_hdnID type=hidden /
input name=SendMessage1:hdnSID id=SendMessage1_hdnSID type=hidden /input name=SendMessage1:hdnMessageType id=SendMessage1_hdnMessageType type=hidden /
input name=SendMessage1:txtMessageSubject type=text id=SendMessage1_txtMessageSubject /textarea name=SendMessage1:txtMessageBody id=SendMessage1_txtMessageBody/textarea
input type=button id=btnSubmit value=Send Message  false;/_javascript_:function sendUserMessage() {var id = $(#SendMessage1_hdnID).val();
var sid = $(#SendMessage1_hdnSID).val();var type = $(#SendMessage1_hdnMessageType).val();var subject = $(#SendMessage1_txtMessageSubject).val();var body = $(#SendMessage1_txtMessageBody).val();
alert(id); //returns correctlyalert(sid); //returns correctlyalert(type); //returns correctlyalert(subject); //ONLY returns original value, not the updated textalert(body); //ONLY returns the original value, not the updated text
//testalert(document.getElementById(SendMessage1_txtMessageSubject).value); //ONLY returns original value, not the updated textalert(document.getElementById(SendMessage1_txtMessageBody).value); //ONLY returns original value, not the updated text
}Chad

___jQuery mailing listdiscuss@jquery.com

http://jquery.com/discuss/

___jQuery mailing listdiscuss@jquery.com

http://jquery.com/discuss/-- Reach1to1 Communications
http://www.reach1to1.com
[EMAIL PROTECTED]98201-94408

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


Re: [jQuery] Textarea: redux

2006-08-15 Thread Chad Lansford
Ah, one HUGE issue that I forgot to mention is that it IS working in Firefox, but not in IE.ChadOn 8/15/06, Chad Lansford 
[EMAIL PROTECTED] wrote:I've tried everything I can think of, and I'm still having no luck. I am at my wits end!
If I set the textarea's value to abc ($('#SendMessage1_txtMessageBody
).val(abc)), it shows up in the textarea correctly. But when I change the value in the textarea, and try to get the updated value ($(#SendMessage1_txtMessageBody
).val()) I still get back abc and not the updated value.Has anybody seen this before? Does anyone know if they ever got this problem solved from the following discussion? 
http://jquery.com/discuss/2006-July/008603/
Thanks again,ChadOn 8/11/06, ashutosh bijoor 
[EMAIL PROTECTED] wrote:

A much neater way to do what you need is to use the Form Serializer. This allows you to get values of all the inputs at one go, and you can then submit them. And there is also a de-serializer plugin that allows you to set values from a JSON into the form.
The form serializer is in the svn version in form.js. The deserializer is in the plugins directory at

http://proj.jquery.com/plugins/RegardsAshutosh
On 8/12/06, Matt Stith [EMAIL PROTECTED] wrote:

jQuery might be a little slow for this need, try using regular DOM selectors, it would be faster and easier.On 8/10/06, 
Chad Lansford 
[EMAIL PROTECTED] wrote:
I'm new to jQuery, and I'm having a problem grabbing the value from a textbox or textarea.
I searched the past discussions and found this issue:http://jquery.com/discuss/2006-July/008603/
This is basically what's happening to me, but I couldn't find the resolution I was hoping for in the past discussions. The interesting thing is that the same thing happens if I try to use document.getElementById




('elemid').value; - so... it may or may not be a jQuery issue at all.Anyway, I'd appreciate any help you all could offer... I'm pulling my hair out...Here's the code snippets:HTML:input name=SendMessage1:hdnID id=SendMessage1_hdnID type=hidden /
input name=SendMessage1:hdnSID id=SendMessage1_hdnSID type=hidden /input name=SendMessage1:hdnMessageType id=SendMessage1_hdnMessageType type=hidden /
input name=SendMessage1:txtMessageSubject type=text id=SendMessage1_txtMessageSubject /textarea name=SendMessage1:txtMessageBody id=SendMessage1_txtMessageBody/textarea
input type=button id=btnSubmit value=Send Message  false;/_javascript_:function sendUserMessage() {var id = $(#SendMessage1_hdnID).val();
var sid = $(#SendMessage1_hdnSID).val();var type = $(#SendMessage1_hdnMessageType).val();var subject = $(#SendMessage1_txtMessageSubject).val();var body = $(#SendMessage1_txtMessageBody).val();
alert(id); //returns correctlyalert(sid); //returns correctlyalert(type); //returns correctlyalert(subject); //ONLY returns original value, not the updated textalert(body); //ONLY returns the original value, not the updated text
//testalert(document.getElementById(SendMessage1_txtMessageSubject).value); //ONLY returns original value, not the updated textalert(document.getElementById(SendMessage1_txtMessageBody).value); //ONLY returns original value, not the updated text
}Chad

___jQuery mailing listdiscuss@jquery.com

http://jquery.com/discuss/

___jQuery mailing listdiscuss@jquery.com


http://jquery.com/discuss/-- Reach1to1 Communications

http://www.reach1to1.com
[EMAIL PROTECTED]98201-94408

___jQuery mailing listdiscuss@jquery.com

http://jquery.com/discuss/


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


Re: [jQuery] Textarea: redux

2006-08-15 Thread Chad Lansford
thanks klaus...still no luck. i tried $('#SendMessage1_txtMessageBody').get(0).value, $('#SendMessage1_txtMessageBody').get(0).innerText and $('#SendMessage1_txtMessageBody').get(0).innerHTML. still getting nothin...
On 8/15/06, Klaus Hartl [EMAIL PROTECTED] wrote:
Chad Lansford schrieb: thanks for responding realazy, but it didn't work. i've tried: val(), text(), and html() all to no avail.try ($('#SendMessage1_txtMessageBody ).get(0).value
-- Klaus___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/

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


Re: [jQuery] Textarea: redux

2006-08-15 Thread Chad Lansford
Size returns 1.Funny you ask, I actually just finished going over the HTML... yeah, it's definitely unique.On 8/15/06, Klaus Hartl 
[EMAIL PROTECTED] wrote:
Chad Lansford schrieb: thanks klaus... still no luck.i tried $('#SendMessage1_txtMessageBody').get(0).value, $('#SendMessage1_txtMessageBody').get(0).innerText and $('#SendMessage1_txtMessageBody').get(0).innerHTML.still getting
 nothin...Ok, what does$('#SendMessage1_txtMessageBody').size()return?Is your HTML valid? Is that id truly unique?___jQuery mailing list
discuss@jquery.comhttp://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] XPath

2006-08-15 Thread Fil

I want the expression to verify that the link is in the correct data
structure, i.e. inside a dt that is inside a dl and where
$(this).parent().next() is a dd.

Said differently: I want to tell my script if the link is inside a dt
then show() the corresponding dd (if it exists).

That's why I was trying to use XPath and the parent::x syntax (and failed
miserably, ha ha).


 In the SVN build of jQuery you can do:
 
 $(this).parent().next().show();
 
 jQuery SVN can be found here:
 http://jquery.com/src/jquery-svn.js
 
 --John
 
  I have the following structure:
 
 dl
  dta href=urlx/a/dt
  ddtext/dd
 /dl
 
 
  I select the a element in this, and I want to show() the corresponding dd.
 
 
  This works but is not very precise:
  $(../../dt/../dd, this).show();
 
  I'm trying to write it more precisely with something like:
  $(parent::dt/parent::dl/dd, this).show();
 
  but I'm not finding the correct expression...

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


Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread Curdin Krummenacher
Hey there, have a look at Cody Lindley's thickbox. It sounds like this is more or less what youre after. Im no pro myself, so Im not going to post any code - i might get it wrong :)
http://codylindley.com/_javascript_/257/thickbox-one-box-to-rule-them-allcheerscOn 8/16/06, Braveheart 
[EMAIL PROTECTED] wrote:I stried to use ajax with jquery to load images. Basicly it works but I don't
get the image, instead I get some strange codes from the picture, I guessbecause .jpg is a binary file.Maybe this is a basic question, but still how can I load images with jqueryand is there any way to use that little animated .gif that shows that
somethink is loading with jquery?--View this message in context: http://www.nabble.com/how-to-load-images-with-jquery-ajax--tf2108823.html#a5812905
Sent from the JQuery forum at Nabble.com.___jQuery mailing listdiscuss@jquery.com
http://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Textarea: redux

2006-08-15 Thread kenton.simpson

Have you try emptying your cache and restarting IE. Sometimes IE cache gets
corrupted and It stop responding in a predictable manner.

Chad Lansford wrote:
 
 Size returns 1.
 
 Funny you ask, I actually just finished going over the HTML... yeah, it's
 definitely unique.
 
 On 8/15/06, Klaus Hartl [EMAIL PROTECTED] wrote:


 Chad Lansford schrieb:
  thanks klaus...
 
  still no luck.  i tried $('#SendMessage1_txtMessageBody').get(0).value,
  $('#SendMessage1_txtMessageBody').get(0).innerText and
  $('#SendMessage1_txtMessageBody').get(0).innerHTML.  still getting
  nothin...


 Ok, what does

 $('#SendMessage1_txtMessageBody').size()

 return?

 Is your HTML valid? Is that id truly unique?

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


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

-- 
View this message in context: 
http://www.nabble.com/Textarea%3A-redux-tf2085155.html#a5813350
Sent from the JQuery forum at Nabble.com.


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


Re: [jQuery] XPath

2006-08-15 Thread kenton.simpson

$(dl dt a).click(function (event) {
  event.preventDefault();
  event.stopPropagation();
  $(this).parent().next().show(); 
}); 


Fil wrote:
 
 
 I want the expression to verify that the link is in the correct data
 structure, i.e. inside a dt that is inside a dl and where
 $(this).parent().next() is a dd.
 
 Said differently: I want to tell my script if the link is inside a dt
 then show() the corresponding dd (if it exists).
 
 That's why I was trying to use XPath and the parent::x syntax (and failed
 miserably, ha ha).
 
 
 In the SVN build of jQuery you can do:
 
 $(this).parent().next().show();
 
 jQuery SVN can be found here:
 http://jquery.com/src/jquery-svn.js
 
 --John
 
  I have the following structure:
 
 dl
  dt url x /dt
  ddtext/dd
 /dl
 
 
  I select the   element in this, and I want to show() the corresponding
 dd.
 
 
  This works but is not very precise:
  $(../../dt/../dd, this).show();
 
  I'm trying to write it more precisely with something like:
  $(parent::dt/parent::dl/dd, this).show();
 
  but I'm not finding the correct expression...
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 

-- 
View this message in context: 
http://www.nabble.com/XPath-tf2106968.html#a5813465
Sent from the JQuery forum at Nabble.com.


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


Re: [jQuery] Textarea: redux

2006-08-15 Thread Mike Alsup
 Have you try emptying your cache and restarting IE. Sometimes IE cache gets
 corrupted and It stop responding in a predictable manner.

That's a good idea.  Also, try to ween down the page as much as
possible to pin-point the problem; strip out everything you can.
value is the dom property that holds the textarea text, the form
plugin is proof of that.  Here's a form that uses the form plugin:
http://malsup.com/jquery/form
Do you get the correct textarea values using this form?

Mike

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


Re: [jQuery] Dom creation

2006-08-15 Thread Dave Methvin
 How would i go about making a table and then inserting rows
 in the body in a for loop. I am wanting to create a stats board for 
 a post match. I figured i would create the table and then append
 to it am i right in how to go about this? How would i append to a
 tag in the table i just created?
 http://3spn.net/jQuery/dom_creation.html
 I wanted to add more player rows how would i do that? hehe I
 tried to do a append($table  tr) deal but it didnt work.

The tr elements descend from either thead or tbody, so tabletr won't match
anything. There's a workaround in the latest jQuery that will  catch the
case of appending tr to table and put it in tbody, but it's best to say it
yourself.

Instead of applying a style to each td, use a colgroup and apply the styles
(or classes) to the col elements. It will save you a lot of messy coding.


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


[jQuery] how to bring new form to the top of the page

2006-08-15 Thread Janko Hauser
Hello, I open a new form via $().show(). Unfortunately the button to  
open the form is already at the bottom of the page, so the user needs  
to scroll to see the complete form. I tried to use location.href  
right after the $().show(), with an anchor in the form and also with  
an anchor under the form, but this does not work. If the anchor is in  
the form I get side-effects of a partly hidden form, at least under  
firefox.

Any hints how to solve this?

TIA,

__Janko Hauser





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


Re: [jQuery] how to bring new form to the top of the page

2006-08-15 Thread Dave Methvin
 I tried to use location.href right after the $().show()

If the animation isn't done then the form isn't showing yet and you probably
can't scroll to an anchor in it. Maybe something like this?

 $(p).show(slow,function(){
location.href = #whatever;
 }); 

The completion function is supported in the latest SVN but if you're using
something older you'd need to make sure it works; put an alert in the
function to be sure.


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


Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread SDisk SDisk
You can not load images with AJAX simply create a new image object and append, then the image can load asyncronously. Try this simple jQuery plugin:$.fn.image = function(src, f){ return this.each(function(){
  var i = new Image();  i.src = "">  i.>  this.appendChild(i); });}Then call this plugin like:$(#container).image(
http://jquery.com/images/hat2.gif,function(){ alert(The image is loaded now);});2006/8/15, Braveheart [EMAIL PROTECTED]
:I stried to use ajax with jquery to load images. Basicly it works but I don't
get the image, instead I get some strange codes from the picture, I guessbecause .jpg is a binary file.Maybe this is a basic question, but still how can I load images with jqueryand is there any way to use that little animated .gif that shows that
somethink is loading with jquery?--View this message in context: http://www.nabble.com/how-to-load-images-with-jquery-ajax--tf2108823.html#a5812905
Sent from the JQuery forum at Nabble.com.___jQuery mailing listdiscuss@jquery.com
http://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] In-situ editing (Editable, etc.) disturbs layout

2006-08-15 Thread Jonathan Sharp
On 8/15/06, Dylan Verheul [EMAIL PROTECTED] wrote:
Hi,The problem you describe is indeed due to the nature of the formelement. Many browsers have given it a (hardcoded) style, a block withsome margin.Also, the input or textarea created by editable could be styled.
I'll look into the memory leakage part, but I've never really noticed it myself.I doubt it would be a memory leak since the form is part of the dom. All it does is leave around some extra elements. In short it should clean up what it alters.
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] replaced content losing it's 'binding'

2006-08-15 Thread Jason Huck

Taking my first real stab at jquery, and can't get around what I expect is a
common problem:

I have a table to which the user can add/remove rows. The data in the table
is also periodically refreshed. All my functions work on their own, but
after the first add/refresh, my deletes stop working.

From what I've read, it appears that the dynamically updated elements lose
their binding to my jquery function, but even though i've liberally
sprinkled $(document).ready() throughout my code in hopes of re-attaching
them, I've had no luck so far.

Here's the js I have so far:

script type=text/javascript 
$(document).bind(load, function(){
$(#addsymbolform).bind(submit,function(){
var newSymbols = 
document.getElementById('newsymbol').value;
document.getElementById('newsymbol').value = '';

if(newSymbols.length  0) {
$(tbody#stocks).load('/myurlwithparams');
$(document).ready();
}

return false;
});


var stocktimer = setInterval(function(){
$(tbody#stocks).load('/myurlwithparams');
$(document).ready();
}, 3);


$(a.remsymbtn).click(function(){
var symid = a# + this.id + id;
var symname = $(symid).html();
$((tr# + this.id + row)).hide(slow);
$.get('/myurlwithparams' + symname);
$(document).ready();
return false;
});

$(document).ready();
});
/script


...And here's an example of the rendered HTML that I'm swapping about (just
the stuff inside the table body):


table width=100% border=0 cellspacing=0 cellpadding=0
tbody id=stocks
tr id=sym1row
td
 # 
 delete.gif 
 
/td
td /somewhere/?s=AAPL AAPL /td
td65.75/td
td+1.81/td
/tr
tr id=sym2row
td
 # 
 delete.gif 
 
/td
td /somewhere/?s=CSCO CSCO /td
td20.56/td
td+0.47/td
/tr
/tbody
/table

I even tried stuffing a $(document).ready(); into the returned content, but
it didn't help.

Any suggestions greatly appreciated!


Thanks,
Jason


p.s., as an aside, I did have some transitions around the functions, i.e.,
hide/show and slideUp/slideDown on the add/refresh functions, but they
really messed with the display, in every browser I tried.


-- 
View this message in context: 
http://www.nabble.com/replaced-content-losing-it%27s-%27binding%27-tf2109860.html#a5816505
Sent from the JQuery forum at Nabble.com.


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


Re: [jQuery] In-situ editing (Editable, etc.) disturbs layout

2006-08-15 Thread Dossy Shiobara
On 2006.08.15, Jonathan Sharp [EMAIL PROTECTED] wrote:
 I'll look into the memory leakage part, but I've never really noticed it
 myself.
 
 I doubt it would be a memory leak since the form is part of the dom. All it
 does is leave around some extra elements. In short it should clean up what
 it alters.

Yes, but every time the click handler is fired, it creates a new form
and input node ... and never removes them.  Imagine a web application
where the page is long-living (which is reasonable given AJAX).  What
will happen to the DOM tree?  It'll continue to accumulate form and
input nodes each time the click handler is fired.

Or, am I missing something here?  Do the form/input nodes get removed
and I just can't tell?  If so: why does the edited element stay rendered
the way it is?  From my empirical tests, it seems that the form node
continues to exist after the submit/reset of the in-situ editing is
performed.

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)

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


[jQuery] date picker plugin update

2006-08-15 Thread Kelvin Luck
Hi,

I've just released some fixes to my jQuery date picker plugin which you 
can get from here:

http://kelvinluck.com/assets/jquery/datePicker/

The fixes since I last announced on the list are:

* You can now specify an end date - dates after this can't be selected 
($.datePicker.setLastDate).

* The markup required to use the plugin is now much cleaner.

* You can now localise the plugin and change the language of the strings 
within it ($.datePicker.setLanguageStrings).

* There is a fix involving an iframe behind the calendar to stop form 
elements (especially selects) poking through in IE/PC.

And probably a few more tweaks - the full changelog is available on the 
link above. If you were using a previous version of the plugin you may 
need to tweak your markup and CSS a little, hopefully this won't be too 
painful.

Please have a play with the plugin and let me know if you have any 
problems or suggestions for improvement,

Cheers,

Kelvin :)


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


Re: [jQuery] In-situ editing (Editable, etc.) disturbs layout

2006-08-15 Thread Jonathan Sharp
On 8/15/06, Dossy Shiobara [EMAIL PROTECTED] wrote:
On 2006.08.15, Jonathan Sharp [EMAIL PROTECTED] wrote: I'll look into the memory leakage part, but I've never really noticed it myself.
 I doubt it would be a memory leak since the form is part of the dom. All it does is leave around some extra elements. In short it should clean up what it alters.Yes, but every time the click handler is fired, it creates a new form
and input node ... and never removes them.Imagine a web applicationwhere the page is long-living (which is reasonable given AJAX).Whatwill happen to the DOM tree?It'll continue to accumulate form and
input nodes each time the click handler is fired.Or, am I missing something here?Do the form/input nodes get removedand I just can't tell?If so: why does the edited element stay rendered
the way it is?From my empirical tests, it seems that the form nodecontinues to exist after the submit/reset of the in-situ editing isperformed.You're correct that it leaks dom objects but memory leak refers to when an object is created and is no longer referenced and fails to get garbage collected. So there's no way to access the object and it never gets freed.
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Closures

2006-08-15 Thread Jonathan Sharp
http://laurens.vd.oever.nl/weblog/items2005/closures/Has this been found to be an adequate solution to this issue? (mainly for non jquery code)
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] date picker plugin update

2006-08-15 Thread Andy Matthews
Good job Kelvin...this looks really nice.

I believe that one of the requests was to allow selection of previous years.
Currently the next/prev buttons would tedious to wade through if you're
going back or forward more than a few months.

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

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Kelvin Luck
Sent: Tuesday, August 15, 2006 11:01 AM
To: jQuery Discussion.
Subject: [jQuery] date picker plugin update


Hi,

I've just released some fixes to my jQuery date picker plugin which you
can get from here:

http://kelvinluck.com/assets/jquery/datePicker/

The fixes since I last announced on the list are:

* You can now specify an end date - dates after this can't be selected
($.datePicker.setLastDate).

* The markup required to use the plugin is now much cleaner.

* You can now localise the plugin and change the language of the strings
within it ($.datePicker.setLanguageStrings).

* There is a fix involving an iframe behind the calendar to stop form
elements (especially selects) poking through in IE/PC.

And probably a few more tweaks - the full changelog is available on the
link above. If you were using a previous version of the plugin you may
need to tweak your markup and CSS a little, hopefully this won't be too
painful.

Please have a play with the plugin and let me know if you have any
problems or suggestions for improvement,

Cheers,

Kelvin :)


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


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


[jQuery] loading content with load() and having probs with a.test

2006-08-15 Thread scharc

hi, Im very new to jquery and so I have stil a lot to learn...
this is the code I use:

script type=text/javascript
$(document).ready(function(){
$(a.menu).click(function(){
  $(body).append(div class='over_content' img
src='content/loading.gif' //div);
$(div.content).load(this.href,function(){
$(div.over_content).remove();
});
return false;
});
});

/script
---
everything is fine, untill I load some content with a link inside like 
news.html click 
If I click on this loaded link, return flase; don't work and redirect me
instead of loading the content news.html into my div... whats wrong?
-- 
View this message in context: 
http://www.nabble.com/loading-content-with-load%28%29-and-having-probs-with-a.test-tf2110161.html#a5817461
Sent from the JQuery forum at Nabble.com.


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


Re: [jQuery] date picker plugin update

2006-08-15 Thread bbuchs

I would argue that less is more. One of the most fantastic things about
jQuery and the syntax is that it's so damn light. What's the most common
scenario for a date picker in a web app? Is it really neccessary to pick a
date 2, 3 years in the future?

Othewise, great plugin Kelvin. My only suggestions would be (1) to remove
the extra markup and use a DOM creation method or a wrap() to add the
container DIV, and (2) instead of doing INIT calls to use something more
jquery-esque:

$(input.mydate).datePicker({format:'mm/dd/', startdate:'08/15/2006',
enddate:'08/31/2006'});

But that's just me... Great work!


-- 
View this message in context: 
http://www.nabble.com/date-picker-plugin-update-tf2109968.html#a5817683
Sent from the JQuery forum at Nabble.com.


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


Re: [jQuery] Closures

2006-08-15 Thread Michael Geary
 http://laurens.vd.oever.nl/weblog/items2005/closures/
 
 Has this been found to be an adequate solution to this issue? 
 (mainly for non jquery code)

Yes, it solves the IE closure problem very nicely. My closure plugin for
jQuery uses a modified version of this code.

-Mike


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


Re: [jQuery] date picker plugin update

2006-08-15 Thread Jörn Zaefferer
 $(input.mydate).datePicker({format:'mm/dd/', startdate:'08/15/2006',
 enddate:'08/31/2006'});

Yeah! That would be much better! This way you could create several date 
pickers at once, without having to configure which class is used to mark the 
date field. And it would be possible to use several date pickers on a page 
with different settings, something currently not possible, as far as I get 
it.

Maybe further feature requests should be branched into a new plugin. I guess 
its nice to have it simple to use and small. On the other hand, its not able 
to select a birthdate etc.

-- Jörn 


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


[jQuery] unbind all events for an object? (Fix issue with AJAX loaded content and leaked elements, ie drip)

2006-08-15 Thread Jonathan Sharp
Do events need to be unbound from dom objects? For example, I load in some content via ajax and attach a few events to some of these elements. Then I refresh this via another ajax call and load in more content attaching additional events. IE Drip has these elements listed as being leaked. 
Is there a way that I say loop through my content and unattach all events before replacing the content? (Essentially a $(object).unbind(); that removes all events)-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Closures

2006-08-15 Thread Dave Methvin
 http://laurens.vd.oever.nl/weblog/items2005/closures/
 
 Has this been found to be an adequate solution to this issue? 
 (mainly for non jquery code)

 Yes, it solves the IE closure problem very nicely. My closure 
 plugin for jQuery uses a modified version of this code.

Yipes! I just did a quick test with IE6 and SVN 170. With nothing other than
the jQuery.js include and an empty body, it's leaking about 300KB for each
reload measured by Task Manager. FF doesn't leak at all. Can anyone else
repro that?

I think we discussed this topic a few months back, IE will leak memory if
any DOM elements have references to Javascript objects when the page
unloads. The jQuery event code adds a level of indirection to take care of
closures inside user-supplied event handlers, but it doesn't seem to remove
its own event handler or the Javascript objects it's attached to the DOM
object. That can be done with an onunload handler.

Here's my entire test file:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleTest/title
style type=text/css
/style

script language=JavaScript src=jquery-svn.js
type=text/javascript/script

script type=text/javascript
/script

/head
body

/body
/html


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


Re: [jQuery] unbind all events for an object? (Fix issue with AJAXloaded content and leaked elements, ie drip)

2006-08-15 Thread Dave Methvin





Do events need to be unbound from dom 
objects?

I 
think they do, seethe Closures thread.

Is there a way that I say loop through my content 
and unattach all
 events before replacing the content? 
(Essentially a $(object).unbind(); that removes all events)
It 
looks like .unbind() with no event will remove all events.

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


Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread Braveheart

I guess this is what I was looking for.
Anyway I don't know almost anything about javaScript and I started using it
since I found out about AJAX
So can you explain me better for how to implement it?

Here is my example how I tried using it:

$(document).ready(function(){
// The plugin
$.fn.image = function(src, f){
return this.each(function(){
var i = new Image();
i.src = src;
i.onload = f;
this.appendChild(i);
});
}

// The code for the image to load
  $(div#container).image(oganges.jpg,function(){
alert(The image is loaded now);
}); 
});
-- 
View this message in context: 
http://www.nabble.com/how-to-load-images-with-jquery-ajax--tf2108823.html#a5818756
Sent from the JQuery forum at Nabble.com.


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


Re: [jQuery] date picker plugin update

2006-08-15 Thread Larry Garfield
On Tue, August 15, 2006 11:49 am, bbuchs said:

 I would argue that less is more. One of the most fantastic things about
 jQuery and the syntax is that it's so damn light. What's the most common
 scenario for a date picker in a web app? Is it really neccessary to pick a
 date 2, 3 years in the future?

 Othewise, great plugin Kelvin. My only suggestions would be (1) to remove
 the extra markup and use a DOM creation method or a wrap() to add the
 container DIV, and (2) instead of doing INIT calls to use something more
 jquery-esque:

 $(input.mydate).datePicker({format:'mm/dd/', startdate:'08/15/2006',
 enddate:'08/31/2006'});

 But that's just me... Great work!

I would second this.  The init method in use currently, if I understand it
correctly, means that multiple date pickers on the same page must have the
same settings.  That is not always desirable.  Passing a config object as
in bbuchs's example above would not only look cleaner, it would make each
picker independently configurable.  Spiffy!

Now, if there were a way to make the start and end dates dependent on
another date picker field, then you'd have support for from and to
date fields, automatically enforcing the the to can't be after the from. 
That would be highly cool. :-)

That said, this is still a most excellent plugin!

--Larry Garfield


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


Re: [jQuery] date picker plugin update

2006-08-15 Thread Michael Fuerst
Jörn Zaefferer schrieb:
 $(input.mydate).datePicker({format:'mm/dd/', startdate:'08/15/2006',
 enddate:'08/31/2006'});
 

 Yeah! That would be much better! This way you could create several date 
 pickers at once, without having to configure which class is used to mark the 
 date field. And it would be possible to use several date pickers on a page 
 with different settings, something currently not possible, as far as I get 
 it.

 Maybe further feature requests should be branched into a new plugin. I guess 
 its nice to have it simple to use and small. On the other hand, its not able 
 to select a birthdate etc.

 -- Jörn 


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
   
Great plugin, here are a few suggestions:

Make the textfield read-only (optional). Whats the point in having a
date picker, when the user still can put  unwanted date in the textfield :-)
I would also prefer a way to go faster through the dates, so a 3 month
-next/prev (optional) 6 month next/prev (optional) would be great.

Michael

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


Re: [jQuery] date picker plugin update

2006-08-15 Thread Andy Matthews
Sure...

It wouldn't be all that common. But it was a request from the last time he
posted a link to it. It will come up though and I'd suggest trying to build
it in if it's not too much addtl code.

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

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of bbuchs
Sent: Tuesday, August 15, 2006 11:49 AM
To: discuss@jquery.com
Subject: Re: [jQuery] date picker plugin update



I would argue that less is more. One of the most fantastic things about
jQuery and the syntax is that it's so damn light. What's the most common
scenario for a date picker in a web app? Is it really neccessary to pick a
date 2, 3 years in the future?

Othewise, great plugin Kelvin. My only suggestions would be (1) to remove
the extra markup and use a DOM creation method or a wrap() to add the
container DIV, and (2) instead of doing INIT calls to use something more
jquery-esque:

$(input.mydate).datePicker({format:'mm/dd/', startdate:'08/15/2006',
enddate:'08/31/2006'});

But that's just me... Great work!


--
View this message in context:
http://www.nabble.com/date-picker-plugin-update-tf2109968.html#a5817683
Sent from the JQuery forum at Nabble.com.


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


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


[jQuery] How to bind an event to a function of a class?

2006-08-15 Thread Webunity | Gilles van den Hoven
Hi Guys,

How can i bind/unbind an event to a specific function of a class?

e.g.

class {
somecallback() {
},
somefunc() {
$(document).keypress(this.somecallback);
},
otherfunc() {
$(document).unkeypress(this.somecallback);
}
}

Is this possible?

Thanx,

Gilles

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


Re: [jQuery] How to bind an event to a function of a class?

2006-08-15 Thread Christian Bach
Hi,

Is this what you mean?

var test = new TestClass();

function TestClass() {

function callback() {
alert('fired!');
}

function doSomething() {

$(document).keypress(callback);
}

//
doSomething();
};



Webunity | Gilles van den Hoven wrote:
 Hi Guys,
 
 How can i bind/unbind an event to a specific function of a class?
 
 e.g.
 
 class {
 somecallback() {
 },
 somefunc() {
 $(document).keypress(this.somecallback);
 },
 otherfunc() {
 $(document).unkeypress(this.somecallback);
 }
 }
 
 Is this possible?
 
 Thanx,
 
 Gilles
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 


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


Re: [jQuery] date picker plugin update

2006-08-15 Thread Mike Alsup
 Make the textfield read-only (optional). Whats the point in having a
 date picker, when the user still can put  unwanted date in the textfield :-)

The point is that the user can choose how they enter dates.  I know I
can type a date value much faster than I can use a date widget and it
would annoy me to be forced to use the widget.  Other users would feel
the opposite way.  Kelvin has done a great job supporting both use
cases.

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


Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread SDisk SDisk
Maybe you need learn some of _javascript_ basics and jQuery notation.The plugin normally is in a separate file, althought you can write the plugincode in your program code:in HTML code:script type=text/_javascript_ src=""
jquery.js/scriptscript type=text/_javascript_/* the Plugin here */$.fn.image = function(src, f){}/* start code of this page */$(document).ready(function(){ $(#imagecontainer).image(
oranges.jpg,function(){ alert(The image is loaded); });});/scriptbodydiv id=imagecontainer/div/body
2006/8/15, Braveheart [EMAIL PROTECTED]:
I guess this is what I was looking for.Anyway I don't know almost anything about _javascript_ and I started using itsince I found out about AJAXSo can you explain me better for how to implement it?Here is my example how I tried using it:
$(document).ready(function(){// The plugin$.fn.image = function(src, f){return this.each(function(){var i = new Image();i.src = ""
i.>this.appendChild(i);});}// The code for the image to load$(div#container).image(
oganges.jpg,function(){alert(The image is loaded now);});});--View this message in context: 
http://www.nabble.com/how-to-load-images-with-jquery-ajax--tf2108823.html#a5818756Sent from the JQuery forum at Nabble.com.___
jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] platform/plugins detection with jQuery

2006-08-15 Thread Matt Stith
well jQuery already has browser detection, the current browser is saved in the variable $.browser , but im not sure if thats what your looking for.On 8/15/06, 
Will Arp [EMAIL PROTECTED] wrote:Dear list,
is there a jQuery plugin or exampleon platform+plugin detection?If not could you please, point me tothe latest in plugin detection andobject/embed code?Thank you and have a great day!Will Arp
___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/

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


[jQuery] .contains() ?

2006-08-15 Thread Webunity | Gilles van den Hoven
I'm trying to figure something out, but i'm kinda lost in the documented 
jQuery code...

Is there a way to see if an object is a child of another object?

e.g. if a link is a child of a div?

link1
div
link2
/div

based upon the outcome, i need to do something, which i am going to 
share, but first i need to get it working :)

-- Gilles

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


Re: [jQuery] .contains() ?

2006-08-15 Thread John Resig
Well, the obvious way would be to do this:

$(div  link)

but if you're going from the context of the link element itself, you could do:

$(this).parent(div)

Hope this helps. (This is with the SVN version of jQuery)

--John

On 8/15/06, Webunity | Gilles van den Hoven [EMAIL PROTECTED] wrote:
 I'm trying to figure something out, but i'm kinda lost in the documented
 jQuery code...

 Is there a way to see if an object is a child of another object?

 e.g. if a link is a child of a div?

 link1
 div
 link2
 /div

 based upon the outcome, i need to do something, which i am going to
 share, but first i need to get it working :)

 -- Gilles

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



-- 
John Resig
http://ejohn.org/
[EMAIL PROTECTED]

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


Re: [jQuery] Simple checkbox replacement

2006-08-15 Thread Andy Matthews
Oooh...nice!

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

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of kawika k
Sent: Tuesday, August 15, 2006 3:45 PM
To: jQuery Discussion.
Subject: [jQuery] Simple checkbox replacement



Example
http://kawika.org/jquery/checkbox/


Code
jQuery.fn.checkbox = function (opt) {

$([EMAIL PROTECTED]'checkbox'], this).each( function () {

var img = document.createElement(img);
img.src = this.checked ? opt.checked : opt.unchecked;

$(img).click( function() {

var input = this.nextSibling;
if ( input.checked ) {
this.src = opt.unchecked;
input.checked = ;
}
else {
this.src = opt.checked;
input.checked = checked;
}
});

$(this).parent().prepend(img)
$(this).hide();
});
}


Usage
$(document).ready( function () {
$().checkbox({checked: accept.png, unchecked: cancel.png});
});


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


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


Re: [jQuery] .contains() ?

2006-08-15 Thread Webunity | Gilles van den Hoven
John Resig wrote:
 Hope this helps. (This is with the SVN version of jQuery)
   
Hmm, not really I am trying to do something like this:
If the event receiving the focus is not a child of another object, set 
the focus back to that object.
As you might guess, this is for a new style lightbox :)
I am trying to prevent that a user can tab out of a lightbox, e.g. to 
a link at the bottom of the page

Here's what i got so far, but it doesn't work yet...

-- Can someone help me?

-
javascript
-
$(document).focus(
function(oEvent) {
var oElem = oEvent.srcElement || oEvent.target;

while (oElem = oElem.parentNode) {
if (oElem == $('#test').get(0)) {
return true;
}
}

// todo: set focus on another element
$('#test').get(0).focus();

return false;
}
);


-
code
-
a href=/1link 1/a | a href=/2link 2/a | a 
href=/3link 3/abr /
br /

div id=test
a href=/4link 4/a | a href=/5link 5/a | a 
href=/6link 6/a
/div


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


Re: [jQuery] .contains() ?

2006-08-15 Thread John Resig
Ok, I understand your problem better now, try this:

   $(document).focus(function(oEvent) {
   if ( $( oEvent.srcElement || oEvent.target ).ancestors(
#test ).length )
   return true;

   $('#test')[0].focus();

   return false;
   });

Again, with the SVN version of jQuery:
http://jquery.com/src/jquery-svn.js

--John

On 8/15/06, Webunity | Gilles van den Hoven [EMAIL PROTECTED] wrote:
 John Resig wrote:
  Hope this helps. (This is with the SVN version of jQuery)
 
 Hmm, not really I am trying to do something like this:
 If the event receiving the focus is not a child of another object, set
 the focus back to that object.
 As you might guess, this is for a new style lightbox :)
 I am trying to prevent that a user can tab out of a lightbox, e.g. to
 a link at the bottom of the page

 Here's what i got so far, but it doesn't work yet...

 -- Can someone help me?

 -
 javascript
 -
 $(document).focus(
 function(oEvent) {
 var oElem = oEvent.srcElement || oEvent.target;

 while (oElem = oElem.parentNode) {
 if (oElem == $('#test').get(0)) {
 return true;
 }
 }

 // todo: set focus on another element
 $('#test').get(0).focus();

 return false;
 }
 );


 -
 code
 -
 a href=/1link 1/a | a href=/2link 2/a | a
 href=/3link 3/abr /
 br /

 div id=test
 a href=/4link 4/a | a href=/5link 5/a | a
 href=/6link 6/a
 /div


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



-- 
John Resig
http://ejohn.org/
[EMAIL PROTECTED]

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


Re: [jQuery] replaced content losing it's 'binding'

2006-08-15 Thread Jonathan Howard
First off, $(document).ready() only fires once. When the document is first ready.

Second, if you have events on a dom object, and create an identical dom object, you need to reattach the events to this new dom object when it's created (or really, whenever) for the events to fire.
I don't even really know what you're trying to accomplish with $(document).bind(load,etc...);

Just use

$(document).ready(function(){
 code you want to happen on page load
});

On 8/15/06, Jason Huck [EMAIL PROTECTED] wrote:
Taking my first real stab at jquery, and can't get around what I expect is acommon problem:
I have a table to which the user can add/remove rows. The data in the tableis also periodically refreshed. All my functions work on their own, butafter the first add/refresh, my deletes stop working.From what I've read, it appears that the dynamically updated elements lose
their binding to my jquery function, but even though i've liberallysprinkled $(document).ready() throughout my code in hopes of re-attachingthem, I've had no luck so far.Here's the js I have so far:
script type=text/_javascript_ $(document).bind(load, function(){ $(#addsymbolform).bind(submit,function(){ var newSymbols = 
document.getElementById('newsymbol').value; document.getElementById('newsymbol').value = ''; if(newSymbols.length  0) { $(tbody#stocks).load('/myurlwithparams');
 $(document).ready(); } return false; }); var stocktimer = setInterval(function(){ $(tbody#stocks).load('/myurlwithparams');
 $(document).ready(); }, 3); $(a.remsymbtn).click(function(){ var symid = a# + 
this.id + id; var symname = $(symid).html(); $((tr# + this.id + row)).hide(slow); $.get('/myurlwithparams' + symname);
 $(document).ready(); return false; }); $(document).ready(); });/script...And here's an example of the rendered HTML that I'm swapping about (just
the stuff inside the table body):table width=100% border=0 cellspacing=0 cellpadding=0 tbody id=stocks tr id=sym1row
 td#delete.gif /td td /somewhere/?s=AAPL AAPL /td
 td65.75/td td+1.81/td /tr tr id=sym2row td
#delete.gif /td td /somewhere/?s=CSCO CSCO /td td
20.56/td td+0.47/td /tr /tbody/tableI even tried stuffing a $(document).ready(); into the returned content, but
it didn't help.Any suggestions greatly appreciated!Thanks,Jasonp.s., as an aside, I did have some transitions around the functions, i.e.,hide/show and slideUp/slideDown on the add/refresh functions, but they
really messed with the display, in every browser I tried.--View this message in context: http://www.nabble.com/replaced-content-losing-it%27s-%27binding%27-tf2109860.html#a5816505
Sent from the JQuery forum at Nabble.com.___jQuery mailing listdiscuss@jquery.com
http://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Simple checkbox replacement

2006-08-15 Thread Jonathan Sharp
On 8/15/06, John Resig [EMAIL PROTECTED] wrote:
This is some great code - I really dig it. It's super simple, which is good.Just as a mini-tutorial to the upcoming 1.0b, here are some of thechanges that are possible:jQuery.fn.checkbox = function (opt) {
$([EMAIL PROTECTED]'checkbox'], this).hide().each(function(){$(img)Notice the element creation here... very slick John! 
.src( this.checked ? opt.checked : opt.unchecked ).click( function() {var check = this.src == opt.checked;$(this).src( check ? 
opt.unchecked : opt.checked ).next().attr( checked, check ?  : checked ); }).insertBefore( this );});};I'm not saying that mine is any better - just using this as a
demonstration of what's possible.--John Example http://kawika.org/jquery/checkbox/ Code jQuery.fn.checkbox = function (opt) {
 $([EMAIL PROTECTED]'checkbox'], this).each( function () { var img = document.createElement(img); img.src = "" ? 
opt.checked : opt.unchecked; $(img).click( function() { var input = this.nextSibling; if ( input.checked ) { 
this.src = ""> input.checked = ; } else { this.src = ""
; input.checked = checked; } }); $(this).parent().prepend(img) $(this).hide();
 }); } Usage $(document).ready( function () { $().checkbox({checked: accept.png, unchecked: cancel.png}); });
___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/

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


Re: [jQuery] replaced content losing it's 'binding'

2006-08-15 Thread Jason Huck

 First off, $(document).ready() only fires once.  When the document is first
 ready.

Ok, makes sense, but, how do you reattach updated content to your events?


 Second, if you have events on a dom object, and create an identical dom
 object, you need to reattach the events to this new dom object when it's
 created (or really, whenever) for the events to fire.

Yes, exactly. How?


 I don't even really know what you're trying to accomplish with
 $(document).bind(load,etc...);

I think I got it from the rounded corners plugin sample code, which is the
first thing I used with jquery. Sorry, what can I say, I'm just getting
started with this stuff.


 Just use
 
 $(document).ready(function(){
 code you want to happen on page load
 });

Ok, I'll make that change. 


Thanks,
Jason


-- 
View this message in context: 
http://www.nabble.com/replaced-content-losing-it%27s-%27binding%27-tf2109860.html#a5823036
Sent from the JQuery forum at Nabble.com.


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


Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread Jason Foss
On 15/08/06, Braveheart [EMAIL PROTECTED] wrote:


 Maybe this is a basic question, but still how can I load images with jquery
 and is there any way to use that little animated .gif that shows that
 somethink is loading with jquery?
 --
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

I cheated a bit with this one and just used a div with an id of #waiting

#waiting {
position: absolute;
width: 400px;
height: 30em;
top: 0px;
left: 150px;
z-index: 100;
border: 5px solid ##755228;
background: #fff url(/images/indicator_verybig.gif) no-repeat center 
center;
display: none;
}
#waiting.show {
display: block;
}

Then add
$(#waiting).addClass(show);
to your click(function())
and
$(#waiting).removeClass(show);
to the Callback function



-- 
Jason Foss
http://www.almost-anything.com.au
http://www.waterfallweb.net
Windows Messenger: [EMAIL PROTECTED]
North Rockhampton, Queensland, Australia

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


Re: [jQuery] replaced content losing it's 'binding'

2006-08-15 Thread Jonathan Howard
You reattach it the same way you attack it the first time. Because you're going to be rebinding, move the stuff in the first bind (where you bind the submit action) into it's own function (outside of the $(document).ready() function, only put stuff there that you want firing when the page loads). Then do something like this:


$(document).ready(
 $(#addsymbolform).bind(submit,function(){   var newSymbols = document.getElementById('newsymbol').value;   document.getElementById('newsymbol').value = '';
   if(newSymbols.length  0) {   $(tbody#stocks).load('/myurlwithparams');   $(document).ready();   }
   return false;   });
);


becomes:

$(document).ready( 
 $(#addsymbolform).bind(submit,newFunc());
);

function newFunct() {
 var newSymbols = document.getElementById('newsymbol').value;   document.getElementById('newsymbol').value = '';   if(newSymbols.length  0) {   $(tbody#stocks).load('/myurlwithparams');
   //$(document).ready(); INSTEAD OF THIS:
 $(#addsymbolform).unbind();
 $(#addsymbolform).bind(submit,newFunc());}   return false;   }


Without an example site so I can see exactly what's going wrong, that's the best I can do. Hope it helps!


On 8/15/06, Jason Huck [EMAIL PROTECTED] wrote:
 First off, $(document).ready() only fires once.When the document is first ready.
Ok, makes sense, but, how do you reattach updated content to your events? Second, if you have events on a dom object, and create an identical dom object, you need to reattach the events to this new dom object when it's
 created (or really, whenever) for the events to fire.Yes, exactly. How? I don't even really know what you're trying to accomplish with $(document).bind(load,etc...);
I think I got it from the rounded corners plugin sample code, which is thefirst thing I used with jquery. Sorry, what can I say, I'm just gettingstarted with this stuff. Just use $(document).ready(function(){
 code you want to happen on page load });Ok, I'll make that change.Thanks,Jason--View this message in context: 
http://www.nabble.com/replaced-content-losing-it%27s-%27binding%27-tf2109860.html#a5823036Sent from the JQuery forum at Nabble.com.___
jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] platform/plugins detection with jQuery

2006-08-15 Thread Will Arp
Thank you Matt,

does $.browser tell if it's running firefox on mac or win ?
is $.browser.plugins coming in release 1.0? 8-)


Have a great day!
will

On 15-ago-06, at 22:11, Matt Stith wrote:

 well jQuery already has browser detection, the current browser is  
 saved in the variable $.browser , but im not sure if thats what  
 your looking for.

 On 8/15/06, Will Arp [EMAIL PROTECTED] wrote:Dear list,
 is there a jQuery plugin or example
 on platform+plugin detection?
 If not could you please, point me to
 the latest in plugin detection and
 object/embed code?

 Thank you and have a great day!
 Will Arp

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

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


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


Re: [jQuery] Simple checkbox replacement

2006-08-15 Thread kawika k

I like that, especially the new dom element creation ... does it also 
include any nifty way to do nested element creation like the dom 
creation plugins?

Kawika


John Resig wrote:
 This is some great code - I really dig it. It's super simple, which is good.
 
 Just as a mini-tutorial to the upcoming 1.0b, here are some of the
 changes that are possible:
 
 jQuery.fn.checkbox = function (opt) {
 $([EMAIL PROTECTED]'checkbox'], this).hide().each(function(){
 $(img)
 .src( this.checked ? opt.checked : opt.unchecked )
 .click( function() {
 var check = this.src == opt.checked;
 
 $(this)
 .src( check ? opt.unchecked : opt.checked )
 .next().attr( checked, check ?  : checked );
  }).insertBefore( this );
 });
 };
 
 I'm not saying that mine is any better - just using this as a
 demonstration of what's possible.
 
 --John
 
 Example
 http://kawika.org/jquery/checkbox/


 Code
 jQuery.fn.checkbox = function (opt) {

 $([EMAIL PROTECTED]'checkbox'], this).each( function () {

 var img = document.createElement(img);
 img.src = this.checked ? opt.checked : opt.unchecked;

 $(img).click( function() {

 var input = this.nextSibling;
 if ( input.checked ) {
 this.src = opt.unchecked;
 input.checked = ;
 }
 else {
 this.src = opt.checked;
 input.checked = checked;
 }
 });

 $(this).parent().prepend(img)
 $(this).hide();
 });
 }


 Usage
 $(document).ready( function () {
 $().checkbox({checked: accept.png, unchecked: cancel.png});
 });
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 

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


[jQuery] Checkbox Utilities

2006-08-15 Thread Rob D
Hello Everyone,

Re post Simple checkbox replacement... Very nice indeed, well done Kawika.

Here is my first attempt at writing some simple generic utilities for 
chechboxes, the first one makes a group of checkboxes operate like radio 
buttons and the second is simply a check/uncheck all checkboxes in a 
group (thanks to Mike Alsup for the inspiration here).

I would appreciate any improvements and suggestions.

I think it would be nice to have a collection of useful utilities like 
these in the forms plugin or perhaps a form utilities plugin etc.

Keep up the great work everyone.

Rob

Code:

$.radioCheckboxGroup = function(element) {

   var x= $('[EMAIL PROTECTED]' + element + ']');

   x.click(function() {

   x.each(function() {

   this.checked = false;
   });

   this.checked = true;
   });

}

$.selectDeselectAll = function(ctrl,element) {

   $('[EMAIL PROTECTED]' + ctrl + ']').click(function() {

   var x = this.checked;

   $('[EMAIL PROTECTED]' + element + ']').each(function() {

   this.checked = x;
   });
   });

}

Usage:

$(document).ready(function() {

   $.radioCheckboxGroup('stuff');

   $.selectDeselectAll('removeAll','remove[]');

});



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