Re: [jQuery] Close any other row before showing a new one
How about a class 'hideable' to style all of the rows hidden or not, and a class 'hidden' which does the actual hiding? Then, to hide all and show a specific one: $('.hideable').not('.hidden').addClass('hidden'); $('#specials-' + num + '-details').removeClass('hidden'); or something along those lines. On 3/29/07, Klaus Hartl [EMAIL PROTECTED] wrote: Jake McGraw schrieb: Have to tried ':visible' selector? $('.hidden:visible').slideUp(fast); By the way, reading .hidden:visible shows to me that the class name hidden is purely presentational and not very well chosen. How can a hidden thing be visible? Would be less confusing to call it additional for example. -- Klaus ___ jQuery mailing list [EMAIL PROTECTED] http://jquery.com/discuss/103 -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Close any other row before showing a new one
Klaus, You're absolutely right, that would be far better. Instead of 'hidden' for all items not shown, 'selected' would be a better class for the item currently shown. Rob. On 3/29/07, Klaus Hartl [EMAIL PROTECTED] wrote: Rob Desbois schrieb: How about a class 'hideable' to style all of the rows hidden or not, and a class 'hidden' which does the actual hiding? I think hideable is still a purely presentational class name. Let's imagine this is going to be changed and the hideables are supposed to be shown all time. You would have to change the class name to have that still make sense (think of co-workers and others reading your code), but with a class name of additional, description etc. it doesn't matter if the element gets shown, gets hidden, or it maybe gets only hidden in print and handheld media types... That said, your're better off with a class name that adds a little semantic to the element and describes the purpose of the element in question. -- Klaus ___ jQuery mailing list [EMAIL PROTECTED] http://jquery.com/discuss/56 -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Table of information, expanding one row using AJAX call and callback function.
Andy, Just to clarify - $(this) will create a jQuery object from variable 'this', which extends it with all of the fantastic jQuery methods and properties we know and love. 'this' on its own is the DOM object and as such only has access to DOM properties and methods. Also, regarding the actual question and your last reply - my gut instinct would say that if you can, avoid degrading your HTML just to get some JS working. If you're using tabular data then you 'should' be using a table with trs and tds used properly. However I haven't tried to do what you're doing and can't offer an alternative without trying it... Rob On 3/28/07, Andy Matthews [EMAIL PROTECTED] wrote: A $(this),parent()!!! I tried this.parent() and $this.parent() to no avail. Thanks for your feedback on the TR...I know I can use divs, but this is tabular data. So maybe I'll just have to use rows of DIVs, each containing a table. -- *From:* [EMAIL PROTECTED] 71 [EMAIL PROTECTED][mailto: [EMAIL PROTECTED] 72 [EMAIL PROTECTED]] *On Behalf Of *Jake McGraw *Sent:* Wednesday, March 28, 2007 1:37 PM *To:* jQuery Discussion *Subject:* Re: [jQuery] Table of information,expanding one row using AJAX call and callback function. First, you can not animate table rows (tr) because almost all of the motion animations are written for block level elements. You could, however, place the information within a couple of divs and position them to get the look and feel you currently have with tables. This will allow you to use most of the Interface animations and prevent you from committing misuse of a table. Second, if you were wanted to grab the ID of the TR element upon clicking the IMG element in the following code: tr id=footdimg src=bar.gif//td/tr You would need the following code (I prefer using the higher level click(), hover(), etc functions as opposed to bind()): $(img).click(function(){ $(this).parent().parent().attr(id); }); As the TR element is the parent of the parent of the IMG. Finally, there are a lot of examples throughout the mailing list of how to add dynamic load on click functionality, a good place to start is http://docs.jquery.com/Ajax 73 http://docs.jquery.com/Ajax. - jake On 3/28/07, Andy Matthews [EMAIL PROTECTED][EMAIL PROTECTED] wrote: I'm working on project which will have a table of information. For any row, there could be more more information that the user may want to view. Any row with more information would have some sort of image indicating this. When the user clicks the row, I'd like to pull data using AJAX, then expand the row via a callback function. Here's how I might do it, does anyone have a better solution? table border=1 width=400 tr id=methodname|123456 class=row tdName/td tdAddress/td tdimg src=moreinfo.gif name=image1 //td /tr tr id=row1details style=display: none; td colspan=3 additional details would go herebr / additional details would go herebr / additional details would go herebr / additional details would go herebr / additional details would go herebr / /td /tr /table $(document).ready( function(){ $('.row td img').bind(click, function() { $('#row1details').slideDown(slow); }); }); The first problem with this is that the TR doesn't animate. It merely shows, even though I'm using slideDown. What am I doing wrong there? I'm not even sure how to do the AJAX call. For any row which has more information, I need to pass in two values...a string representing a Coldfusion method to call, and a number representing the id of the record I want to return to the page. I think the easiest way to do this would be to stash the methodname and number (id) as the id of the row, then parse that in the click function. I think I can figure out that part. Another question I have is in the above example, when I click the img, I need to be able to get the ID of it's parent TR. I thought that this would work: $('.row td img').bind(click, function() { this.parent('tr').attr('id'); }); But it returns an error saying Object doesn't support this property or method.. What am I doing wrong? Please feel free to answer any one of these questions... * Andy Matthews *Senior Coldfusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] 75 [EMAIL PROTECTED] www.dealerskins.com 76 http://www.dealerskins.com/ ___ jQuery mailing list discuss@jquery.com 77 discuss@jquery.com http://jquery.com/discuss/ 78 http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com 79 discuss@jquery.com http://jquery.com/discuss/ 80 http://jquery.com/discuss/ -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full
[jQuery] jquery.com site problems?
Is it just me or has jquery.com been struggling a little lately? Just received this: *Fatal error*: Call to a member function selectRow() on a non-object in * /home/jqdocs/public_html/includes/User.php* on line *829 *Also seems to be having frequent database issues and occasionally not responding at all. Perhaps too popular for its own good ;-)* * -- Rob Desbois Eml: [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getting the selectedIndex of a dynamic select
I thought a jQuery object consisted of extended DOM objects - i.e. all DOM methods and properties are available, plus the jQuery extensions. On 3/24/07, Brian Cherne [EMAIL PROTECTED] wrote: var valueOfSelected = $(#list [EMAIL PROTECTED]).val(); And, instead of onClick you probably want to use onChange. Note, when you are in the function this refers to the DOM object that fired the event (that has selectedIndex). When you wrap it in $(this) you then have the jQuery object (which does not have selectedIndex, but can be used for all other jQuery events/methods). I hope this helps, Brian. On 3/24/07, narven [EMAIL PROTECTED] wrote: Hi, Im having some problems getting the value of selectedIndex of a select box. im using... // this is populated dynamic using ajax select id=list name=list size=15/select $(function() { $('#list').bind('click', function() { alert( $(this).selectedIndex ); }); }) But always gives me undefined :| ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getting the selectedIndex of a dynamic select
Ok I think that may answer the next question. Are you saying that an assertion: $(this)[0] == this will always be true? In other words, if I am using ID selectors and want to access a DOM property/method should I read the first element or can I just use the jQuery: $(#myDiv).selectedIndex; or should it always be one of: $(#myDiv).get(0).selectedIndex; $(#myDiv)[0].selectedIndex; Sorry for the thread hijack ;-) On 3/26/07, Klaus Hartl [EMAIL PROTECTED] wrote: Dan G. Switzer, II schrieb: Rob, I thought a jQuery object consisted of extended DOM objects - i.e. all DOM methods and properties are available, plus the jQuery extensions. To get to the actual DOM element, you'd use: alert( $(this).get(0).selectedIndex ); -- or -- alert( $(this)[0].selectedIndex ); Just to remember: $(this)[0] == this Wrapping a jQuery around the element to immediatly get it out there is a little over the top most of the time ;-) -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How do I find what form my input is in?
I think this will do it for you, although haven't tested: $(#myInput).parentNode; On 3/23/07, Dan Eastwell [EMAIL PROTECTED] wrote: I know I can use parents to get the ancestors of my input, but this will get all forms on the page $(#myInput).parents(form); How do I find the one the form is in? var formItsIn = checkAncestors(theSearchBox, form); function checkAncestors(theItem, requiredAncestor){ var theparent = theItem.parentNode.nodeName.toLower(); if(theparent == requiredAncestor){ return theparent; }else{ checkAncestors(theparent, requiredAncestor); } } my code above seems a bit much to me, and it's not jquery! Cheers, Dan. -- Daniel Eastwell Portfolio and articles: http://www.thoughtballoon.co.uk Blog: http://www.thoughtballoon.co.uk/blog ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] NOTICE: Moving to Google Groups
From the original post: Tonight at 10pm EST (0300 GMT) I will be making a final posting to this mailing list, and will close it down. The final messages will be moved over to the new mailing list, located here (it's currently locked): On 3/21/07, amircx [EMAIL PROTECTED] wrote: its ok but how can i write ? its tells me its for members only and i need invite for that John Resig wrote: Hi Everyone - As you've probably noticed, the mailing list has been very very flaky the past couple days. Primarily, this is due to the fact that the amount of traffic coming to the server is entirely overwhelming. Currently, we're receiving about 260,000 web hits/day in addition to sending out about 150,000 emails/day. Up until this point I've been content to host the mailing list on this server, with the hope that the list would eventually be moved to a forum, of some sort. However, the strain of adding in an additional web application, combined with the continued sending of hundreds of thousands of emails, is simply more than what our server (and sysadmin [me] can take). I've talked it over with a number of people and they feel that Google Groups is an adequate substitute for both a mailing list and a general-purpose forum, and I tend to agree. The usability of Google Groups is a huge factor; it will help users to more-easily sign-up and participate at their leisure. I had considered moving over to Google Groups before, but I was never able to find a way to import all of our old messages. Thankfully, I now figured out a way; making the move completely possible. Tonight at 10pm EST (0300 GMT) I will be making a final posting to this mailing list, and will close it down. The final messages will be moved over to the new mailing list, located here (it's currently locked): http://groups.google.com/group/jquery-en Currently, I have everything but March's messages, and all of your subscriptions, moved over. I will be doing both of those tonight. (You should receive an email notification alerting you once you've been subscribed to the group.) I will do my best to maintain your current email notification settings. I hope everyone is ok with this move. I think it's for the best. Please let me know if you have any serious concerns. Thanks! --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/NOTICE%3A-Moving-to-Google-Groups-tf3440797.html#a9595429 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Thickbox questions
Hi Shelane, 1: Not sure, try it! You shouldn't (untested ;-D) need to have global includes, if you have any trouble you can always check the thickbox code and make the CSS as specific as it needs to be to not affect the rest of your site. 2: I think (but haven't used noConflict) that yes, you would need to replace $ in thickbox.js 3: I had a form working inside a thickbox window, although heavily modified the thickbox code to achieve the effect that I wanted. I've since moved to jqModal as it is more customisable which I needed. The method I used for thickbox was to create a form in my document then pass this as inline content to the thickbox window. Without the code handy I couldn't show you how. Hope that helps in some way... On 3/21/07, Shelane Enos [EMAIL PROTECTED] wrote: I like the idea of thickbox, but I have a few concerns. 1. I would really prefer not to rewrite my css for all of *my* elements to handle the global padding, margin, etc changes by the thickbox.css file. How will thickbox behave if I comment out the global settings. 2. I still have to use prototype for one function that I have yet to get working on jQuery. So my jQuery calls start with this var $j = jQuery.noConflict(); to make it play nice. Do I need to change all the $ in the thickbox.js file to make it play nice too? 3. My use for thickbox is to pull up an edit form for some session values. How have other people handled form submissions with thickbox? I'm going to have the form submit and on success call a different function on my base page to reload (via jQuery) my results. I appreciate your help for this jQuery newbie. -Shelane ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Code simplifying request.
Ok first off you should cache the result of the search as otherwise it'll be performed every time. Then, you can just chain the operations on input#rxt_forename straight, except for one part. When you modify a jQuery object, e.g. with addClass(), the function returns the jQuery object. This chaining is broken if you traverse from that set, e.g. with get(0). When you use a 'destructive' operation like that, you have to use end() to get the previous state. var rxtForename = $('input#rxt_forename'); if( rxtForename.val() == '' ){ // add class to change colour rxtForename .addClass(required) .get(0).focus().end() // end() undoes the last destructive operation, which in this case is get(0) .siblings(span.error).show(); return false; }else{ rxtForename .removeClass(required) .siblings(span.error).hide(); } Hope that helps, Rob On 3/21/07, Luc Pestille [EMAIL PROTECTED] wrote: Hi all, I've got some simple validation to do (not enough to use one of the form plugins), and have this; // when the form is submitted $('form#checkout').submit( function(){ // if field has something in it, do submit actions, otherwise write out error if( $('input#rxt_forename').val() == '' ){ // add class to change colour $('input#rxt_forename').addClass(required).get(0).focus(); $('input#rxt_forename').siblings(span.error).show(); return false; }else{ $('input#rxt_forename').removeClass(required); $('input#rxt_forename').siblings(span.error).hide(); } How can i simplify it? I would have thought replacing the input selector with $(this) would work, but it doesn't, and I'm sure the class/siblings processes could be chained... Thanks, *Luc Pestille* Web Designer e: [EMAIL PROTECTED] t: +44 (0)1628 899 700 f: +44 (0)1628 899 701 In2 Thames House Mere Park Dedmere Road Marlow Bucks SL7 1PB Tel 01628 899700 Fax 01628 899701 e: [EMAIL PROTECTED] i: www.in2.co.uk This message (and any associated files) is intended only for the use of discuss@jquery.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not discuss@jquery.com you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author [EMAIL PROTECTED] do not necessarily represent those of the company. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] DOM manipulation
var newDiv = $(div/div).appendTo(this.parentNode); $(img ... /).appendTo(newDiv); [untested] I'm don't think you need to jQuerify this.parentNode before doing appendTo on it, although might be wrong. On 3/20/07, Allan Mullan [EMAIL PROTECTED] wrote: Hey :-) Just trying to work out how in jQuery you would do something like (inside a function): var newDiv = this.parentNode.appendChild(document.createElement(div)); newDiv.appendChild(document.createElement('img')); Because this is in a function I'm trying to append the items to the object being passed (i.e. a parent div) using $('div').blah(); I'm having a complete mind blank so would appreciate any help. I'm guessing it's using the append() functions etc?? Thanks in advance Allan ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Removing readonly attribute from textarea
All, What's the 'correct' way to change a textarea to and from readonly. The following works for me, but I wanted to particularly check the removal: $(#myTextArea).attr(readonly, readonly); // Make read-only $(#myTextArea).attr(readonly, ); // Make read-write Thanks, rob -- Rob Desbois Eml: [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery and non-jQuery events
Hi Mladen, This looks reminiscent of problems I've been having the last few days with versus .click(fn) for setting the click event for elements. My problem occurred in Firefox and not IE. Bug report for mine is here: http://dev.jquery.com/ticket/1043#preview I was trying to change the click handler at runtime for elements whose original handlers were set with the onclick attribute, the only way I foudn to prevent the fault was not to use that and to only use $("...").click(fn) instead. HTH, rob Hi everybody,I would be very grateful if someone could explain to me behaviour of the following simple piece of code, which is from my perspective a bit strange:!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" headtitleUntitled Page/titlescript type="text/_javascript_" src=""/scriptscript type="text/_javascript_"$(function() { $('#btn1').click(function() {alert('btn1 clicked');});$('#btn3').click(function() {alert('btn3 clicked');$('#btn1').click(); $('#btn1').get(0).onclick();$('#btn1').get(0).click();$('#btn2').click();$('#btn2').get(0).onclick();$('#btn2').get(0).click(); }); }); function btn2Click() {alert('btn2 clicked');}/script/headbodyinput type="button" id="btn1" value="btn1" / input type="button" id="btn2" value="btn2" / input type="button" id="btn3" value="btn3" //body/htmlThe same page could be found at:http://radioni.ca/jquery-click.htmlso you can try it out yourselves.Click on the third button causes following alerts to be displayed: * btn3 clicked* btn1 clicked* btn1 clicked* btn2 clicked* btn2 clicked* btn2 clicked* btn2 clickedWhy btn1 only twice, and btn2 even four times? (Note: is behaviour from Firefox, seems like IE behaves slightly different. Let's stay with FF for some time) Thanks in advance, I am not asking this just for fun, I have problems with submit event and I have created this code to simplify and illustrate.__This email has been scanned by the MessageLabs Email Security System.For more information please visit http://www.messagelabs.com/email __ --- Original Message --- From:"Mladen Jablanovic" [EMAIL PROTECTED] To:discuss@jquery.com Date:Thu, 15 Mar 2007 15:59:08 +0100 Subject:[jQuery] jQuery and non-jQuery events Hi everybody,I would be very grateful if someone could explain to me behaviour of the following simple piece of code, which is from my perspective a bit strange:!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 titleUntitled Page/titlescript type="text/_javascript_" src=""/scriptscript type="text/_javascript_"$(function() { $('#btn1').click( function() { alert('btn1 clicked'); } ); $('#btn3').click( function() { alert('btn3 clicked'); $('#btn1').click(); $('#btn1').get(0).onclick(); $('#btn1').get(0).click(); $('#btn2').click(); $('#btn2').get(0).onclick(); $('#btn2').get(0).click(); } ); }); function btn2Click() { alert('btn2 clicked');}/script/headbody input type="button" id="btn1" value="btn1" / input type="button" id="btn2" value="btn2" / input type="button" id="btn3" value="btn3" //body/htmlThe same page could be found at:http://radioni.ca/jquery-click.htmlso you can try it out yourselves.Click on the third button causes following alerts to be displayed: btn3 clicked btn1 clicked btn1 clicked btn2 clicked btn2 clicked btn2 clicked btn2 clickedWhy btn1 only twice, and btn2 even four times? (Note: is behaviour from Firefox, seems like IE behaves slightly different. Let's stay with FF for some time) Thanks in advance, I am not asking this just for fun, I have problems with submit event and I have created this code to simplify and illustrate.__This email has been scanned by the MessageLabs Email Security System.For more information please visit http://www.messagelabs.com/email __ ___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] changing default thickbox behavior
Paul, Short answer -- yes, modify the code ;-) To prevent closing by clicking on the overlay and remove the 'close' link (better IMHO than just disabling it), remove line 38: $("#TB_overlay").click(TB_remove); remove the TB_closeWindow div from line 133: $("#TB_window").append("a href='' id='TB_ImageOff' title='Close'img id='TB_Image' src='' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'//a" + "div id='TB_caption'"+caption+"div id='TB_secondLine'" + imageCount + prev.html + next.html + "/div/div"); remove line 135: $("#TB_closeWindowButton").click(TB_remove); remove the TB_closeAjaxWindow div from line 205: $("#TB_window").append("div id='TB_title'div id='TB_ajaxWindowTitle'"+caption+"/div/diviframe frameborder='0' hspace='0' src='' id='TB_iframeContent' name='TB_iframeContent' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' /iframe"); and 207: $("#TB_window").append("div id='TB_title'div id='TB_ajaxWindowTitle'"+caption+"/div/divdiv id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'/div"); remove line 210: $("#TB_closeWindowButton").click(TB_remove); and remove lines 258-259: $("#TB_overlay").unbind("click"); $("#TB_closeWindowButton").unbind("click"); Thickbox also has a keydown handler so that if you push 'escape' it closes. Remove lines 236-245 to prevent this: document. if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close TB_remove(); } } To add the 'close' functionality to something, do this: $("#myTbCloseButton").click(TB_remove); I've heavily customised TB to my own purposes over the last few days, hence a slight familiarity with the code :-D Hope that helps, rob Is there a way to modify the default Thickbox behavior? I dont want the user to be able to dismiss the TB window by clicking the overlay or a close linkI want to programmatically close it based on user input within the TB window. Thanks, Paul __This email has been scanned by the MessageLabs Email Security System.For more information please visit http://www.messagelabs.com/email __ --- Original Message --- From:"Paul" [EMAIL PROTECTED] To:"'jQuery Discussion.'" discuss@jquery.com Date:Thu, 15 Mar 2007 08:37:21 -0700 Subject:[jQuery] changing default thickbox behavior Is there a way to modify the default Thickbox behavior? I dont want the user to be able to dismiss the TB window by clicking the overlay or a close linkI want to programmatically close it based on user input within the TB window. Thanks, Paul__This email has been scanned by the MessageLabs Email Security System.For more information please visit http://www.messagelabs.com/email __ ___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] the pitfalls of jquery
Or that their only experience of JavaScript has been riddled with problems due to browser incompatibility problems. There've been times I've cursed JS for these. Granted, the problem is the browsers' implementations, but it's still enough to make you say 'Javascript is evil' IMHO. Good conversation anyway -- and I agree, just rename it from jQuery to something else and use it. The people against it are unlikely to have any solid basis for the dislike. Rob. There was a web developer that my client hired to do some graphic design stuff really, and she tried to convince them that javaScript was evil. I think folks who do that sort of thing are just afraid of something they don't understand. Or they think it's too hard, so they try to convince all their client's that it's inherently bad. Jeepers... *sigh* Chris Klaus Hartl wrote: Benjamin Sterling schrieb: I was actually going to do Mamut's idea or a version of it. Since they don't know what jquery is, I think I can get away with it. I would probably take things out that I wont be using, but I will cross that bridge when I get there. At least you're allowed to use JavaScript. On one of my governmental projects we weren't, because it is evil. You know why, accesibility and all that, never heard of Progressive Enhancement... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- http: //www.cjordan.us ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ -- Original Message -- FROM: Christopher Jordan [EMAIL PROTECTED] TO:jQuery Discussion. discuss@jquery.com DATE: Thu, 15 Mar 2007 10:44:13 -0500 SUBJECT: Re: [jQuery] the pitfalls of jquery There was a web developer that my client hired to do some graphic design stuff really, and she tried to convince them that javaScript was evil. I think folks who do that sort of thing are just afraid of something they don't understand. Or they think it's too hard, so they try to convince all their client's that it's inherently bad. Jeepers... *sigh* Chris Klaus Hartl wrote: Benjamin Sterling schrieb: I was actually going to do Mamut's idea or a version of it. Since they don't know what jquery is, I think I can get away with it. I would probably take things out that I wont be using, but I will cross that bridge when I get there. At least you're allowed to use JavaScript. On one of my governmental projects we weren't, because it is evil. You know why, accesibility and all that, never heard of Progressive Enhancement... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- http: //www.cjordan.us ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] JQuery Form plugin
George, Just set the 'enctype' attribute of the form as usual: form id='my_form' action='x.php' method='POST' enctype='multipart/form-data'.../form $(#my_form).ajaxForm({dataType: ..., success: onFormSubmitSuccess}); Rob Dear devs, I am using the JQuery forms plugin and I have a problem. I would like to post a form that containse a file, ie I have to use enctype=multipart/form-data. How can I set this up when using ajaxForm()? Is there an example how you can upload files using ajaxForm()? thanks in advance for any help, George. -- http: //blog.gmosx.com http: //cull.gr http: //nitroproject.org http: //www.joy.gr ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ -- Original Message -- FROM: George Moschovitis [EMAIL PROTECTED] TO:discuss@jquery.com DATE: Thu, 15 Mar 2007 18:12:31 +0200 SUBJECT: [jQuery] JQuery Form plugin Dear devs, I am using the JQuery forms plugin and I have a problem. I would like to post a form that containse a file, ie I have to use enctype=multipart/form-data. How can I set this up when using ajaxForm()? Is there an example how you can upload files using ajaxForm()? thanks in advance for any help, George. -- http: //blog.gmosx.com http: //cull.gr http: //nitroproject.org http: //www.joy.gr ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] JQuery Form plugin
Sorry, no I haven't. And apologies for being totally wrong - I didn't know the Form plugin can't do file uploads. I was just working on the fact that the plugin uses the attributes of the form, so should (might...) include the enctype. If it doesn't support file uploads though it's not that relevant :-( --rob Just set the 'enctype' attribute of the form as usual: form id='my_form' action='x.php' method='POST' enctype='multipart/form-data' ... /form Have you actually tried this? This doesn't work for me :( -g. -- http: //blog.gmosx.com http: //cull.gr http: //www.joy.gr http: //nitroproject.org ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ -- Original Message -- FROM: George Moschovitis [EMAIL PROTECTED] TO:discuss@jquery.com DATE: Thu, 15 Mar 2007 18:26:56 +0200 SUBJECT: Re: [jQuery] JQuery Form plugin Just set the 'enctype' attribute of the form as usual: form id='my_form' action='x.php' method='POST' enctype='multipart/form-data' ... /form Have you actually tried this? This doesn't work for me :( -g. -- http: //blog.gmosx.com http: //cull.gr http: //www.joy.gr http: //nitroproject.org ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] unbind() fails on handler specified in the HTML
Thanks Olaf -- I discovered that fix whilst looking through the mailing list archives. According to the documentation though unbind() should work - and it is there for this purpose! rob I don't anything about unbind, i would try: function test() { $(#testButton).removeAttr(onclick).html(Tested already); } -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ -- Original Message -- FROM: Olaf Bosch [EMAIL PROTECTED] TO:jQuery Discussion. discuss@jquery.com DATE: Mon, 12 Mar 2007 19:20:51 +0100 SUBJECT: Re: [jQuery] unbind() fails on handler specified in the HTML Rob Desbois schrieb: It seems that unbind() will only remove event handlers that were attached to elements by jQuery. The following does not remove the event handler specified in the element's attributes. I don't anything about unbind, i would try: function test() { $(#testButton).removeAttr(onclick).html(Tested already); } -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Bug: event binding / unbinding. help!
Further to my last email regarding unbind(foo) not being able to remove events set in the HTML onfoo attribute, is another problem which is harder to work around. Using two functions to handle the click event for a button, each function swapping the handler to the other. (Ignore that this can be done with toggle(), this is a simplified test script.) Behaviour is different in Firefox2.0.0.2 and IE6.0. In FF, the test runs as follows for each click: 1. alerts tested 4.1 as expected 2. alerts tested 4.1 then alerts tested 4.2 3. alerts tested 4.1 as expected Each click after this runs as expected. In IE6.0, the test runs as follows: 1. alerts tested 4.1 as expected 2. alerts tested 4.2 then alerts tested 4.1 Each click after this runs the same as the 2nd. What's even more odd is that if the final line running .click() in Test4_1() or Test_2() is commented out, everything also behaves as expected. I'll file this as soon as the bug-reporter stops telling me the the database is locked; in the meantime can anyone check to make sure it's not me being stupid, or suggest a workaround? Thanks all! This is the test page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head meta http-equiv='content-type' content='text/html; charset=ISO-8859-1' / titleTester/title script src='/jquery.js' type='text/javascript'/script script type='text/javascript'!-- function test4_1() { alert('tested 4.1'); $(#testButton4).removeAttr(onclick); $(#testButton4).unbind(click); $(#testButton4).html(Test 4.2); $(#testButton4).click(test4_2); } function test4_2() { alert('tested 4.2'); $(#testButton4).removeAttr(onclick); $(#testButton4).unbind(click); $(#testButton4).html(Test 4.1); $(#testButton4).click(test4_1); } // --/script /head body p style='background:red'Uses removeAttr() and unbind(), then click() to rebind as it toggles between two tests button id=testButton4 onclick=test4_1()Test 4.1/button/p /body /html --rob __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Bug: event binding / unbinding. help!
Hmm slightly more info. I spotted the obvious potential stupidity, which was that I wasn't returning false, so of course it ended my click handler, spotted the new one and ran that, etc... Adding 'return false;' to the end makes Firefox run test4.1, test4.1, test4.2 then toggle as expected. IE however runs test4.1, then the 2nd iteration it continuously switches between test4.2 and test4.1 without ending the handler chain at all. Removing the 'onclick' attribute and setting the handler with .click() in $(document).ready() fully corrects the fault in firefox, hence this is the same fault I encountered yesterday. In IE it makes no difference and it still bounces between the two click handlers after the first iteration. --rob Further to my last email regarding unbind(foo) not being able to remove events set in the HTML onfoo attribute, is another problem which is harder to work around. Using two functions to handle the click event for a button, each function swapping the handler to the other. (Ignore that this can be done with toggle(), this is a simplified test script.) Behaviour is different in Firefox2.0.0.2 and IE6.0. In FF, the test runs as follows for each click: 1. alerts tested 4.1 as expected 2. alerts tested 4.1 then alerts tested 4.2 3. alerts tested 4.1 as expected Each click after this runs as expected. In IE6.0, the test runs as follows: 1. alerts tested 4.1 as expected 2. alerts tested 4.2 then alerts tested 4.1 Each click after this runs the same as the 2nd. What's even more odd is that if the final line running .click() in Test4_1() or Test_2() is commented out, everything also behaves as expected. I'll file this as soon as the bug-reporter stops telling me the the database is locked; in the meantime can anyone check to make sure it's not me being stupid, or suggest a workaround? Thanks all! This is the test page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head meta http-equiv='content-type' content='text/html; charset=ISO-8859-1' / titleTester/title script src='/jquery.js' type='text/javascript'/script script type='text/javascript'!-- function test4_1() { alert('tested 4.1'); $(#testButton4).removeAttr(onclick); $(#testButton4).unbind(click); $(#testButton4).html(Test 4.2); $(#testButton4).click(test4_2); } function test4_2() { alert('tested 4.2'); $(#testButton4).removeAttr(onclick); $(#testButton4).unbind(click); $(#testButton4).html(Test 4.1); $(#testButton4).click(test4_1); } // --/script /head body p style='background:red'Uses removeAttr() and unbind(), then click() to rebind as it toggles between two tests button id=testButton4 onclick=test4_1()Test 4.1/button/p /body /html --rob __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ -- Original Message -- FROM: Rob Desbois [EMAIL PROTECTED] TO:discuss@jquery.com DATE: Tue, 13 Mar 2007 14:42:40 + SUBJECT: [jQuery] Bug: event binding / unbinding. help! Further to my last email regarding unbind(foo) not being able to remove events set in the HTML onfoo attribute, is another problem which is harder to work around. Using two functions to handle the click event for a button, each function swapping the handler to the other. (Ignore that this can be done with toggle(), this is a simplified test script.) Behaviour is different in Firefox2.0.0.2 and IE6.0. In FF, the test runs as follows for each click: 1. alerts tested 4.1 as expected 2. alerts tested 4.1 then alerts tested 4.2 3. alerts tested 4.1 as expected Each click after this runs as expected. In IE6.0, the test runs as follows: 1. alerts tested 4.1 as expected 2. alerts tested 4.2 then alerts tested 4.1 Each click after this runs the same as the 2nd. What's even more odd is that if the final line running .click() in Test4_1() or Test_2() is commented out, everything also behaves as expected. I'll file this as soon as the bug-reporter stops telling me the the database is locked; in the meantime can anyone check to make sure it's not me being stupid, or suggest a workaround? Thanks all! This is the test page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head meta http-equiv='content-type' content='text/html; charset
Re: [jQuery] Bug: event binding / unbinding. help!
Sorry for all the info, but the bug submission website isn't working and I really need help on this one! It seems that when the click handler is being run usually, it's called by 'onclick()'. The time when it is run twice (in Firefox at least) the first time is called by onclick() which is called by handle() - a jQuery function. The second call is as normal. What is this handle() function and why is it explicitly calling my function? --rob Hmm slightly more info. I spotted the obvious potential stupidity, which was that I wasn't returning false, so of course it ended my click handler, spotted the new one and ran that, etc... Adding 'return false;' to the end makes Firefox run test4.1, test4.1, test4.2 then toggle as expected. IE however runs test4.1, then the 2nd iteration it continuously switches between test4.2 and test4.1 without ending the handler chain at all. Removing the 'onclick' attribute and setting the handler with .click() in $(document).ready() fully corrects the fault in firefox, hence this is the same fault I encountered yesterday. In IE it makes no difference and it still bounces between the two click handlers after the first iteration. --rob Further to my last email regarding unbind(foo) not being able to remove events set in the HTML onfoo attribute, is another problem which is harder to work around. Using two functions to handle the click event for a button, each function swapping the handler to the other. (Ignore that this can be done with toggle(), this is a simplified test script.) Behaviour is different in Firefox2.0.0.2 and IE6.0. In FF, the test runs as follows for each click: 1. alerts tested 4.1 as expected 2. alerts tested 4.1 then alerts tested 4.2 3. alerts tested 4.1 as expected Each click after this runs as expected. In IE6.0, the test runs as follows: 1. alerts tested 4.1 as expected 2. alerts tested 4.2 then alerts tested 4.1 Each click after this runs the same as the 2nd. What's even more odd is that if the final line running .click() in Test4_1() or Test_2() is commented out, everything also behaves as expected. I'll file this as soon as the bug-reporter stops telling me the the database is locked; in the meantime can anyone check to make sure it's not me being stupid, or suggest a workaround? Thanks all! This is the test page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head meta http-equiv='content-type' content='text/html; charset=ISO-8859-1' / titleTester/title script src='/jquery.js' type='text/javascript'/script script type='text/javascript'!-- function test4_1() { alert('tested 4.1'); $(#testButton4).removeAttr(onclick); $(#testButton4).unbind(click); $(#testButton4).html(Test 4.2); $(#testButton4).click(test4_2); } function test4_2() { alert('tested 4.2'); $(#testButton4).removeAttr(onclick); $(#testButton4).unbind(click); $(#testButton4).html(Test 4.1); $(#testButton4).click(test4_1); } // --/script /head body p style='background:red'Uses removeAttr() and unbind(), then click() to rebind as it toggles between two tests button id=testButton4 onclick=test4_1()Test 4.1/button/p /body /html --rob __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ -- Original Message -- FROM: Rob Desbois [EMAIL PROTECTED] TO:discuss@jquery.com DATE: Tue, 13 Mar 2007 14:42:40 + SUBJECT: [jQuery] Bug: event binding / unbinding. help! Further to my last email regarding unbind(foo) not being able to remove events set in the HTML onfoo attribute, is another problem which is harder to work around. Using two functions to handle the click event for a button, each function swapping the handler to the other. (Ignore that this can be done with toggle(), this is a simplified test script.) Behaviour is different in Firefox2.0.0.2 and IE6.0. In FF, the test runs as follows for each click: 1. alerts tested 4.1 as expected 2. alerts tested 4.1 then alerts tested 4.2 3. alerts tested 4.1 as expected Each click after this runs as expected. In IE6.0, the test runs as follows: 1. alerts tested 4.1 as expected 2. alerts tested 4.2 then alerts tested 4.1 Each click after this runs the same as the 2nd. What's even more odd is that if the final line running .click() in Test4_1() or Test_2
[jQuery] unbind() fails on handler specified in the HTML
It seems that unbind() will only remove event handlers that were attached to elements by jQuery. The following does not remove the event handler specified in the element's attributes. Behaviour is repeatable for several event types on Fx2.0.0.2 and IE6.0 -- bug, missing feature or missing documentation? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head meta http-equiv='content-type' content='text/html; charset=ISO-8859-1' / titleTester/title script src='/jquery-uncompressed.js' type='text/javascript'/script script type='text/javascript'!-- $(document).ready(function() { $(#testButton) .html(ready to test); }) function test() { $(#testButton).unbind(click).html(Tested already); } // --/script /head body button id=testButton onclick=test()Test me/button /body /html __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Track control that starts ajax request to modify on reply
I have a page with a table. Some rows have a particular control; clicking on it sends an ajax request which modifies the database record relating to that particular row. The row is identified in the control's onclick by passing the unique identifier to the click handler. I want the response to the request to be able to locate and modify the original control. What are people's opinions on the 'best' way to track which control it is? The ideas I've had are: * Send $(.control_class).index($(this)) with the request, get the server-side script to return it then use $(.control_class).get($control_index) * Insert input type='hidden' name='control_id' value='UNIQUE_ID' / as a sibling of the control to be modified. On response, use $([EMAIL PROTECTED]) Out of these two, the first seems far better, but involving the server-side script in client-side operations seems a little messy. Any other ideas? Thanks! Rob __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Problems with retrieving / setting textarea content [Firefox]
I have a textarea which I want to read / write. I have been testing with this: alert($(#the_text_area).text()); $(#the_text_area).text('different text'); That works as expected until the textarea contents are modified by the user. From that point, .text() continues to return the unmodified text, and text('text') has no effect. This fault occurs in Firefox 2.0.0.2, but not in IE6.0 I've discovered I can use .val() which will work in both. Should it? Is this a Firefox bug or am I going about this the wrong way? Any advice welcome. TIA --rob __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Update ThickBox inline content without reload
I'm implementing a window with the ThickBox plugin to add/view/edit comments. When the comment is being viewed, clicking an 'edit' button (in the TB window) should modify it to edit mode. I have a hidden div whose child elements I identify by ID, set, then pass the div to TB as inline content. TB then just copies the HTML to itself. This causes a problem because I wish this transition from view - edit mode to occur without closing and opening the TB window, but because the HTML is being copied I cannot access the nodes by ID, seeing as IDs are supposed to be unique in a page. Once the user has finished with the edit mode they click 'save' -- the click() handler for this finds the elements by ID again (which always ends up finding the originals, not the copies, of course) and submits them via $.post How can I get around this issue? Should I use classes instead? Do I need to hack up ThickBox a little? TIA, --rob __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/