Re: [jQuery] how to detect if file exist or not

2007-03-26 Thread James Thomas

You cannot check this; it would be a huge security breach if you could. You
can write some server-side script (ASP, ASPX, PHP, Ruby, etc) so verify this
and have them send whatever response you'd like to the browser.



passenger wrote:
> 
> i wonder if someone could help a little. is there a way i can check if
> file with a given name actually exist on server with jQuery or maybe with
> plain javascript?
> thank you in advance
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-detect-if-file-exist-or-not-tf3467982.html#a9681274
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] NOTICE: Moving to Google Groups

2007-03-22 Thread James Thomas

You just need a google account, not a gmail address - and you can create your
google account with any email address you like (I use my Comcast one).


Jason Levine wrote:
> 
> I hope the Nabble interface sticks around also.  Not so much because I
> dislike Google's interface (I don't), but because Google is forcing me to
> use my GMail address to post.  I try to keep that address private (only
> friends and family) to reduce spam.  I use my Yahoo address here and on
> every public group I belong to.  (I've had the Yahoo address since Yahoo
> first offered Webmail so I'm used to a ton of Spam coming in there.)
> 
> Anyone know how I can stay signed into GMail yet post under a different
> e-mail address in Google Groups?
> 

-- 
View this message in context: 
http://www.nabble.com/NOTICE%3A-Moving-to-Google-Groups-tf3440797.html#a9621821
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] confirm link

2007-03-06 Thread James Thomas

That's true - I didn't change it because I thought there could be some cases
where alertSave() could be called outside of the 'a' thing - if that's not
the case, then this version is definitely better. You could go so far as to
eliminate the variable as well and just do:
if ($('#changedAppointments').attr("value").length > 0) { return
confirm(); }

Since you don't use dataControl more than the one time, there's really
little need for it.

James


Sam Collett wrote:
> 
> On 05/03/07, James Thomas <[EMAIL PROTECTED]> wrote:
>>
>> Close ... try this:
>>
>> $("a").click(function(){return alertSave($(this).attr("href"));});
>>
>> function alertSave(url) {
>> var dataControl = $('#changedAppointments').attr("value");
>> if (dataControl.length > 0) {
>> if (confirm("You have made changes to this date which
>> have not been
>> saved.\n\nAre you sure you want to navigate from this page?")) {
>> document.location = url;
>> return true;
>> } else return false;
>> }
>> }
> 
> Or an even shorter way:
> 
> $("a").click(alertSave);
> 
> function alertSave() {
>  var dataControl = $('#changedAppointments').attr("value");
>  if (dataControl.length > 0) {
>  return confirm("You have made changes to this date 
> which have
> not been  saved.\n\nAre you sure you want to navigate from this
> page?");
>  }
> }
> 
> 
>>
>>
>> smeranda wrote:
>> >
>> > Still no luck, this is what I have:
>> >
>> > $("a").click(function(){alertSave($(this).attr("href"));});
>> >
>> > function alertSave(url) {
>> >   var dataControl = $('#changedAppointments').attr("value");
>> >   if (dataControl.length > 0) {
>> >   if (confirm("You have made changes to this date which
>> have not been
>> > saved.\n\nAre you sure you want to navigate from this page?")) {
>> >   document.location = url;
>> >   } else return false;
>> >   }
>> > }
>> >
>> >
>> >
>> > James Thomas wrote:
>> >>
>> >> You need to return false if you don't want something to happen. so if
>> >> (confirm('whatever')) { do_whatever(); } else return false;
>> >>
>> >> smeranda wrote:
>> >>>
>> >>> When a user clicks a link and a form field currently has data, a
>> >>> confirmation box appears. This is close to working, but if a user
>> clicks
>> >>> 'cancel' the browser still redirects to the a href URL. What am I
>> doing
>> >>> wrong?
>> >>>
>> >>> $("a").click(function(){alertSave($(this).attr("href"));});
>> >>>
>> >>> function alertSave(url) {
>> >>> var dataControl = $('#changedAppointments').attr("value");
>> >>> if (dataControl.length > 0) {
>> >>> if (confirm("You have made changes to this date which
>> have not been
>> >>> saved.\n\nAre you sure you want to navigate from this page?")) {
>> >>> document.location = url;
>> >>> }
>> >>> }
>> >>> }
>> >>>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/confirm-link-tf3350646.html#a9320032
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>>
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/confirm-link-tf3350646.html#a9335673
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] confirm link

2007-03-05 Thread James Thomas

Close ... try this:

$("a").click(function(){return alertSave($(this).attr("href"));});

function alertSave(url) {
var dataControl = $('#changedAppointments').attr("value");
if (dataControl.length > 0) {
if (confirm("You have made changes to this date which have not 
been
saved.\n\nAre you sure you want to navigate from this page?")) {
document.location = url;
return true;
} else return false;
}
}


smeranda wrote:
> 
> Still no luck, this is what I have:
> 
> $("a").click(function(){alertSave($(this).attr("href"));});
> 
> function alertSave(url) {
>   var dataControl = $('#changedAppointments').attr("value");
>   if (dataControl.length > 0) {
>   if (confirm("You have made changes to this date which have not 
> been
> saved.\n\nAre you sure you want to navigate from this page?")) {
>   document.location = url;
>   } else return false;
>   }
> }
> 
> 
> 
> James Thomas wrote:
>> 
>> You need to return false if you don't want something to happen. so if
>> (confirm('whatever')) { do_whatever(); } else return false;
>> 
>> smeranda wrote:
>>> 
>>> When a user clicks a link and a form field currently has data, a
>>> confirmation box appears. This is close to working, but if a user clicks
>>> 'cancel' the browser still redirects to the a href URL. What am I doing
>>> wrong?
>>> 
>>> $("a").click(function(){alertSave($(this).attr("href"));});
>>> 
>>> function alertSave(url) {
>>> var dataControl = $('#changedAppointments').attr("value");
>>> if (dataControl.length > 0) {
>>> if (confirm("You have made changes to this date which have not 
>>> been
>>> saved.\n\nAre you sure you want to navigate from this page?")) {
>>> document.location = url;
>>> }
>>> }
>>> }
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/confirm-link-tf3350646.html#a9320032
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] confirm link

2007-03-05 Thread James Thomas

You need to return false if you don't want something to happen. so if
(confirm('whatever')) { do_whatever(); } else return false;

smeranda wrote:
> 
> When a user clicks a link and a form field currently has data, a
> confirmation box appears. This is close to working, but if a user clicks
> 'cancel' the browser still redirects to the a href URL. What am I doing
> wrong?
> 
> $("a").click(function(){alertSave($(this).attr("href"));});
> 
> function alertSave(url) {
>   var dataControl = $('#changedAppointments').attr("value");
>   if (dataControl.length > 0) {
>   if (confirm("You have made changes to this date which have not 
> been
> saved.\n\nAre you sure you want to navigate from this page?")) {
>   document.location = url;
>   }
>   }
> }
> 

-- 
View this message in context: 
http://www.nabble.com/confirm-link-tf3350646.html#a9318730
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] easy way to get checkbox state from within a DIV

2007-02-20 Thread James Thomas

Something like this would work I think:

var dbox = $('#');

var cbox = $(':checkbox', dbox); // This should be the checkbox.

I don't know if you can do it like this or not as I've never tried:
var cbox = $(':checkbox', $('#'));

In either case, I prefer the two lines as I think it's more readable.

James



dalvarado wrote:
> 
> Hi,
> 
> I'm sure there's a shorthand way to do this.  I'm trying to get the
> checked state of a checkbox, the only one, within a particular DIV.  I
> would prefer not to use the ID of the checkbox but some more generic way
> of referring to the only checkbox within the DIV, id=dToDo1.  I am fine to
> use the ID of the DIV in the shorthand expression.  Here's how the HTML
> looks:
> 
> 
> 
> 
>   
>   Wake
> Up
>#  images/edit.gif  
>javascript:toggleDiv('dToDo1');  
> images/deleteLink.gif 
> 
> 
> 
> 
> 
> Thanks for your help, - Dave
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/easy-way-to-get-checkbox-state-from-within-a-DIV-tf3262967.html#a9069810
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Closing a thickbox from within an iframe

2007-02-13 Thread James Thomas

Sure - I just recently asked the same question and the method to do this is:

$(frameElement); // The iframe itself
$(frameElement.parentNode); // This is the div tag containing the iframe


mmch wrote:
> 
> Is it possible to be able to close an iframe from within itself?
> 
> I am using an iframe thickbox to upload an image.  I would like to be able
> to close the iframe/thickbox and refresh the page when the script
> completes.
> 
> Anyone got any ideas?
> 
> Thanks
> 
> Marc
> 

-- 
View this message in context: 
http://www.nabble.com/Closing-a-thickbox-from-within-an-iframe-tf3220577.html#a8948409
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Right Click Plugin / Function

2007-02-12 Thread James Thomas

This is what I use to show a custom menu on right click. I tried the way
first mentioned by Dan but it doesn't work with some mouse drivers and mouse
button configurations (users were reporting errors, which took us a while to
track down to the code showed by Dan. One of our client's mouse drivers
reported 11 as the ID for the left click and 12 for right click, so we had
to find a better way.




petersom3000 wrote:
> 
> Is there a reason for not using the oncontextmenu event?
> http://www.google.com/search?q=oncontextmenu
> 
> 
> Dan Atkinson wrote:
>> 
>> Feel free to jQuerify this:
>> 
>> function click(e)
>> {
>> if (document.all)
>>   {
>> if (event.button==2||event.button==3)
>> ...etc
>> 
>> It's pretty much just a right click disabler which won't allow right
>> clicking in Firefox.
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Right-Click-Plugin---Function-tf3043202.html#a8927273
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] asp.net and jquery

2007-02-10 Thread James Thomas

Not a mailing list but they have pretty active forums at www.asp.net.

I don't use it very often though so I don't know if it's still any good or
not.


Rick Faircloth wrote:
> 
> That's just sad. hard to believe there aren't any
> good mailing lists for ASP.NET.
>  
> Thanks for the info.
>  
> Rick
>  
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Benjamin Sterling
> Sent: Friday, February 09, 2007 10:39 PM
> To: jQuery Discussion.
> Subject: Re: [jQuery] asp.net and jquery
>  
> Rick,
> Sadly, the only one I knew shut down about 6 months ago, they were geared
> toward asp more, but had some people with good asp.net knowledge.  I find
> that there are not a lot of good supporting sites out there for asp,
> asp.net, and coldfusion.  But this is just my opinion.
> 
> But to answer your question, I don't know of any good supportive sites.
> 
> 
> -- 
> Benjamin Sterling
> http://www.KenzoMedia.com
> http://www.KenzoHosting.com 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/asp.net-and-jquery-tf3203080.html#a8905079
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] asp.net and jquery

2007-02-09 Thread James Thomas

I use ASP .NET 2.0 and C# and I really like both. I like C# a lot. Anyway, I
am also using jQuery (though I recently only discovered it a month ago) so
it's not on our live web applications. I'm also using it with an AJAX
library for ASP .NET called zumiPage. They all work very well together. In
fact, I was able to use jQuery and my custom version of Thickbox to make my
application work on Firefox as well (the old windowing library we were using
didn't work with FF).

I've even experimented (though not using extensively as I don't really want
to re-architect everything) with pure AJAX and using custom HTTP handlers in
ASP .NET to generate the JSON response - and this I find extremely easy and
elegant as well.

James



Kevin Fricovsky wrote:
> 
> 
> Just curious how many asp.net developers are out there using jquery?
> 
> I've been seeing a lot of .aspx extension on links to examples (like the
> link below)
> 
> Good to see.
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Rick Faircloth
> Sent: Friday, February 09, 2007 2:57 PM
> To: 'jQuery Discussion.'
> Subject: Re: [jQuery] jQuery Powered Sites - Keep the Links Coming
> 
> The table sorter is really nice... first time I've seen it
> in action...
> 
> Rick
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Rey Bango
> Sent: Friday, February 09, 2007 10:47 AM
> To: jQuery Discussion.
> Subject: Re: [jQuery] jQuery Powered Sites - Keep the Links Coming
> 
> Added! Thanks for the heads up, Christian.
> 
> Rey
> 
> Christian Bach wrote:
>> http://threestore.three.co.uk/priceplan.aspx
>> 
>> Uses tablesorter and jQuery, perhaps a bit self promotion :)
>> 
>> /christian
> 
> 
> 
> 
> ___
> 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/asp.net-and-jquery-tf3203080.html#a8896595
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Finding parent iframe?

2007-02-09 Thread James Thomas

Yeah, I was inside the iframe - sorry, I forgot to point that out! I very
much appreciate your solution - it is much simpler and very concise. Hard to
believe I spent 3 hours on it when the solution was only two lines of code!
Very cool. Again, thanks a billion!

Michael Geary wrote:
> 
>> I was able to take what you sent me and simplify it down to this:
>> 
>>  var frameWindow = document.parentWindow || document.defaultView;
>>  var outerDiv = $(frameWindow.frameElement.parentNode); 
>>  cls = $('div.tb_close', outerDiv).get(0);
>> 
>> Because I actually want to operate on a child of the outer 
>> div (which I didn't specify as it wasn't relevant). And I 
>> figured out that I could use document because when I am 
>> executing the javascript, I don't need the link, merely the 
>> link's document, and document is what I need. Works in both 
>> FF and IE as well.
> 
> It sounds like your code is actually running inside the IFRAME, is that
> correct? It sounded like you only had a reference to an element inside the
> iframe, thus the ownerDocument/parentWindow/defaultView stuff to find the
> frame window.
> 
> But if your code is running in the IFRAME, then "window" is already the
> frame window. So you can simplify even further:
> 
>  var outerDiv = $(frameElement.parentNode); 
>  cls = $('div.tb_close', outerDiv).get(0);
> 
> -Mike
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8891503
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Finding parent iframe?

2007-02-09 Thread James Thomas

So I was. This is perfect, thanks!

I was able to take what you sent me and simplify it down to this:

var frameWindow = document.parentWindow || document.defaultView;
var outerDiv = $(frameWindow.frameElement.parentNode); 
cls = $('div.tb_close', outerDiv).get(0);

Because I actually want to operate on a child of the outer div (which I
didn't specify as it wasn't relevant). And I figured out that I could use
document because when I am executing the javascript, I don't need the link,
merely the link's document, and document is what I need. Works in both FF
and IE as well.

Thanks a million for putting me on the right path! I worked for a couple of
hours on this before I asked; should have asked sooner! :)

James



Michael Geary wrote:
> 
> You're mixing up two different kinds of "parents" - parent *node/element*
> and parent *window*.
> 
> Assuming that anyTag is a valid reference to your , then this
> code
> should work (it's based on tested code that I use):
> 
>   var frameDoc = anyTag.ownerDocument;
>   var frameWindow = frameDoc.parentWindow || frameDoc.defaultView;
>   var frameElement = frameWindow.frameElement;
>   var outerDiv = frameElement.parentNode;
> 
> -Mike
> 

-- 
View this message in context: 
http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8890917
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Finding parent iframe?

2007-02-09 Thread James Thomas

The only issue here is that from within the iframe itself, I do not know the
name of the containing div tag.


Jonathan Sharp wrote:
> 
> Hi James,
> 
> When running code inside of an iframe it has it's own window object. So
> you'll need to do something like this:
> 
> 
> 
> // Code on iframes page
> $('#foo', window.parent).hide();
> 
> -js
> 
> 
> 
> On 2/9/07, James Thomas <[EMAIL PROTECTED]> wrote:
>>
>>
>> I have a quandary. I open an iframe with some arbitrary content in it. I
>> want
>> to be able to click on something within the iframe to cause the iframe
>> (and
>> the div tag that contains the iframe) to go away. I am having trouble
>> getting to the iframe. I know it's possible as I've seen it elsewhere, I
>> just can't find the proper path to it.
>>
>> I basically have this structure:
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 
>>
>> It's not exactly accurate but it gives a good idea what I'm looking to do
>>
>> I've tried:
>>
>> // This should as far as I can get to the div tag which is where I want
>> to
>> be
>> $('#any tag').parents('html').parent().parent();
>>
>> But when I alert the length of this, I get 0. I've also tried a pure DOM
>> way
>> any_tag.ownerDocument.parent.parent.parent
>> but again, I get nothing.
>>
>> Firebug tells me I should get something as it displays my whole
>> hierarchy,
>> which is as follows:
>> input.#img < div < td < tr < tbody < table < div.rdgrey < form#Form1 <
>> body
>> < html < iframe < div < body < html
>> and when I alert
>> $('input#img').parents('html').length
>> I get one so I know it's getting this far.
>>
>> Any thoughts?
>>
>> Thanks,
>>
>> James
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8889892
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>>
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8890856
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Finding parent iframe?

2007-02-09 Thread James Thomas

They are both in the same domain - both running locally actually.


Nathan Young -X (natyoung - Artizen at Cisco) wrote:
> 
> Are the parent document and the iframe document in the same domain?  If
> they are coming from different servers you would kit browser security
> restrictions with this.
> 
> --->N
> 
> 
> 
> .:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:
> ||:.
> 
> Nathan Young
> Cisco.com->Interface Development
> A: ncy1717
> E: [EMAIL PROTECTED]  
> 
>> -Original Message-
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On Behalf Of James Thomas
>> Sent: Friday, February 09, 2007 9:27 AM
>> To: discuss@jquery.com
>> Subject: [jQuery] Finding parent iframe?
>> 
>> 
>> I have a quandary. I open an iframe with some arbitrary 
>> content in it. I want
>> to be able to click on something within the iframe to cause 
>> the iframe (and
>> the div tag that contains the iframe) to go away. I am having trouble
>> getting to the iframe. I know it's possible as I've seen it 
>> elsewhere, I
>> just can't find the proper path to it.
>> 
>> I basically have this structure:
>> 
>> 
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>> 
>> 
>> It's not exactly accurate but it gives a good idea what I'm 
>> looking to do
>> 
>> I've tried:
>> 
>> // This should as far as I can get to the div tag which is 
>> where I want to
>> be
>> $('#any tag').parents('html').parent().parent();
>> 
>> But when I alert the length of this, I get 0. I've also tried 
>> a pure DOM way
>> any_tag.ownerDocument.parent.parent.parent
>> but again, I get nothing.
>> 
>> Firebug tells me I should get something as it displays my 
>> whole hierarchy,
>> which is as follows:
>> input.#img < div < td < tr < tbody < table < div.rdgrey < 
>> form#Form1 < body
>> < html < iframe < div < body < html
>> and when I alert
>> $('input#img').parents('html').length
>> I get one so I know it's getting this far.
>> 
>> Any thoughts?
>> 
>> Thanks,
>> 
>> James
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8889892
>> Sent from the JQuery mailing list archive at Nabble.com.
>> 
>> 
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8890471
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] difference in trigger and bind on checkbox click

2007-02-09 Thread James Thomas

I think this is probably because clicking on the checkbox actually causes a
change in the state of the checkbox and then the click event is called,
whereas all you're doing is calling the click event when you use trigger.


Andreas Wahlin-4 wrote:
> 
> I bind a click event to a checkbox and check it's checked status  
> (with this.checked).
> The problem is that the checked status is different depending on  
> whether the trigger comes from an actual click on the element from  
> the user, or if I trigger it programatically with trigger. Anyone  
> solved this?
> 
> sample code
> 
> $(checkbox).bind('click', function() {
>alert(this.checked); // different if user clicks or if I use $ 
> (checkbox).trigger('click')
> });
> 
> 
> andreas
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/difference-in-trigger-and-bind-on-checkbox-click-tf3201534.html#a8889945
Sent from the JQuery mailing list archive at Nabble.com.


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


[jQuery] Finding parent iframe?

2007-02-09 Thread James Thomas

I have a quandary. I open an iframe with some arbitrary content in it. I want
to be able to click on something within the iframe to cause the iframe (and
the div tag that contains the iframe) to go away. I am having trouble
getting to the iframe. I know it's possible as I've seen it elsewhere, I
just can't find the proper path to it.

I basically have this structure:















It's not exactly accurate but it gives a good idea what I'm looking to do

I've tried:

// This should as far as I can get to the div tag which is where I want to
be
$('#any tag').parents('html').parent().parent();

But when I alert the length of this, I get 0. I've also tried a pure DOM way
any_tag.ownerDocument.parent.parent.parent
but again, I get nothing.

Firebug tells me I should get something as it displays my whole hierarchy,
which is as follows:
input.#img < div < td < tr < tbody < table < div.rdgrey < form#Form1 < body
< html < iframe < div < body < html
and when I alert
$('input#img').parents('html').length
I get one so I know it's getting this far.

Any thoughts?

Thanks,

James




-- 
View this message in context: 
http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8889892
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Search term table row highlighting best practice

2007-02-08 Thread James Thomas

Probably could but there comes a time when too much terseness is a bad thing
(a little can go a long way, as in your original example!). That to me is
one of the key things to figure out when programming - how terse can I be
vs. how terse should I be. :) Though I must say, that is powerful! Any
difference in speed of execution? I am going to have to go back to my jQuery
code from a few weeks ago when I discovered it and revamp some of the things
I've done since!



Karl Swedberg-2 wrote:
> 
> Thanks. :)  Yeah, selectors are a kind of hobby for me. Sad, I know.
> 
> Anyway, I'm thinking we can make it even more terse this way:
> 
> $('tr[td:contains("term")]').addClass('foo');
> 
> Cheers,
> Karl
> 
> On Feb 8, 2007, at 2:38 PM, James Thomas wrote:
> 
>>
>> Wow, that is terse! I like it. I really need to get better at  
>> selectors as
>> that wouldn't have occurred to me. Nice.
>>
>> James
>>
>>
>> Karl Swedberg-2 wrote:
>>>
>>> Hi Graeme,
>>>
>>> Try something like this:
>>>
>>> $('td:contains("term")').parent().addClass('foo');
>>>
>>>
>>> --Karl
>>> _
>>> Karl Swedberg
>>> www.englishrules.com
>>> www.learningjquery.com
>>>
>>>
>>>
>>> On Feb 8, 2007, at 1:16 PM, Graeme B. Davis wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm looking to highlight 1 or more rows of a table which have a
>>>> cell whose contents match a search term I provide.  Does anyone
>>>> have an easy way to do this?
>>>>
>>>> Thanks!
>>>>
>>>> Graeme
>>>> ___
>>>> 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/Search-term- 
>> table-row-highlighting-best-practice-tf3194998.html#a8872600
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Search-term-table-row-highlighting-best-practice-tf3194998.html#a8874715
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Search term table row highlighting best practice

2007-02-08 Thread James Thomas

Wow, that is terse! I like it. I really need to get better at selectors as
that wouldn't have occurred to me. Nice.

James


Karl Swedberg-2 wrote:
> 
> Hi Graeme,
> 
> Try something like this:
> 
> $('td:contains("term")').parent().addClass('foo');
> 
> 
> --Karl
> _
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
> 
> 
> 
> On Feb 8, 2007, at 1:16 PM, Graeme B. Davis wrote:
> 
>> Hello,
>>
>> I'm looking to highlight 1 or more rows of a table which have a  
>> cell whose contents match a search term I provide.  Does anyone  
>> have an easy way to do this?
>>
>> Thanks!
>>
>> Graeme
>> ___
>> 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/Search-term-table-row-highlighting-best-practice-tf3194998.html#a8872600
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] click-event and keyCode

2007-02-08 Thread James Thomas

I thought he was fairly straightforward in describing the solution (which is
nice by the way!).

var CtrlPressed = false;

// Do these in $(document).ready() method
$(document).keydown(function() { CtrlPressed = true; });
$(document).keyup(function() { CtrlPressed = false; });

In your click event, just do:

if (CtrlPressed == true)
{
   // Do whatever
} else { 
  // Do whatever else
}

Completely untested but that should be enough to get you going.



Stefan Kilp [sk-software] wrote:
> 
> Hi,
> 
> do you have any sample code for me?
> 
> thanks
> stefan
> 
>> I have done it several times already in fact.
>> 
>> What you have to do is add another global keydown event to the
>> document, in which you then have to check for e.ctrlKey and save the
>> boolean to a scoped variable your click event can access.
>> Now add another keyup event, were you set your boolean to false again.
>> That's it.
>> 
>> Paul
>> 
>> 2007/2/8, Stefan Kilp [sk-software] <[EMAIL PROTECTED]>:
>> > hi,
>> >
>> > is it possible to distinguish between a click with or without a
>> ctrl/alt key pressed.
>> >
>> >
>> > i want to simulate "selecting items" with Ctrl+click and click only to
>> execute an action.
>> >
>> >
>> > $("p").bind("click", function() {
>> >
>> > // how to find out what keys where pressed
>> > if (ctrl-pressed) {
>> > start select action
>> > }
>> > else {
>> > start normal action
>> > }
>> > })
>> >
>> >
>> > thanks
>> > stefan
>> >
>> >
>> >
>> >
>> >
>> > --
>> > Stefan Kilp
>> > SK-Software, Entwicklung & Beratung
>> >
>> > email: [EMAIL PROTECTED]
>> >
>> > fon  : +49 6151 93344-0
>> > fax  : +49 6151 93344-20
>> > Herta-Mansbacher-Str. 98
>> > 64289 Darmstadt, Germany.
>> > -
>> >
>> >
>> > ___
>> > jQuery mailing list
>> > discuss@jquery.com
>> > http://jquery.com/discuss/
>> >
>> 
>> 
>> -- 
>> --
>> Paul Bakaus
>> 
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
> 
> 
> --
> Stefan Kilp
> SK-Software, Entwicklung & Beratung
> 
> email: [EMAIL PROTECTED]
> 
> fon  : +49 6151 93344-0
> fax  : +49 6151 93344-20
> Herta-Mansbacher-Str. 98
> 64289 Darmstadt, Germany.
> -
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/click-event-and-keyCode-tf3193539.html#a8872542
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Bug Fix: Animation Flickers

2007-02-05 Thread James Thomas

I am having the animation flicker problem - how do I get it from SVN such
that I don't have to build it? I didn't notice before because I wasn't using
FF until two days ago when the decision was made to support FF in addition
to IE (what a lot of work that is!).

James




Brandon Aaron wrote:
> 
> I just checked in a fix for the flickers that have been happening in
> the fx module. Anyone that was having problems with flickers in their
> animations (mostly in Firefox) please grab the latest from SVN and let
> me know if it solves your problems or not.
> 
> --
> Brandon Aaron
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Bug-Fix%3A-Animation-Flickers-tf3149590.html#a8818196
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Thickbox modifications

2007-02-03 Thread James Thomas

Hey Brice -

I took a look at jqModal actually and I like it for modal windows - was
thinking of using it actually. One of my key requirements is that it had to
sometimes use an iframe, sometimes ajax, and sometimes DOM. I was already
using Thickbox here and there and decided it would be a good place to start.
So I sat down over the course of a couple of hours and changed it to work
the way I needed. I didn't like the query string method it had for settings
(plus it was unnecessarily IMO tied to a URL) so I molded it to work this
way.

As for dialog boxes, jqModal is really rather nice actually - I think you've
done a great job with it and I may use it for simple yes/no type things
where a small solution is required (normally I just hack together a div tag
and show() it but this is nice too (plus it can replace confirm, which is
very annoying because it says OK and Cancel (whoever thought of that?).

James



Brice Burgess wrote:
> 
> James Thomas wrote:
>> Hello everyone,
>>
>> I've made some modifications to Thickbox mostly to make it suit my needs
>> and
>> to make it more flexible:
>> - I removed the method of passing configuration options to Thickbox and
>> replaced it with a settings as follows:
>>  Thickbox.Show(
>>  {
>>  target : 'http://www.yahoo.com',
>>  title : 'Yahoo!',
>>  height : 305,
>>  ShowClose : false
>>  }
>>  );
>> - I added several options and plan to add a few more.
>>
>> You can find the source  http://www.lossfree.com/tbox.js?format=txt here
>> .
>> Please suggest anything you think I can do to improve it. One of my more
>> immediate plans is to make it so that it can support multiple boxes on
>> the
>> screen at once, which should be interesting ... :)
>>   
> James,
> 
>   You may be interested in jqModal -- it supports multiple windows out 
> of the box && is dying to be extended. 
> http://dev.iceburg.net/jquery/jqModal/  . I do like where you're going 
> with the TB changes! :) There would be no jqModal is TB was truly the 
> "one box to rule them all"...
> 
> ~ Brice
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Thickbox-modifications-tf3164553.html#a8786734
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Thickbox modifications

2007-02-02 Thread James Thomas

Forgot to mention that I also removed all the image stuff as we didn't have
any need for it and I didn't want to clutter up the code. The size is 6kb
but I'll be removing many of the comments on the live version (and probably
compress it too) to make it much smaller).



James Thomas wrote:
> 
> Hello everyone,
> 
> I've made some modifications to Thickbox mostly to make it suit my needs
> and to make it more flexible:
> - I removed the method of passing configuration options to Thickbox and
> replaced it with a settings as follows:
>   Thickbox.Show(
>   {
>   target : 'http://www.yahoo.com',
>   title : 'Yahoo!',
>   height : 305,
>   ShowClose : false
>   }
>   );
> - I added several options and plan to add a few more.
> 
> You can find the source  http://www.lossfree.com/tbox.js?format=txt here .
> Please suggest anything you think I can do to improve it. One of my more
> immediate plans is to make it so that it can support multiple boxes on the
> screen at once, which should be interesting ... :)
> 
> Thanks,
> 
> James
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Thickbox-modifications-tf3164553.html#a8778749
Sent from the JQuery mailing list archive at Nabble.com.


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


[jQuery] Thickbox modifications

2007-02-02 Thread James Thomas

Hello everyone,

I've made some modifications to Thickbox mostly to make it suit my needs and
to make it more flexible:
- I removed the method of passing configuration options to Thickbox and
replaced it with a settings as follows:
Thickbox.Show(
{
target : 'http://www.yahoo.com',
title : 'Yahoo!',
height : 305,
ShowClose : false
}
);
- I added several options and plan to add a few more.

You can find the source  http://www.lossfree.com/tbox.js?format=txt here .
Please suggest anything you think I can do to improve it. One of my more
immediate plans is to make it so that it can support multiple boxes on the
screen at once, which should be interesting ... :)

Thanks,

James

-- 
View this message in context: 
http://www.nabble.com/Thickbox-modifications-tf3164553.html#a8778733
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Interface Tooltip problem

2007-01-30 Thread James Thomas

Thanks Karl - that did the trick. I made some changes mostly to suit my needs
(for example, don't need the arrows so I took them out and adjusted the size
accordingly).

At any rate, this is a very nice plugin. Anyone know of any possibility of
including setting parameters instead of using query strings? I might take
that on as an exercise (it doesn't look as if it'd be too hard).


Karl Swedberg-2 wrote:
> 
> Hi James,
> 
> I ran into these problems with Cody Lindley's jTip plugin, too, so I  
> (and Rey Bango) made a few changes to it.
> 
> It's not terribly pretty, but that can be remedied with CSS / images.  
> Also, if I had time to work on it some more, I would clean up the  
> code a bit.
> 
> So, with those caveats out of the way, here are a couple links:
> 
> Blog Entry: http://www.learningjquery.com/2006/10/updated-plugin-jtip
> Demo: http://test.learningjquery.com/jtiptest.htm
> 
> 
> 
> --Karl
> _
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
> 
> 
> 
> On Jan 30, 2007, at 2:46 PM, James Thomas wrote:
> 
>>
>> Unfortunately, the same thing happens with this one.
>>
>> I modified it to support loading by ajax as follows:
>> 1. Added a setting for showAjax
>> 2. Using the same tip attribute I added to the item, I added the  
>> following
>> code in save()
>>  if (settings.showAjax) {
>>  var jUrl = source.attr('tip');
>>
>>  tBody.empty();
>>  tBody.load(jUrl);
>>  tTitle.html(title);
>>  
>>  if (tBody.html())
>>  tBody.show();
>>  else
>>  tBody.hide();
>>  } else  
>>
>> I added this code right above the if(settings.showBody)
>>
>> Then in my tooltip declaration, I do:
>>
>>  $('img.help').Tooltip(
>>  {
>>  delay: 250,
>>      track: true,
>>  showAjax: true,
>>  showURL: false
>>  }
>>  );
>>
>> When I hover over the image, it goes off and up. Any idea why?
>>
>>
>> Sam Collett wrote:
>>>
>>> On 30/01/07, James Thomas <[EMAIL PROTECTED]> wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I am looking for a good tooltip library. I like the look and feel  
>>>> of the
>>>> Interface one but there's a big problem with it - when I hover over
>>>> something on say the right edge of the screen where I want the  
>>>> tooltip to
>>>> appear, most of it goes off the edge of the screen. The same is  
>>>> true if
>>>> it's
>>>> on the left of the screen and the position is set to left.
>>>>
>>>> Any thoughts on how it can be fixed?
>>>>
>>>> Also, I made a small modification to the tooltip that enabled it  
>>>> to load
>>>> external ajax content - my solution here was to add my own  
>>>> attribute to
>>>> whatever fields I want to display a tooltip called tip and then  
>>>> just do
>>>> (inside the show() method):
>>>>
>>>> url = jEl.attr('tip');
>>>>
>>>> if (url) $('#tooltipURL').load(url); right before the href part  
>>>> within
>>>> the
>>>> if (title) codeblock. I put it here because I want all of my  
>>>> tooltips to
>>>> have a title associated with them. Thoughts on any better way to  
>>>> do this?
>>>> --
>>>
>>> Have you tried this one:
>>> http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
>>>
>>> ___
>>> jQuery mailing list
>>> discuss@jquery.com
>>> http://jquery.com/discuss/
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/Interface- 
>> Tooltip-problem-tf3139669.html#a8716457
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Interface-Tooltip-problem-tf3139669.html#a8719338
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Interface Tooltip problem

2007-01-30 Thread James Thomas

I forgot to add that I'm doing this in IE 7 - and I checked it in FF 2 and
the behavior was similar.


James Thomas wrote:
> 
> Unfortunately, the same thing happens with this one. 
> 
> I modified it to support loading by ajax as follows:
> 1. Added a setting for showAjax
> 2. Using the same tip attribute I added to the item, I added the following
> code in save()
>   if (settings.showAjax) {
>   var jUrl = source.attr('tip');
> 
>   tBody.empty();
>   tBody.load(jUrl);
>   tTitle.html(title);
>   
>   if (tBody.html())
>   tBody.show();
>   else
>   tBody.hide();
>   } else  
> 
> I added this code right above the if(settings.showBody)
> 
> Then in my tooltip declaration, I do:
> 
>   $('img.help').Tooltip(
>   {
>   delay: 250,
>   track: true,
>   showAjax: true,
>   showURL: false
>   }
>   );
> 
> When I hover over the image, it goes off and up. Any idea why?
> 
> 
> Sam Collett wrote:
>> 
>> On 30/01/07, James Thomas <[EMAIL PROTECTED]> wrote:
>>>
>>> Hello all,
>>>
>>> I am looking for a good tooltip library. I like the look and feel of the
>>> Interface one but there's a big problem with it - when I hover over
>>> something on say the right edge of the screen where I want the tooltip
>>> to
>>> appear, most of it goes off the edge of the screen. The same is true if
>>> it's
>>> on the left of the screen and the position is set to left.
>>>
>>> Any thoughts on how it can be fixed?
>>>
>>> Also, I made a small modification to the tooltip that enabled it to load
>>> external ajax content - my solution here was to add my own attribute to
>>> whatever fields I want to display a tooltip called tip and then just do
>>> (inside the show() method):
>>>
>>> url = jEl.attr('tip');
>>>
>>> if (url) $('#tooltipURL').load(url); right before the href part within
>>> the
>>> if (title) codeblock. I put it here because I want all of my tooltips to
>>> have a title associated with them. Thoughts on any better way to do
>>> this?
>>> --
>> 
>> Have you tried this one:
>> http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
>> 
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Interface-Tooltip-problem-tf3139669.html#a8716636
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Interface Tooltip problem

2007-01-30 Thread James Thomas

Unfortunately, the same thing happens with this one. 

I modified it to support loading by ajax as follows:
1. Added a setting for showAjax
2. Using the same tip attribute I added to the item, I added the following
code in save()
if (settings.showAjax) {
var jUrl = source.attr('tip');

tBody.empty();
tBody.load(jUrl);
tTitle.html(title);

if (tBody.html())
tBody.show();
else
tBody.hide();
} else  

I added this code right above the if(settings.showBody)

Then in my tooltip declaration, I do:

$('img.help').Tooltip(
{
delay: 250,
track: true,
showAjax: true,
showURL: false
}
);

When I hover over the image, it goes off and up. Any idea why?


Sam Collett wrote:
> 
> On 30/01/07, James Thomas <[EMAIL PROTECTED]> wrote:
>>
>> Hello all,
>>
>> I am looking for a good tooltip library. I like the look and feel of the
>> Interface one but there's a big problem with it - when I hover over
>> something on say the right edge of the screen where I want the tooltip to
>> appear, most of it goes off the edge of the screen. The same is true if
>> it's
>> on the left of the screen and the position is set to left.
>>
>> Any thoughts on how it can be fixed?
>>
>> Also, I made a small modification to the tooltip that enabled it to load
>> external ajax content - my solution here was to add my own attribute to
>> whatever fields I want to display a tooltip called tip and then just do
>> (inside the show() method):
>>
>> url = jEl.attr('tip');
>>
>> if (url) $('#tooltipURL').load(url); right before the href part within
>> the
>> if (title) codeblock. I put it here because I want all of my tooltips to
>> have a title associated with them. Thoughts on any better way to do this?
>> --
> 
> Have you tried this one:
> http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Interface-Tooltip-problem-tf3139669.html#a8716457
Sent from the JQuery mailing list archive at Nabble.com.


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


[jQuery] Interface Tooltip problem

2007-01-29 Thread James Thomas

Hello all,

I am looking for a good tooltip library. I like the look and feel of the
Interface one but there's a big problem with it - when I hover over
something on say the right edge of the screen where I want the tooltip to
appear, most of it goes off the edge of the screen. The same is true if it's
on the left of the screen and the position is set to left.

Any thoughts on how it can be fixed?

Also, I made a small modification to the tooltip that enabled it to load
external ajax content - my solution here was to add my own attribute to
whatever fields I want to display a tooltip called tip and then just do
(inside the show() method):

url = jEl.attr('tip');

if (url) $('#tooltipURL').load(url); right before the href part within the
if (title) codeblock. I put it here because I want all of my tooltips to
have a title associated with them. Thoughts on any better way to do this?
-- 
View this message in context: 
http://www.nabble.com/Interface-Tooltip-problem-tf3139669.html#a8702420
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Thickbox incompatible with jQuery 1.1

2007-01-24 Thread James Thomas

This is how the new version of interface works - very nice and I think it
would work great for this too.

[-Stash-] wrote:
> 
> I like this idea but for one point.  If you do want everything, then you
> have 8 bazillion requests back and forth to the server.  Not a problem for
> those of us on broadband, but on Dialup it becomes a a really show stopper
> with all the added latency.
> 
> Some method of bundling up (and compressing if possible, but that's
> secondary) all the necessary JS files into a single download would be
> best.
> 
> Luke
> 
> 
> Sam Collett wrote:
>> 
>> On 24/01/07, Klaus Hartl <[EMAIL PROTECTED]> wrote:
>>> [-Stash-] wrote:
>>> > Unfortunately, it looks like Cody's giving up on ThickBox.  He's put
>>> out a
>>> > request for someone to take it over:
>>> >
>>> http://codylindley.com/thickboxforum/comments.php?DiscussionID=166&page=1#Item_15
>>> >
>>> > Given the improvements Klaus Hartl's already made to ThickBox 2.1, it
>>> would
>>> > be nice if he took it over ;)
>>>
>>> I'd love to do that!
>>>
>>> -- Klaus
>> 
>> We all know you are capable of doing it.
>> 
>> One suggestion though - make it modular. So if you only want to use it
>> for images, you don't download all the things you don't need.
>> 
>> e.g.
>> - Images, inline content - include thickbox.js
>> - Gallery - thickbox.js, thickbox-gallery.js
>> - Ajax: thickbox.js, thickbox-ajax.js
>> - Rich media content (flash, quicktime, pdf's etc) - thickbox.js,
>> thickbox-media.js
>> 
>> and so on.
>> 
>> You could use blockUI for the overlay and bgiframe for rich media.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Thickbox-incompatible-with-jQuery-1.1-tf3063738.html#a8573334
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Frames with JQuery. Possible?

2007-01-24 Thread James Thomas

Well, not a jquery solution but you could just use iframes - no frameset
required that way.

Web Specialist wrote:
> 
> Hi
> 
> anyone have an example using JQuery to "simulate" frames? I'm looking tips
> to avoid html frameset.
> 
> Cheers
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Frames-with-JQuery.-Possible--tf3081099.html#a8563789
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] .size() to test if something exists

2007-01-19 Thread James Thomas

What about if ($('#warningmsg').length > 0) highlightWarningMsg();

This is how I do it - is the array reference faster than checking length? If
so, I'll switch!


Sam Collett wrote:
> 
> On 19/01/07, Peter Bengtsson <[EMAIL PROTECTED]> wrote:
>> Currently my code looks something like this:
>>
>> if ($('#warningmsg').size()) highlightWarningMsg();
>>
>> Is that the "correct" way of testing if a jQuery object contains
>> anything?
>>
>>
>> --
>> Peter Bengtsson,
>> work www.fry-it.com
>> home www.peterbe.com
>> hobby www.issuetrackerproduct.com
> 
> You could also do:
> 
> if ($('#warningmsg')[0])
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/.size%28%29-to-test-if-something-exists-tf3040462.html#a8454297
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Test whether element is undergoing animation?

2007-01-19 Thread James Thomas

Why not use your code to add a css class before animation starts and remove
the css class when it stops? Then you can use selectors to select for all
that contains the css class.


Klaus Hartl wrote:
> 
> Phillip B Oldham wrote:
>> Hi all
>> 
>> I'm doing a sort of accordion effect on some elements. When one element 
>> is clicked to open (eg, element B), i specify that all other :visible 
>> elements should close before opening the clicked element.
>> 
>> This works fine, but the animation is re-set if i re-click element B 
>> before the other elements have finished closing, which give a bit of a 
>> jump effect.
>> 
>> Is there a way I can either "background" these animations, or test to 
>> see if an element is currently being animated?
> 
> I don't know of a way, but a custom (':animate') selector would be 
> really cool for such things maybe... like:
> 
> $(elem).is(':animate')
> 
> Don't know if that's doable at all.
> 
> 
> -- Klaus
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Test-whether-element-is-undergoing-animation--tf3040117.html#a8452984
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] newb question - JQuery fade and replace

2007-01-17 Thread James Thomas

You could use the setTimeout method, giving it enough time to make sure that
the swap finished successfully.




rplobue wrote:
> 
> Im looking for help on how to write a function.  In standard javascript i
> have 2 elements: oldData, and newData.  Currently i just am swapping the
> two with replaceChild.  However i want to add a [fade-out, replace,
> fade-in] sequence to it with JQuery.
> 
> I am wondering is it possible to create a function like this in JQuery and
> simply call it from a standard javascript function:
> 
> JQueryFadeSwap(oldStuff, newStuff){
>  
>   newStuff.opacity = 0;
>   oldStuff.fadeOut();
>   swap(oldStuff, newStuff);
>   newStuff.fadeIn();
> }
> 
> Can someone give me some input on how to accomplish this?  Thanks!
> 
> 

-- 
View this message in context: 
http://www.nabble.com/newb-question---JQuery-fade-and-replace-tf3030628.html#a8420990
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] fadeOut text

2007-01-16 Thread James Thomas

Use  instead of  - that worked for me when I had a similar
problem. 


Vaska wrote:
> 
> I'm trying to write my first jquery function using it's rules...it's  
> hard getting started.
> 
> I want to write a function that is ready at all times for any div's  
> (or perhaps spans's instead) that when they appear they will fade  
> away about ten second later. I'll attach a class to the span called  
> 'notify'...like this...
> 
> Updated
> 
> These are appearing via an ajax call already, so they don't appear  
> when the page originally loads...only after an ajax call has been  
> executed.
> 
> The best I've been able to get so far...no, this doesn't work...I'm  
> hoping somebody can help me move forward with this (my head is  
> spinning here):
> 
> $(document).ready
> (
>  function ()
>  {
>  $('span.notify').fadeOut('slow')
>  }
> );
> 
> I don't care if it simply fades out the text or the entire span...or  
> perhaps even innerHTML's the text to an   (there's another idea)...
> 
> Help! ;)
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/fadeOut-text-tf3021748.html#a8394482
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Trying to show/hide table row...

2007-01-15 Thread James Thomas

Yes, but it just appears, we haven't yet experimented with applying effects.
We have always done this using plain old javascript, like:

TO SHOW:
document.getElementById('trShow').style.display = 'block';

TO HIDE:
document.getElementById('trShow').style.display = 'none';

Could probably use jquery though to do it too:
$('#trShow').css('display', 'none'); // hide
$('#trShow').css('display', 'block'); // show

You can probably simply apply hide() or show() to the items too. Not sure
though about effects as I haven't tried it yet.


Rick Faircloth wrote:
> 
> I would like for a space to open between two rows and for the
> js row to appear between the two... perhaps slide down and slide up.
> 
> Is that what you do?
> 
> Rick
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of James Thomas
> Sent: Monday, January 15, 2007 2:43 PM
> To: discuss@jquery.com
> Subject: Re: [jQuery] Trying to show/hide table row...
> 
> 
> It is possible to hide table rows, though I don't know about hiding them
> with
> animations. We hide them all the time and we just hide and show it - works
> fine. I haven't tried this since I switched to jquery (some of the old JS
> code is still there) but I don't think there'd be any problem here either.
> As I said though, I can't speak to any animations.
> 
> 
> 
> Rick Faircloth wrote:
>> 
>> Is it possible to show and hide a table row as it is a div?
>> 
>> I work mostly with tables / rows / cells rather than div's
>> and I've had a hard time making the code work on tables rows.
>> 
>> Before I get into the code, I just want to make sure there's
>> nothing specific about TR's that make them impossible or more
>> difficult to work with than DIV's when it comes to jQuery.
>> 
>> Rick
>> 
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Trying-to-show-hide-table-row...-tf3016032.html#a83779
> 14
> Sent from the JQuery mailing list archive at Nabble.com.
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Trying-to-show-hide-table-row...-tf3016032.html#a8381059
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Trying to show/hide table row...

2007-01-15 Thread James Thomas

It is possible to hide table rows, though I don't know about hiding them with
animations. We hide them all the time and we just hide and show it - works
fine. I haven't tried this since I switched to jquery (some of the old JS
code is still there) but I don't think there'd be any problem here either.
As I said though, I can't speak to any animations.



Rick Faircloth wrote:
> 
> Is it possible to show and hide a table row as it is a div?
> 
> I work mostly with tables / rows / cells rather than div's
> and I've had a hard time making the code work on tables rows.
> 
> Before I get into the code, I just want to make sure there's
> nothing specific about TR's that make them impossible or more
> difficult to work with than DIV's when it comes to jQuery.
> 
> Rick
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Trying-to-show-hide-table-row...-tf3016032.html#a8377914
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Big problem with jquery and IE, Opera

2007-01-12 Thread James Thomas

Difficult to determine why without an example of the failing code.

WaM wrote:
> 
> Hi,
> 
> It's my first day and I already have a problem for you. I make a website,
> using Jquery librairies and Symfony Framework.
> 
> Before today, I only test my website on Firefox. But today, I tried with
> Opera 8.54 and with IE 7. On my website, I have two big forms using
> Jquery. Both of them works perfectly with FF, but they don't work with IE
> and Opera. I tried to post this subject with Opera, and I couldn't. Really
> strange I found. So I'm posting this with Firefox lol.
> 
> So, if someone could explain me why Jquery doesn't work in Opera and IE,
> I'll be very gratefull. Thanks for advance.
> 
> With regards,
> WaM.
> 

-- 
View this message in context: 
http://www.nabble.com/Big-problem-with-jquery-and-IE%2C-Opera-tf2965480.html#a8301933
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Refactoring code from Prototype ( $() type ambiguity)

2007-01-11 Thread James Thomas

Well, I just did this too - though not from Prototype but from my own $()
function that took a string or an object. All I really needed to do was
change my $(str) calls to $('#' + str), which I did via global
search-and-replace - searched for $(" and replaced it with $("# - worked
beautifully and I don't have to worry about intermediate functions. And
where $() returned an object, I didn't have to change anything (though I do
as I encounter them to use jquery syntax rather than my own).

James


Nate Cavanaugh wrote:
> 
> John told me to post this here, so here it is
> 
> I am currently refactoring a large amount of code over to jQuery. Against
> better principles, the HTML is rife with onclick="fn()", etc, so I am
> having to convert over the functions themselves.
> 
> Prototype's $() will take a string or an object, just like jQuery does,
> however, since prototype will ONLY look for id's if you pass it a string,
> you do not have to include the #, whereas with jQuery, if you do not
> include the #, it will look for a tagname rather than an element by id.
> 
> So, here is an example of a generic function currently:
> 
> function test(arg1,arg2){
> obj = $(arg1);
> return obj;
> }
> 
> The above function will work in Prototype if it's a string or an object.
> 
> So in my refactoring, I have been doing this:
> 
> function test(arg1,arg2){
> obj = (typeof arg1 == 'string') ? $('#'+arg1) : $(arg1);
> return obj;
> }
> 
> Is this the best/only way?
> 
> Anyone have any ideas?
> 
> Thanks in advance!
> 

-- 
View this message in context: 
http://www.nabble.com/Refactoring-code-from-Prototype-%28-%24%28%29-type-ambiguity%29-tf2962817.html#a8290090
Sent from the JQuery mailing list archive at Nabble.com.


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


[jQuery] Tiny plugin example, message box

2007-01-10 Thread James Thomas

Hey all,

I've just discovered Jquery this last weekend and I am now converting all of
my in-house Javascript to use it. I played with most of the others but
didn't really like any of them; then I found Jquery and was instantly hooked
- the website is right, it does make javascript fun.

Anyway, I've started digging into some of the plugins and got around to
making my own. I do a lot of form validation (are certain fields provided,
etc.). I need to regularly check textbox/textarea fields for data so I did
the following plugin:

$.fn.isEmpty = function() {
var isempty = true;

this.each(
function() {
if (this.value.length != 0) {
isempty = false;
}
}
);
return isempty;
}

Any thoughts on ways I could improve this?

And not really a plugin but some simple Javascript that uses jquery to
generate a message on screen that fades away on its own (it gets its
stylings from CSS). Feel free to use it and/or suggest improvements:

var Msg = {
FadeIn : 750,

FadeOut : 1500,

FadeDelay : 2200,

// Show a formatted box on the screen - arguments:
//  lft : Left position (optional - if not 
provided, uses CSS default)
//  tp  : Top position (optional - if not 
provided, uses CSS default)
//  fin : Fade In Speed (optional - if not 
provided, use default)
//  fout: Fade Out Speed (optional - if not provided, 
use default)
//  delay   : How long to delay between fade in and 
starting fade out
(optional - if not provided, use default)
Show : function(msg, tp, lft, fin, fout, delay)
{
// Create the div tag we're going to display
$('body').append("" + msg + "");

// Get the necessary tag
var jq = $('div.message');

// Clicking anywhere within the message will cause it to close 
before fade
out effect finishes
jq.click(function() { $(this).unclick().remove() });

// Set some defaults if they haven't been passed in
delay = delay || Msg.FadeDelay;

fout = fout || Msg.FadeOut;

fin = fin || Msg.FadeIn;

// Use the defaults from CSS
lft = lft || jq.css("left");

tp = tp || jq.css("top");

// If no message provided, use a default one
msg = msg || "Message not provided.";

// Now display it
jq.css({ left : lft, top: tp }).fadeIn(fin, function() { 
setTimeout("$('div.message').fadeOut(" + fout + ", 
function() {
$(this).unclick().remove();} );", delay); });
}
};




-- 
View this message in context: 
http://www.nabble.com/Tiny-plugin-example%2C-message-box-tf2955841.html#a8268666
Sent from the JQuery mailing list archive at Nabble.com.


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