[jQuery] Re: sortable: drag list items by custom handle
Thank you tlphipps! It was under my nose all the time... emi On Thu, May 8, 2008 at 4:13 PM, tlphipps [EMAIL PROTECTED] wrote: You need to use the handle option as detailed here: http://docs.jquery.com/UI/Draggables/draggable#options (the sortable docs refer you to this description for that handle option) On May 8, 4:09 am, emi polak [EMAIL PROTECTED] wrote: Hi there, I am using $(#myList).sortable({}); to sortable-ize a ul list. All works fine, however the entire li element responds to dragging and I want the li elements to be draggable only by using a custom handle like this: li id=list_1 some content here div class=custom_handleMY HANDLE/div /li Any ideas? Thank you! emi
[jQuery] Re: [jQuery][ANN] jQuery.batch 1.0
Brandon, i believe this is a clever little plugin. I i understand correctly, here is a real life example i experienced just 2 days ago where i had such markup: li class=hello img width=316 src=photos/sombra/Image_001.jpg/ img width=629 src=photos/sombra/Image_002.jpg/ img width=630 src=photos/sombra/Image_003.jpg/ img width=638 src=photos/sombra/Image_004.jpg/ img width=631 src=photos/sombra/Image_005.jpg/ img width=630 src=photos/sombra/Image_006.jpg/ img width=629 src=photos/sombra/Image_007.jpg/ /li I needed to resize the LI element according to its children IMG element attr width. What i did is loop through the jquery collection looking for the width attribute value. with your plugin it would be just var newWidth = $('li.hello').attrs('width'); $('li.hello').animate({width: newWidth},slow); Am i correct? On Fri, May 9, 2008 at 5:40 AM, Brandon Aaron [EMAIL PROTECTED] wrote: jQuery.batch is a small extension (951 bytes min'd, 520 bytes gzipped) to jQuery that allows you to batch the results of any jQuery method, plugin into an array. By default the batch plugin aliases the getter methods in jQuery by adding an 's' to the end (attrs, offsets, vals ...). You can also just call $(...).batch('methodName', arg1, arg*n). Download: http://plugins.jquery.com/project/batch Blog post: http://blog.brandonaaron.net/2008/05/08/jquery-batch/ -- Brandon Aaron -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: New object based on existing / Or understanding $.extend
There's a bit of an oddity here (actually I think it's a bug, but still...). Starting with what you need to do - specifically, to be able to add items to dupe.list): var dupe = $.extend(true, {list:[]}, $.fn.test.orig); Then dupe.list.push(...) will not change $.fn.test.orig. Why? Setting the first argument to extend() as the boolean 'true' tells extend() to do a so-called 'deep' extend. But don't get too excited because it's not really a deep extend at all! In non-deep mode, extend() does a shallow 'clone' - one level only, so if the original object contains arrays/objects they get copied by reference. In deep mode, extend() will go one level further (ie. 2 levels, but no more!). *However* there's a big gotcha here, in that in order for the second level 'cloning' to work, the target object *must already contain* the first level item! So, as an example... var x = {one:'fred',two:['a','b']}; var y = $.extend(true,{}, x); // boolean as first arg means 'deep' y.two.push('c'); // changes x.two as well! //so the 'deep' didn't help, so let's try... var z = $.extend(true, {two:[]}, x); z.two.push('d'); // leaves x.two as ['a', 'b', 'c'] - yes! Conclusion: - if your original object contains objects/arrays, you can't extend() it into an empty object - you have to extend() into a 'prepared' object - 'deep' isn't really deep at all, simply one extra level On May 9, 6:48 am, boermans [EMAIL PROTECTED] wrote: Stretching my grasp of JavaScript here... Please view source of this for context:http://static.fusion.com.au/ollie/jquery/extend/test.html $.fn.test = function() { // Creating what I thought was a new object var dupe = $.extend({},$.fn.test.orig); // Adding item to array in my 'new' object dupe.list.push('item'); // Success console.log(dupe.list); // but... I didn’t intend to add the list item to my original console.log($.fn.test.orig.list); return this; }; $.fn.test.orig = { list : [] }; I have created an object based on another object. (At least I thought I did...) When I attempt to manipulate my new object I discover the original object has also been changed. Therefore I presume my new object is actually a reference to the original. If not $.extend, how would I add the empty 'list' array (in reality a bunch of properties) to my 'dupe' as a new separate object that can be manipulated independent of the original?
[jQuery] Re: Getting Parent Element using this
If there is as little control over the markup as is implied then a more generic solution might be applicable (untested!)? function updateQuote(el){ //$('form') could be cached, and may not need to store parentForm... var parentForm = $('form').filter(function(){ var i = this.elements.length; while((i--) this.elements[i] !== el){} return (i = 0); }); parentForm.attr('action', ''); //whatever... } select onchange='updateQuote(this);' Since there seems to be concern over HTML changing (without due care and attention?) then it's possible that the structure could be changed to place the select within one (or more) tables within the form, or even just to make the markup valid!, which would nullify one or other function call in parents('table:first').children('form:first'). One can only go so far, to protect other people from themselves. On May 9, 1:54 am, Michael Geary [EMAIL PROTECTED] wrote: With markup as invalid as that, it's no surprise that elements are not where you expect them in to be in the DOM. A FORM element can't be sandwiched in between a TABLE and TR like that. So the browser tries to turn this into something it can work with. It may shuffle things around, or just put up with the incorrect structure, or whatever. And yeah, it may be different from one browser to another. But I think you mentioned that you're stuck with working with the HTML as it is, so lucky you, you get to deal with the aftermath. :-( -Mike ok, i'm not sure if this is the easiest way, however, this is how I got the form action in the following HTML: table width=460 border=0 cellspacing=0 cellpadding=0 tr valign=top td table width=100% border=0 cellpadding=0 cellspacing=0 tr td valign=top colspan=2 table border=0 cellspacing=1 cellpadding=3 width=100% form Method=Post Action=phoenix.zhtml?c=69181p=IROL- irhomet=SwitchQuote tr class=modBgQuoteShrtTicker td colspan=4 nowrap=nowrap span class=modQuoteShrtTicker Select name=control_Symbol ONCHANGE=updateQuote(this); option value=1 SELECTED=opt 1/option option value=2opt 2/option /Select /span /td /tr /form I used: var formAction = $ (elm).parents('table:first').children(form:first).attr(action); For some reason, it misses the form object on the way back using parents so i move forward after hitting the FORM's parent to get the form. Not sure if this is browser specific, but definitely a headache. (and the terrible HTML syntax doesn't help either)
[jQuery] fastest way to edit a select
Hi :) what is the fastest way to edit a select item? I need to show some option's and hide some others, depending on the value of another select. let's say if the user selects a country for his holiday, in the '#hotel_paese' select, the '#hotel_destinazione' select will show only the hotels of that country. problem is that the '#hotel_destinazione' select has already got its values, so I'm using the class attribute to keep track of the country. so if, say, egypt has code '001', then sharm el sheik, abu simbel, aswan, luxor, and so on will all have class '001'. the .show() and .hide() methods seem to be a little too slow. or maybe is my code? // this is the select $('#hotel_paese').change(function(){ var $this = $(this); var sel_val = $this.val(); $('#hotel_destinazione option').show() if (sel_val != '') $('#hotel_destinazione option').not('.' + sel_val).hide(); }); thank you very much :)
[jQuery] Re: Cycle plugin inside Tabbed Menu?
Ahh nice, thanks Mike for the pointer on that, this is for sure nice! So I assume Cycle will work more in hand with this tabbed system? Thanks for the great script and the pointer! On May 9, 2:03 am, Mike Alsup [EMAIL PROTECTED] wrote: Hitting a big wall here. I have the Cycle plugin working and have it now added into a tabbed menu as the default value for the loading tab content, using this tabbed menu script:http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/ My problem is, on load the Cycle plugin works fine, but when I click tab 2, load some content via ajax and return to tab 1 by clicking it, my cycle content turns off and it just lists all the images out, no more fading-slideshow of the images. Anyone have any ideas how to get the Cycle plugin to keep going or turn back on this sort of change of action? It seems like this flipping to a new tab and then back to cycle tab resets the js or whatnot. Any ideas much appreciated! That tab script works with a single display area. When it initializes it captures the original content HTML as a string. When you switch tabs the content of the display area is replaced with that of the new tab. When you tab back, the original content is regenerated. This kills cycle because it is now cycling elements that are no longer in the DOM. Have you considered using the jQuery Tabs Plugin? http://stilbuero.de/jquery/tabs_3/ Mike
[jQuery] Re: Href/click-parameters on asynchronous treeview
I've created a ticket #2830 containing the patch. http://dev.jquery.com/ticket/2830
[jQuery] Re: Accessing an iframe after fileupload
Many, many thanks. I drew stumps on and used the excellent Form plugin. After some tinkering around I got it to work. One warning though - having a submit button called submit caused all manner of problems - I kept getting an error 'form.submit() is not a function'. After poking around to make sure I was picking up the right form I couldn't understand why form.reset() didn't error out, but form.submit() did. Then a (rare) moment on inspiration - the submit button was called 'submit'. Changing that name and the clouds of confusion parted and the promised lands were revealed. Many thanks - i was tearing out what little hair I had left. Ben
[jQuery] Re: Accessing an iframe after fileupload
I will do that. I was aware of the plugin, but through sheer pig- headedness was trying to tackle it myself. Pride comes before a fall ... Thanks very much indeed. I will have a look through code - and perhaps stop being so pig-headed and admit defeat. Thanks Ben
[jQuery] Re: Any plugin like this one, double select boxes ???
Thanks Jason, This is what i am looking for. I have not implement it yet. Will do it ASAP. Thanks again On May 8, 2:08 pm, Jason Huck [EMAIL PROTECTED] wrote: Yes, here's one I wrote recently: http://devblog.jasonhuck.com/2008/04/25/jquery-combo-select-redux/ HTH, Jason On May 8, 3:28 pm, Vivek [EMAIL PROTECTED] wrote: Hi Guys, i am looking for an functionality in jquery. some thing like this one. Sometimes we see two big text boxes with values, one on the left side other one is on the right side and there is two arrow buttons ( faced towards left and right ) in the center of both of them with the help of those (buttons) we can move the values from one text box to other. Is there any plugin for such kind of functionality in Jquery ? Please let me know. Thanks !!
[jQuery] autocomplete
I have been experimenting with the autocomplete plugin. It is great. Loading data from a database once and then using it works just fine. In my setup the html file calls a database query and returns a comma seperated string. The string is then split up and any typing in the street input textbox shows the results in kind of like a selectbox under it. The results are seperatedly selectable. Works fine. I use the autocomplete.css, bgiframe.js, dimensions.js, and autocomplete.js files. I do it like this: $(document).ready(function() { $.post(streetnames.html,function(data,text) { var txt = data.split(,); $(#street).autocomplete(txt); }); }); Now I wanted a dynamically populated search box. Then I started on sending requests with a parameter to the server. I looked at the demo page and found several examples and options to use, but I can't find a separate list of options and their explanation, I would like to. Now I have some trouble with the results. The html file receives the parameter put in the input box and returns again a string, comma separated. The data returned are OK and the filtering works dynamically. The problem now is that the results are just crammed into the resultbox and I can only select the first result. I am using the same files as above. What am I missing here? The code goes like this: $(document).ready(function() { function formatResult(data,value) { txt = value.split(,); return txt[0]; } $(#street).autocomplete(streetnames2.html,{width: 300,selectFirst:false,formatResult: formatResult}); });
[jQuery] jeditable and validation
Hello all. Im using jeditable and the validation plugin. Ive read a previous thread at: http://www.mail-archive.com/jquery-en@googlegroups.com/msg22070.html However, there were no examples here which lead to a lot of confusion. I will just reiterate the question asked on the thread mentioned above. 1) When using jeditable plugin, how to add validate to the activated input field or textarea field for preventing some malicious people empty the data. Ive tried frantically to get this working together. My jeditable works fine. But im trying to include the validation. Ive tried putting the validation function everywhere. After several combinations, I've not got a clue to proceed. This is what I last ended up with: if ($(e.target).is('p')) { $('.blogSection p').editable(function(value, settings){ var content = value; if (content) { $.ajax({ type: POST, url: http://localhost/Paradise Calling/index.php/ BlogController/editBlog, data: blog_id= + blog_id + content= + content, dataType: html, success: function(data){ } //error:function(xhr,err,e){ alert( Error: + err ); } }); // $.ajax() return (value); } else { $(this + ' form').validate({ errorPlacement: function(error, element) { error.insertAfter( element.next() ); }, rules: { content: { required: true, minlength: 5 } }, messages: { content: { required: 'Please enter a comment header', minLength: 'Must be at least 5 characters' } } }); // .validate() }
[jQuery] nyromodal and livequery
Hey there, I just checked out nyromodal, and it looks pretty cool. I just wanted to know if it was possible to use it with livequery, so that i can use it after an ajax request. ie i do a search and the results of that search are put into the #content container. then I would like to be able to click a link in that and set it up with a nyromodal. thanks for any help.
[jQuery] Re: Dynamically Filter List
Ahh.. this is a much better implementation! Thank you so much! Mark On May 5, 2:22 am, Wizzud [EMAIL PROTECTED] wrote: Depends what you want the list to finally contain (as opposed to being visible, that is). Here's an alternative... $(document).ready(function() { var arr = ['C+ +','D','HTML','CSS','C#','PHP','Python','XML','JavaScript','Photoshop'] , alc = [] , list = $('#list'); $.each(arr, function(i,v){ list.append('li'+v+'/li'); alc[i] = v.toLowerCase(); }); list = $('li', list); $('#filter').keyup(function(){ var v = this.value ? this.value.toLowerCase() : 0; list.each(function(i){ $(this)[v alc[i].indexOf(v) == -1 ? 'hide' : 'show'](); }); }); }); This doesn't change the list contents, simply hides those elements not relevant to the value of the filter input box. It also stores the lowercase options up front, and stores the object of all the list elements so that the keyup handler doesn't have to go find them each time it runs. Mark wrote: Hi... so I'm new to jQuery. I'm using it to dynamically filter a list... I'm wondering if this is the best/most efficient method to go about doing it: html head titlejquery test/title script type=text/javascript src=js/jquery-1.2.3.min.js/ script script type=text/javascript $(document).ready(function() { var arr = ['C+ +','D','HTML','CSS','C#','PHP','Python','XML','JavaScript','Photoshop']; for(i=0; iarr.length; ++i) { $('#list').append('li'+arr[i]+'/li'); } $('[EMAIL PROTECTED]').keyup(function() { $('#list').empty(); for(i=0; iarr.length; ++i) { if($ ('[EMAIL PROTECTED]').attr('value')==undefined|| arr[i].toLowerCase().indexOf($ ('[EMAIL PROTECTED]').attr('value').toLowerCase())!=-1) { $('#list').append('li'+arr[i] +'/li'); } } }); }); /script /head body ul id=list/ul input name='filter' id=filter/ /body /html See it in action:http://mechaflora.com/programming/filter Any suggestions on how I can do this better would be appreciated :) Or feel free to use the code for your own purposes if you think it's good.
[jQuery] autocomplete
A follow up to my last post. I was interpreting the fomatting options (I found the list of options!) wrongly. I had to do the processing of the list items in the server-side script in a better way and then it all works. No formatting options needed for returning the right results.
[jQuery] Re: old tablesorter works, new one doesn't
Thanks, and sorry for asking such an elementary question. I had assumed that nothing fundamental like that would be likely to change, and that I therefore had done something else wrong. This tool looks really slick, btw. On May 9, 2:31 am, Christian Bach [EMAIL PROTECTED] wrote: Check out the docs @http://tablesorter.com The constructor name is know lowercased to .tablesorter(); /c 2008/5/9 lamp5matt [EMAIL PROTECTED]: I inherited an app with a lot of tablesorter implementations, but wanted the zebra functionality -- alternating css-styled rows -- so i upgraded. Now I'm getting Error: $(#writer-table).tableSorter is not a function If I revert to the jquery.tablesorter.js file that I inherited (not sure what version, but at least 6 mos. old), it works but no zebra functionality.
[jQuery] Custom images for radio and checkboxes?
I remember seeing a newer plugin for this recently and cannot find it now for the like of me. Can someone help jog my memory?
[jQuery] jQuery Ajax content
Hi, iam loading with the jQuery Tab UI in touch with the ajax function, remote dynamic content. After jQuery has load the content, i would like to use jQuery over again in my template. But , i cant use jQuery again in ajax loaded content ... ! Is there a way to solve this problem? vince
[jQuery] Re: Cycle plugin inside Tabbed Menu?
Ahh nice, thanks Mike for the pointer on that, this is for sure nice! So I assume Cycle will work more in hand with this tabbed system? Yes and no. The fade transition works reliably, but transitions that manipulate the z-index (which is most of them) don't work well with tabs. I need to look into that. Here's a demo: http://www.malsup.com/jquery/cycle/tabs.html Mike
[jQuery] jquery.slideviewerpro
Hello friends, i've made another image gallery engine with jQuery. It is a new version of slideViewer, and can be tested here: http://www.gcmingati.net/wordpress/wp-content/lab/jquery/svwt/index.html I think i'll call it slideViewerPro. Features: - generates a sliding gallery for images on top of a SINGLE unordered list with a given ID - generates a sliding thumbnails menu with customizable: scale, effect, number of elements, custom left/right buttons - customizable skin for buttons and typographic information - cutomizable easing function and time ... much more For the moment it works with IE7, FF2, Opera9 In the next few days, i'll release the final version and the documentation. Enjoy! GC
[jQuery] getJSON Callback not firing
Hey folks, I'm trying to work on some cross-site stuff, and I'm using JSON between the domains to transfer the data. In my below code, the code fires the .getJSON, and I can see the JSON in my firebug scripts tag, but the callback is not getting fired: LoadContent = $.klass({ initialize: function(options){ $loadingarea = this.element; console.log($loadingarea) $.getJSON(options.url,{q:'nfp/front'}, function(data){ console.log(data); }); } }); $(document).ready(function(){ $('#loading-area-container').attach(LoadContent, {url: 'http://nfp.dev.lightershade.com/?jsoncallback=?'}); }); At the moment, here is the data I am trying to load: ({nid:1,title:Test Entry,type:story},{nid:2,title:Test 2,type:story}) It was contained in square brackets before like [{...}], but I changed it to () based on previous entries on the group, however it still will not go into the callback function. Does anyone have any idea what's going wrong here?? Thanks Tane Piper http://digitalspaghetti.me.uk
[jQuery] Re: jquery.slideviewerpro
Hello friends, i've made another image gallery engine with jQuery. It is a new version of slideViewer, and can be tested here: http://www.gcmingati.net/wordpress/wp-content/lab/jquery/svwt/index.html I think i'll call it slideViewerPro. Very nice!
[jQuery] Re: jquery.slideviewerpro
Thanks Mike, it still miss a preloader, but it's 98% done. GC On May 9, 2:56 pm, Mike Alsup [EMAIL PROTECTED] wrote: Hello friends, i've made another image gallery engine with jQuery. It is a new version of slideViewer, and can be tested here: http://www.gcmingati.net/wordpress/wp-content/lab/jquery/svwt/index.html I think i'll call it slideViewerPro. Very nice!
[jQuery] Re: getJSON Callback not firing
Never mind, worked it out in the end. On 9 May, 13:45, Tane Piper [EMAIL PROTECTED] wrote: Hey folks, I'm trying to work on some cross-site stuff, and I'm using JSON between the domains to transfer the data. In my below code, the code fires the .getJSON, and I can see the JSON in my firebug scripts tag, but the callback is not getting fired: LoadContent = $.klass({ initialize: function(options){ $loadingarea = this.element; console.log($loadingarea) $.getJSON(options.url,{q:'nfp/front'}, function(data){ console.log(data); }); } }); $(document).ready(function(){ $('#loading-area-container').attach(LoadContent, {url: 'http://nfp.dev.lightershade.com/?jsoncallback=?'}); }); At the moment, here is the data I am trying to load: ({nid:1,title:Test Entry,type:story},{nid:2,title:Test 2,type:story}) It was contained in square brackets before like [{...}], but I changed it to () based on previous entries on the group, however it still will not go into the callback function. Does anyone have any idea what's going wrong here?? Thanks Tane Piperhttp://digitalspaghetti.me.uk
[jQuery] nyromodal and livequery
I tried to add a post previously but it didnt show up for some reason. Is it possible to use nyromodal with livequery. I was taking a look at nyromodal and it looks great, but need to use it after another ajax call. Does anyone know how I would do this? thanks Paul
[jQuery] Passing this to a function
Can i pass 'this' to a custom function from an event handler eg. $('p').('click',function() { myCustomEvent(this); }); myCustomEvent(ref) { //ref Object or JQuery object ? $.get(path_to_cgi,{name = ref.text()},function(data) { alert(Data : + data}); }
[jQuery] Re: Passing this to a function
you can do it, but this is a usual dom object, not a jquery instance... simple pass the object to through Jquery like ref = JQuery(ref); On 9 Mai, 15:32, mac.gill [EMAIL PROTECTED] wrote: Can i pass 'this' to a custom function from an event handler eg. $('p').('click',function() { myCustomEvent(this); }); myCustomEvent(ref) { //ref Object or JQuery object ? $.get(path_to_cgi,{name = ref.text()},function(data) { alert(Data : + data}); }
[jQuery] Re: The CSS will not show at the first time of mouse over
Hi Gary! i can't seem to get the same results you're describing, on a mac anyway. No, the error was on both systems. but you should preload those roll over images for the icons. or better yet, use the css 'sprite' method. basically you have both the off and on state in one image. then move the image with css when you roll over it. you define the height, width, overflow:hidden, etc in css. you'll be able to find alot of info on that on the web. Thanks for the suggestion! That's a good idea. I think I have a lot to do ;-) there's some load time when you roll over your icons, that might be effecting the clueTip? No, the error was the link-tag with a print stylesheet. Kind regards Andreas
[jQuery] Re: Superfish - modified Richard Willis
Joel, Sooo close. That worked like a charm...however, once you actually hover over the menu, the dropdowns are back to their old tricks and the active dropdowns appear. Is there any way you can think of around this? I assume this is all because of the pathClass. Is it possible to achieve the desired effect without using the pathClass at all? I've tried changing the CSS so that the 2nd tier will not be hidden, but nothing is working, so I assume something in the javascript it overriding it. Thanks for the continued help. -Drew
[jQuery] Re: [jQuery][ANN] jQuery.batch 1.0
Close but in your example newWidths is an array of numbers. In your case you'll want a way to extract the largest width from the array and then use that value to animate the li width. Maybe something like this. var width = $('li.hello img').widths().sort().revers()[0]; $('li.hello').animate({ width: width }, 'slow'); Thanks for a nice real-world example. :) In testing this I found a bug and created a new release 1.0.1. -- Brandon Aaron On Fri, May 9, 2008 at 2:08 AM, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Brandon, i believe this is a clever little plugin. I i understand correctly, here is a real life example i experienced just 2 days ago where i had such markup: li class=hello img width=316 src=photos/sombra/Image_001.jpg/ img width=629 src=photos/sombra/Image_002.jpg/ img width=630 src=photos/sombra/Image_003.jpg/ img width=638 src=photos/sombra/Image_004.jpg/ img width=631 src=photos/sombra/Image_005.jpg/ img width=630 src=photos/sombra/Image_006.jpg/ img width=629 src=photos/sombra/Image_007.jpg/ /li I needed to resize the LI element according to its children IMG element attr width. What i did is loop through the jquery collection looking for the width attribute value. with your plugin it would be just var newWidth = $('li.hello').attrs('width'); $('li.hello').animate({width: newWidth},slow); Am i correct? On Fri, May 9, 2008 at 5:40 AM, Brandon Aaron [EMAIL PROTECTED] wrote: jQuery.batch is a small extension (951 bytes min'd, 520 bytes gzipped) to jQuery that allows you to batch the results of any jQuery method, plugin into an array. By default the batch plugin aliases the getter methods in jQuery by adding an 's' to the end (attrs, offsets, vals ...). You can also just call $(...).batch('methodName', arg1, arg*n). Download: http://plugins.jquery.com/project/batch Blog post: http://blog.brandonaaron.net/2008/05/08/jquery-batch/ -- Brandon Aaron -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: [jQuery][ANN] jQuery.batch 1.0
I misspelled reverse in my code example... It should be: var width = $('li.hello img').widths().sort().reverse()[0]; $('li.hello').animate({ width: width }, 'slow'); -- Brandon Aaron On May 9, 9:47 am, Brandon Aaron [EMAIL PROTECTED] wrote: Close but in your example newWidths is an array of numbers. In your case you'll want a way to extract the largest width from the array and then use that value to animate the li width. Maybe something like this. var width = $('li.hello img').widths().sort().revers()[0]; $('li.hello').animate({ width: width }, 'slow'); Thanks for a nice real-world example. :) In testing this I found a bug and created a new release 1.0.1. -- Brandon Aaron On Fri, May 9, 2008 at 2:08 AM, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Brandon, i believe this is a clever little plugin. I i understand correctly, here is a real life example i experienced just 2 days ago where i had such markup: li class=hello img width=316 src=photos/sombra/Image_001.jpg/ img width=629 src=photos/sombra/Image_002.jpg/ img width=630 src=photos/sombra/Image_003.jpg/ img width=638 src=photos/sombra/Image_004.jpg/ img width=631 src=photos/sombra/Image_005.jpg/ img width=630 src=photos/sombra/Image_006.jpg/ img width=629 src=photos/sombra/Image_007.jpg/ /li I needed to resize the LI element according to its children IMG element attr width. What i did is loop through the jquery collection looking for the width attribute value. with your plugin it would be just var newWidth = $('li.hello').attrs('width'); $('li.hello').animate({width: newWidth},slow); Am i correct? On Fri, May 9, 2008 at 5:40 AM, Brandon Aaron [EMAIL PROTECTED] wrote: jQuery.batch is a small extension (951 bytes min'd, 520 bytes gzipped) to jQuery that allows you to batch the results of any jQuery method, plugin into an array. By default the batch plugin aliases the getter methods in jQuery by adding an 's' to the end (attrs, offsets, vals ...). You can also just call $(...).batch('methodName', arg1, arg*n). Download:http://plugins.jquery.com/project/batch Blog post:http://blog.brandonaaron.net/2008/05/08/jquery-batch/ -- Brandon Aaron -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: jeditable and validation
On May 9, 2008, at 12:36 PM, Krz wrote: 1) When using jeditable plugin, how to add validate to the activated input field or textarea field for preventing some malicious people empty the data. Ive tried frantically to get this working together. My jeditable works fine. But im trying to include the validation. Ive tried putting the validation function everywhere. After several combinations, I've not got a clue to proceed. This is what I last ended up with: I made a small change to Jeditable. Download from URL below. Jeditable will now abort submitting form if custom inputs call before submit hook returns false. http://tinyurl.com/678scb Word of warning. This change is EXPERIMENTAL. I am not 100% happy with it. I just wanted to help you out and this seemed a quick solution. I might do some changes on how it works after testing. Anyways, this change enables you to write code like below: -cut- $.editable.addInputType('validate', { element : $.editable.types.text.element, submit : function(settings, original) { var validation_failed = true; /* Validate here... */ if (validation_failed) { original.editing = false; $(original).html(original.revert); return false; } } }); -cut- and then -cut- $(.editable_select).editable(?php print $url ?save.php, { type : validate, submit : OK, }); -cut- -- Mika Tuupola http://www.appelsiini.net/
[jQuery] Re: [jQuery][ANN] jQuery.batch 1.0
Hi Brandon! in your blog post you ask for suggested features. Frankly i'm stunned by how in one line you addition all the widths values (although i didn't expect less from you). Personally, I had to loop through the returned array in order to achieve that. Wouldn't it be a nice feature to add some built-in manipulations to the batch? i'm thinking 'sum' to add them all and return the result, 'concat', 'join:,' to join each with a comma in-between, 'average' to get the average of all integer values, etc. a kind of built-in callbacks if you like for most common operations. $('li.hello img').widths('sum'); thank you! alexandre On Fri, May 9, 2008 at 5:01 PM, Brandon Aaron [EMAIL PROTECTED] wrote: I misspelled reverse in my code example... It should be: var width = $('li.hello img').widths().sort().reverse()[0]; $('li.hello').animate({ width: width }, 'slow'); -- Brandon Aaron On May 9, 9:47 am, Brandon Aaron [EMAIL PROTECTED] wrote: Close but in your example newWidths is an array of numbers. In your case you'll want a way to extract the largest width from the array and then use that value to animate the li width. Maybe something like this. var width = $('li.hello img').widths().sort().revers()[0]; $('li.hello').animate({ width: width }, 'slow'); Thanks for a nice real-world example. :) In testing this I found a bug and created a new release 1.0.1. -- Brandon Aaron On Fri, May 9, 2008 at 2:08 AM, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Brandon, i believe this is a clever little plugin. I i understand correctly, here is a real life example i experienced just 2 days ago where i had such markup: li class=hello img width=316 src=photos/sombra/Image_001.jpg/ img width=629 src=photos/sombra/Image_002.jpg/ img width=630 src=photos/sombra/Image_003.jpg/ img width=638 src=photos/sombra/Image_004.jpg/ img width=631 src=photos/sombra/Image_005.jpg/ img width=630 src=photos/sombra/Image_006.jpg/ img width=629 src=photos/sombra/Image_007.jpg/ /li I needed to resize the LI element according to its children IMG element attr width. What i did is loop through the jquery collection looking for the width attribute value. with your plugin it would be just var newWidth = $('li.hello').attrs('width'); $('li.hello').animate({width: newWidth},slow); Am i correct? On Fri, May 9, 2008 at 5:40 AM, Brandon Aaron [EMAIL PROTECTED] wrote: jQuery.batch is a small extension (951 bytes min'd, 520 bytes gzipped) to jQuery that allows you to batch the results of any jQuery method, plugin into an array. By default the batch plugin aliases the getter methods in jQuery by adding an 's' to the end (attrs, offsets, vals ...). You can also just call $(...).batch('methodName', arg1, arg*n). Download:http://plugins.jquery.com/project/batch Blog post:http://blog.brandonaaron.net/2008/05/08/jquery-batch/ -- Brandon Aaron -- Alexandre Plennevaux LAb[au] http://www.lab-au.com -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: $(document).ready(function() { giving error $ is not a function - what am I doing wrong?
A little more specific: You're using jQuery.noConflict() which allows you to use the variable jQuery jQuery(document).ready( function() { jQuery(#sliding_cart).css({ display: none}); }); then later in your doc, you're using $ which is the same thing, if you're not using jQuery.noConflict(). However, it's one or the other, not both. $(document).ready(function() { $(a).click(function(){ alert(Thanks for visiting!); }); }); If you're using Prototype.js or any other JS Library that may use $, then you need noConflict. If you're sure you'll never use any other JS Library, then drop the noConflict and use $ instead of jQuery variable everywhere. If you're using some plugins or third party script asking you to use noConflict for any reason, then use jQuery instead of $ (like those guys: http://blog.evaria.com/wp-content/themes/blogvaria/jquery/index-multi.php). Fred
[jQuery] Re: List ul slideDown/Up Menu
Hi, thanks for the reply. I've uploaded what I had to my test site. http://admin.stma.k12.mn.us/_assets/template/new.tpl.html I thought the code would get the child ul, entire sub-menu, and slide up/down. Also looked at Accordion but thought it was more than I needed. Since, I already have the menu working with CSS I just wanted to add the slide down/up feature. On May 8, 7:29 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, Panman! Welcome. It would help if you posted a link to your work page. Without seeing your actual code, it looks like you have every second- child li sliding up down with every mouseover, which would kind of explain the problem ;) To make life easy you could use the jQuery UI Accordion plugin; seehttp://ui.jquery.com/andhttp://bassistance.de/jquery-plugins/jquery-plugin-accordion/ . Alternatively, use an each or an iteration or a class/id to allow jQuery select the item you want expanded. Panman wrote: Hi, new to jQuery and very impressed. I already have a CSS menu that shows/hides a list menu. However, I'd like to add more dynamics and have the sub menus slide down and back up. So using the below code, I've got it to slide down and up, but repeatedly. It seems like it wants to keep sliding for each li and even multiple times per hover. Seems like it should be easy... Any ideas? $('#Main_Nav ul li').mouseover(function() { $(this).children('ul').slideDown('normal'); }).mouseout(function() { $(this).children('ul').slideUp('normal'); }).end(); Here is a link to the type of CSS menu I have: http://meyerweb.com/eric/css/edge/menus/demo.html However, I only have two levels of lists. Ex: ul liabc/li liabc ul liabc/li liabc/li /ul /li liabc/li /ul
[jQuery] Re: Getting Parent Element using this
Could you possibly just give your form an id attribute? Then onchange you could just return $(#myformid).attr(action) and not have to mess with any traversing. -- Josh - Original Message - From: briandichiara [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, May 08, 2008 1:58 PM Subject: [jQuery] Re: Getting Parent Element using this Ok, I tried this: $(elm).parents().map(function () { alert(this.tagName); }); but the FORM never shows up. Reason is because the source looks like this: There's no need for any of this; elements of a form (input, select, textarea) has a form property, so: form action=something select name=some_name onchange=changeAction(this); !-- some options -- /select /form function changeAction(elm){ var formAction = elm.form.action; ... } And, as others have suggested, it's a better practice to do this all in JavaScript, so that becomes: form action=something select id=some_select name=some_name !-- some options -- /select /form jQuery(document).ready(function() { jQuery('select#some_select').change(function() { var formAction = this.form.action; ... }); }); -- hj
[jQuery] Ajax: Posting Xml Data
Hi, I am trying to post an XML string back to an ASP.net page. The XML string is created in the client code and I am trying to use the jQuery.ajax() method... $.ajax({ type : POST, url : AjaxHandlerPage.aspx, data : { method : Save, data : xmlString }, contentType: text/xml, processData: false, dataType : json, cache : false, success : function(data) { // Process data here } }); When I call this method, I get a jQuery error s.data.match is not a function. If I remove the processData: false property the method runs, but I get a server error (I don't think I'm correctly processing the data on the server e.g. Request.Forms[method] does not work in this instance). So, in summary, I think I have two problems: 1) I don't know the correct way to post the XML data, and... 2) I don't know how to process (server-side) if I did! Does anyone have any experience in this process that they could share with me? Thanks.
[jQuery] ajax calls don't work in firefox 3 beta 4
I've got some code with post ajaxForm calls in it that work fine in IE and FF 2, but not firefox 3. Using firebug I can see that the calls are apparently being made as they should, but for some reason never get to the server. Is this a jQuery issue or a firefox issue? i'm using the latest jquery minified release. thanks
[jQuery] Re: Howto assign $(this) to variable
Exactly, it was my intention to make a pointer to the element only :o) If I trace both elements in firebug, it highlights same element. That's what confused/tricked me. Anyway I read into it, and apparently $(this) and this is two different instances of the same element. $(this) pointing to the element object and this pointing to the DOM element if I'm correct. Solution: var foo = false; $('div span').each(function() { foo = this; // debugging in firebug console.log(this, foo); console.log(this == foo); }); Thanks for your help :o) On 8 Maj, 23:36, mrpollo [EMAIL PROTECTED] wrote: actually you are not cloning your element, you are just making a pointer of the element in this line foo = $(this); so its not the same element, its just a pointer comparing with an actual element DOM object you can see it live in action in this site if you have firebug http://x1fm.com/music/blog run your code var foo = false; jQuery('div div div div div div div div div').each(function() { foo = jQuery(this); // debugging in firebug console.log(jQuery(this), foo); console.log(jQuery(this) == foo); }); if you get div's out of the initial selector you are going to get more results but i think with those its just fine for now in the firebug console check the results and get your mouse over the elements that the trace did, you are going to see that one of them actually gets highlighted in the rendered web page and the other doesn't, but if you do click on them you are getting for sure the same result, so you may want to look to another way around the problem you were trying to solve with your solution unless im really wrong, and if i am please guys correct my path On May 8, 12:58 pm, Jong [EMAIL PROTECTED] wrote: Hi, I'm pretty new to jQuery, and I have stumbled across a weird problem. It may just be me fooling around, anyway here goes... var foo = false; $('div span').each(function() { foo = $(this); // debugging in firebug console.log($(this), foo); console.log($(this) == foo); }); You should, at least I am, think it's the same element, although it returns false! I cannot figure out why.
[jQuery] Re: jQuery TShirt
love it. I'd prefer something clever with code on it than just the logo. just the way i eval... On May 9, 5:16 am, Josh Nathanson [EMAIL PROTECTED] wrote: It would be cool if said something like: $(code).less(); ...in Courier typeface...and then had the jQuery logo on it. -- Josh - Original Message - From: Mike Branski [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, May 08, 2008 11:36 AM Subject: [jQuery] Re: jQuery TShirt Agreed! A darker blue with white text would look good (design pending). On May 8, 10:32 am, Andy Matthews [EMAIL PROTECTED] wrote: PLEASE PLEASE PLEASE offer colors other than just black!! -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Resig Sent: Thursday, May 08, 2008 10:24 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery TShirt There's one in the works right now - we're sending it to the producer and will have a store to go along with it. We'll definitely make an announcement when it's ready. --John On Thu, May 8, 2008 at 8:09 AM, CVertex [EMAIL PROTECTED] wrote: I noticed captain John Resig wearing a few nice threadless.com tshirts, and he mentioned a few times in a recent talk that they were selling jQuery tshirts in this or that place. I was wondering if anyone knew of any jQuery tshirts that were around? What would you put on your jQuery T? $(body) -CV
[jQuery] Using JQ Jcarousel with JQdock effect
Im trying to integrate some features of this dock effect: http://icon.cat/software/iconDock/0.8b/dock.html (*great work Isaac!) specifically the enlarge (shrink of neighboring elements) and image src replace, with a standard carousel, but cant seem to execute both - I would like to have the carousel work as it is now, but on rollover of one of the 3 images that image would zoom, replace with the larger src, while the other 2 would reduce in size. Im thinking this is a matter of having the right containing elements given how each script is written- perhaps the dock script can be pared down to eliminate the functionality I dont need and play nice with the carousel. Any ideas?? -Adam
[jQuery] Re: [jQuery][ANN] jQuery.batch 1.0
Oh ... you want to make sure the width of the li adds up to the width of all the images? The earlier snippet just made sure the li was as wide as the widest image. You could do something like this to add up all the widths. var width = 0; $.each( $('li.hello img').widths(), function(i,w){ width += w; }); $('li.hello').animate({ width: width }, 'slow'); As for the feature suggestion ... I think it is an interesting idea. It might be a little out of scope for this little extension/plugin but I'll have to give it some more thought. Most of the things you mentioned are already very easy to do with arrays and probably easy to extend the Array object to do them otherwise. -- Brandon Aaron On Fri, May 9, 2008 at 10:57 AM, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Hi Brandon! in your blog post you ask for suggested features. Frankly i'm stunned by how in one line you addition all the widths values (although i didn't expect less from you). Personally, I had to loop through the returned array in order to achieve that. Wouldn't it be a nice feature to add some built-in manipulations to the batch? i'm thinking 'sum' to add them all and return the result, 'concat', 'join:,' to join each with a comma in-between, 'average' to get the average of all integer values, etc. a kind of built-in callbacks if you like for most common operations. $('li.hello img').widths('sum'); thank you! alexandre On Fri, May 9, 2008 at 5:01 PM, Brandon Aaron [EMAIL PROTECTED] wrote: I misspelled reverse in my code example... It should be: var width = $('li.hello img').widths().sort().reverse()[0]; $('li.hello').animate({ width: width }, 'slow'); -- Brandon Aaron On May 9, 9:47 am, Brandon Aaron [EMAIL PROTECTED] wrote: Close but in your example newWidths is an array of numbers. In your case you'll want a way to extract the largest width from the array and then use that value to animate the li width. Maybe something like this. var width = $('li.hello img').widths().sort().revers()[0]; $('li.hello').animate({ width: width }, 'slow'); Thanks for a nice real-world example. :) In testing this I found a bug and created a new release 1.0.1. -- Brandon Aaron On Fri, May 9, 2008 at 2:08 AM, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Brandon, i believe this is a clever little plugin. I i understand correctly, here is a real life example i experienced just 2 days ago where i had such markup: li class=hello img width=316 src=photos/sombra/Image_001.jpg/ img width=629 src=photos/sombra/Image_002.jpg/ img width=630 src=photos/sombra/Image_003.jpg/ img width=638 src=photos/sombra/Image_004.jpg/ img width=631 src=photos/sombra/Image_005.jpg/ img width=630 src=photos/sombra/Image_006.jpg/ img width=629 src=photos/sombra/Image_007.jpg/ /li I needed to resize the LI element according to its children IMG element attr width. What i did is loop through the jquery collection looking for the width attribute value. with your plugin it would be just var newWidth = $('li.hello').attrs('width'); $('li.hello').animate({width: newWidth},slow); Am i correct? On Fri, May 9, 2008 at 5:40 AM, Brandon Aaron [EMAIL PROTECTED] wrote: jQuery.batch is a small extension (951 bytes min'd, 520 bytes gzipped) to jQuery that allows you to batch the results of any jQuery method, plugin into an array. By default the batch plugin aliases the getter methods in jQuery by adding an 's' to the end (attrs, offsets, vals ...). You can also just call $(...).batch('methodName', arg1, arg*n). Download:http://plugins.jquery.com/project/batch Blog post:http://blog.brandonaaron.net/2008/05/08/jquery-batch/ -- Brandon Aaron -- Alexandre Plennevaux LAb[au] http://www.lab-au.com -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: jQuery TShirt
Something like: $('people:female').find('girlfriend') = [] -- Brandon Aaron On Fri, May 9, 2008 at 10:33 AM, CVertex [EMAIL PROTECTED] wrote: love it. I'd prefer something clever with code on it than just the logo. just the way i eval... On May 9, 5:16 am, Josh Nathanson [EMAIL PROTECTED] wrote: It would be cool if said something like: $(code).less(); ...in Courier typeface...and then had the jQuery logo on it. -- Josh - Original Message - From: Mike Branski [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, May 08, 2008 11:36 AM Subject: [jQuery] Re: jQuery TShirt Agreed! A darker blue with white text would look good (design pending). On May 8, 10:32 am, Andy Matthews [EMAIL PROTECTED] wrote: PLEASE PLEASE PLEASE offer colors other than just black!! -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Resig Sent: Thursday, May 08, 2008 10:24 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery TShirt There's one in the works right now - we're sending it to the producer and will have a store to go along with it. We'll definitely make an announcement when it's ready. --John On Thu, May 8, 2008 at 8:09 AM, CVertex [EMAIL PROTECTED] wrote: I noticed captain John Resig wearing a few nice threadless.com tshirts, and he mentioned a few times in a recent talk that they were selling jQuery tshirts in this or that place. I was wondering if anyone knew of any jQuery tshirts that were around? What would you put on your jQuery T? $(body) -CV
[jQuery] Re: List ul slideDown/Up Menu
not sure but you could try something like this, to get more specific... $('#Main_Nav li:has(ul)').mouseover(function(e) { e.stopPropagation(); $(this).children('ul').slideDown('normal'); }).mouseout(function(e) { e.stopPropagation(); $(this).children('ul').slideUp('normal'); }); btw you don't need the .end() method at the end ;)
[jQuery] Re: Ajax: Posting Xml Data
On 9 Mag, 17:17, NeilM [EMAIL PROTECTED] wrote: success : function(data) { // Process data here } what is this function supposed to do? it seems that it doesn't get the correct data (like the data var is empty or something). are you sure that your serverside script gives the correct answer? and what about the xmlString you're sending via post? is it exactly what the server is expecting? :)
[jQuery] Label Change Event
Hi, I'm using JQuery in Asp.NET 2.0, and I want to catch one event when a label change, what event should I catch? Best Regards, Pedro Camacho
[jQuery] JQuery Validator OR Operater
Hello Everyone, I've done some searching and am unable to find information on using an OR operator in the JQuery Validator plugin. I have two fields (for sake of argument) and before the form is valid at least one field must be filled in. They are nameFirst and nameLast. There may be a simple answer to this but I am just lost. I am competent enough with the Validator plugin to setup comparison rules, length rules, etc. just haven't been able find any OR operator information yet. Any help is greatly appreciated! Thanks! Jimmy
[jQuery] autocomplete onSelectItem
Hi, I'm trying the autocomplete plugin from: http://www.pengoworks.com/workshop/jquery/autocomplete.htm I have a problem with the onSelectItem option that I suppose it will be triggered when I select a value, right? So i would like to do something when the value is selected, but It doesn't work with my code: script type='text/javascript' jQuery(document).ready(function($){ $(#searchbox).autocomplete(db.php, { minChars:2, maxItemsToShow:25, cacheLength:10, onSelectItem:function(){ alert('Hello'); }, autoFill:true }); }); /script input type=text name=myinput id=searchbox class=ac_input Everything works fine but the onSelectItem option seems to do nothing, any ideas? thank you very much Michele
[jQuery] Re: Ajax: Posting Xml Data
Yes, the xml structure at this stage (testing) is very simple, but the page throws and error before it gets to look at the data. The server returns a json string of the format {status: success} or {status: error} which would then be processed by the 'success' script. What seems odd is that jQuery throws an error before initiating the ajax call if I set the property 'processData: false' in the initialisation. For reference, the test xml is constructued as follows: var xml = menumenuItem name='Item 1' /menuItem name='Item 2' // menu; On May 9, 5:28 pm, andrea varnier [EMAIL PROTECTED] wrote: On 9 Mag, 17:17, NeilM [EMAIL PROTECTED] wrote: success : function(data) { // Process data here } what is this function supposed to do? it seems that it doesn't get the correct data (like the data var is empty or something). are you sure that your serverside script gives the correct answer? and what about the xmlString you're sending via post? is it exactly what the server is expecting? :)
[jQuery] Re: $(document).ready(function() { giving error $ is not a function - what am I doing wrong?
On Fri, May 9, 2008 at 10:21 AM, Fred P [EMAIL PROTECTED] wrote: A little more specific: You're using jQuery.noConflict() which allows you to use the variable jQuery Pardon me for being a little pedantic: jQuery.noConflict does not allow you to use the variable jQuery. The jQuery variable is there either way. If not, you couldn't call jQuery.noConflict() ;) jQuery.noConflict allows you to use the $ alias for something other than jQuery, by returning it to its previously defined value. Another option should be mentioned (for completeness). If you have a bunch of javascript/jQuery code that's already written to use the $, and you don't want to search and replace the $ with jQuery, you can use the following pattern to have the $ alias be jQuery inside a block with all your jQuery code, after calling jQuery.noConflict: (function($) { // Inside this block, $ is the jQuery object // not the other $ })(jQuery); - Richard
[jQuery] Preventing text field focus() when user tabs to field...
I'm working on an input field where I need to disable the browser from automatically doing this.select() on an input text field. In a nutshell, I've got an input box I basically am treating like a masked input. The reason is I'm manually pre-selecting a text range. If I invoke my function to pre-select the correct text asynchronously (via setTimeout) it works correctly, but you get a very brief flash as the browser natively does a select() on the text already in the input field. I've tried using both e.preventDefault() and e.stopPropagation(), but neither stopped the behavior in FF. Returning false doesn't prevent the behavior either. Here's basically what the code looks like: $(input#myField).bind(focus, function (){ setTimeout(function (){ // preselect just the first 2 chars setSelection(this, 0, 2); }, 0); }); // set the text selected in a text field function setSelection(field, start, end) { if( field.createTextRange ){ var selRange = field.createTextRange(); selRange.collapse(true); selRange.moveStart(character, start); selRange.moveEnd(character, end); selRange.select(); } else if( field.setSelectionRange ){ field.setSelectionRange(start, end); } else { if( field.selectionStart ){ field.selectionStart = start; field.selectionEnd = end; } } field.focus(); }; Does anyone know of a trick to completely prevent FF from trying to select all the text in a field automatically? -Dan
[jQuery] Re: remove() works differently in 1.5b4, at least for UI Dialogs
This sounds like you're adding in content that you should be adding in (via ajax) or you're not removing your old dialogs when you should. Can you post a sample page that shows what you're doing? On May 8, 11:37 am, snobo [EMAIL PROTECTED] wrote: I stumbled upon a tricky situation. In my app, I use UI Dialogs based on my form's. When a dialog is created, it takes the form out of the HTML context where it was originally located, moves before the closing /body tag and wraps it with all these dialog divs, buttons etc. But when my AJAX calls replace body content with a new HTML, the problem occurs that now I have TWO identical forms in the DOM: one that was just returned with AJAX call, and another one that remains in this ghost dialog stuck in the end of the body. This makes a mess and also leads to creating duplicated dialogs... So, before creating a dialog, I previously had to check for existence of those ghost dialogs: if ($('.ui-dialog '+pid).length) $('.ui-dialog '+pid).parents('.ui- dialog').remove(); where pid is the id of my form that the dialog is made of. Now, after upgrading to 1.5b4, it turned out that remove() works differently! It doesn't remove the $('.ui-dialog '+pid).parents('.ui- dialog'), which is a main dialog div, from DOM! Instead, it kinda destroys the dialog, stripping all its divs and buttons, and leaving my original form hanging in the air, still stuck in the end of the body... Maybe it's because UI Dialogs have their own remove() method and it replaces general jQuery remove-from-DOM method?
[jQuery] Re: Ajax: Posting Xml Data
What seems odd is that jQuery throws an error before initiating the ajax call if I set the property 'processData: false' in the initialisation. I think you've misunderstood the use of the processData option. That option lets the ajax function know whether it should convert the data arg to an encoded string or if that has already be done by the caller. You need your data to be processed because it is not in a format that can be sent to the server. It is a JavaScript object (which happens to contain some XML). In addition, the contentType setting is also wrong. Your content is not XML, is just happens to contain some. You should be using the default x-www-form-urlencoded content type. So your post data would ultimately look something like: method=Savedata=%3Cmenu%3E%3CmenuItem+name%3D'Item+1'+%2F%3E%3CmenuItem+name%3D'Item+2'+%2F%3E%3C%2Fmenu%3E Mike
[jQuery] Re: jQuery TShirt
On the front: $(WWW).append(jQuery) And on the back: $(prototype, mootools, dojo, yui, etc.).remove(); *grin*
[jQuery] Re: autocomplete onSelectItem
It's onItemSelect, not onSelectItem (the docs are wrong.) -Dan -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of michelem Sent: Friday, May 09, 2008 12:11 PM To: jQuery (English) Subject: [jQuery] autocomplete onSelectItem Hi, I'm trying the autocomplete plugin from: http://www.pengoworks.com/workshop/jquery/autocomplete.htm I have a problem with the onSelectItem option that I suppose it will be triggered when I select a value, right? So i would like to do something when the value is selected, but It doesn't work with my code: script type='text/javascript' jQuery(document).ready(function($){ $(#searchbox).autocomplete(db.php, { minChars:2, maxItemsToShow:25, cacheLength:10, onSelectItem:function(){ alert('Hello'); }, autoFill:true }); }); /script input type=text name=myinput id=searchbox class=ac_input Everything works fine but the onSelectItem option seems to do nothing, any ideas? thank you very much Michele
[jQuery] Re: jquery.slideviewerpro
Playing with the script some more, i discovered a bug: when created, the first gallery sets wrongly the content above the image (the red box). COntents are pulled from the alt= images' attribute. today it's friday, i'll think about it on monday. but i must admit myself, i am pretty satisfied about the result; it could be an anternative. Have a nice weekend GC On May 9, 3:16 pm, GianCarlo Mingati [EMAIL PROTECTED] wrote: Thanks Mike, it still miss a preloader, but it's 98% done. GC On May 9, 2:56 pm, Mike Alsup [EMAIL PROTECTED] wrote: Hello friends, i've made another image gallery engine with jQuery. It is a new version of slideViewer, and can be tested here: http://www.gcmingati.net/wordpress/wp-content/lab/jquery/svwt/index.html I think i'll call it slideViewerPro. Very nice!
[jQuery] Re: jQuery TShirt
Isn't it more like? alert( $('people:female').find('girlfriend').length == 0 ? 'l33t' : 'normal' ) -js On Fri, May 9, 2008 at 11:11 AM, Brandon Aaron [EMAIL PROTECTED] wrote: Something like: $('people:female').find('girlfriend') = [] -- Brandon Aaron On Fri, May 9, 2008 at 10:33 AM, CVertex [EMAIL PROTECTED] wrote: love it. I'd prefer something clever with code on it than just the logo. just the way i eval... On May 9, 5:16 am, Josh Nathanson [EMAIL PROTECTED] wrote: It would be cool if said something like: $(code).less(); ...in Courier typeface...and then had the jQuery logo on it. -- Josh - Original Message - From: Mike Branski [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, May 08, 2008 11:36 AM Subject: [jQuery] Re: jQuery TShirt Agreed! A darker blue with white text would look good (design pending). On May 8, 10:32 am, Andy Matthews [EMAIL PROTECTED] wrote: PLEASE PLEASE PLEASE offer colors other than just black!! -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Resig Sent: Thursday, May 08, 2008 10:24 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery TShirt There's one in the works right now - we're sending it to the producer and will have a store to go along with it. We'll definitely make an announcement when it's ready. --John On Thu, May 8, 2008 at 8:09 AM, CVertex [EMAIL PROTECTED] wrote: I noticed captain John Resig wearing a few nice threadless.com tshirts, and he mentioned a few times in a recent talk that they were selling jQuery tshirts in this or that place. I was wondering if anyone knew of any jQuery tshirts that were around? What would you put on your jQuery T? $(body) -CV
[jQuery] Re: jQuery TShirt
jQuery: $(this) rocks On Fri, May 9, 2008 at 8:34 PM, Jonathan Sharp [EMAIL PROTECTED] wrote: Isn't it more like? alert( $('people:female').find('girlfriend').length == 0 ? 'l33t' : 'normal' ) -js On Fri, May 9, 2008 at 11:11 AM, Brandon Aaron [EMAIL PROTECTED] wrote: Something like: $('people:female').find('girlfriend') = [] -- Brandon Aaron On Fri, May 9, 2008 at 10:33 AM, CVertex [EMAIL PROTECTED] wrote: love it. I'd prefer something clever with code on it than just the logo. just the way i eval... On May 9, 5:16 am, Josh Nathanson [EMAIL PROTECTED] wrote: It would be cool if said something like: $(code).less(); ...in Courier typeface...and then had the jQuery logo on it. -- Josh - Original Message - From: Mike Branski [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, May 08, 2008 11:36 AM Subject: [jQuery] Re: jQuery TShirt Agreed! A darker blue with white text would look good (design pending). On May 8, 10:32 am, Andy Matthews [EMAIL PROTECTED] wrote: PLEASE PLEASE PLEASE offer colors other than just black!! -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Resig Sent: Thursday, May 08, 2008 10:24 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery TShirt There's one in the works right now - we're sending it to the producer and will have a store to go along with it. We'll definitely make an announcement when it's ready. --John On Thu, May 8, 2008 at 8:09 AM, CVertex [EMAIL PROTECTED] wrote: I noticed captain John Resig wearing a few nice threadless.com tshirts, and he mentioned a few times in a recent talk that they were selling jQuery tshirts in this or that place. I was wondering if anyone knew of any jQuery tshirts that were around? What would you put on your jQuery T? $(body) -CV
[jQuery] Re: Href/click-parameters on asynchronous treeview
Thanks for the ticket! Jörn On Fri, May 9, 2008 at 9:33 AM, Jyrki Pulliainen [EMAIL PROTECTED] wrote: I've created a ticket #2830 containing the patch. http://dev.jquery.com/ticket/2830
[jQuery] Re: Getting Parent Element using this
Thanks for the tip hj. Is that a cross-browser solution? I tested it in FF and got the absolute URL, but in IE it returns the relative URL. I used var formAction = $(elm.form).attr(action); and that will return the same in both browsers, however I'd still like to know how reliable that is. Thanks. Brian. On May 9, 10:37 am, hj [EMAIL PROTECTED] wrote: Could you possibly just give your form an id attribute? Then onchange you could just return $(#myformid).attr(action) and not have to mess with any traversing. -- Josh - Original Message - From: briandichiara [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, May 08, 2008 1:58 PM Subject: [jQuery] Re: Getting Parent Element using this Ok, I tried this: $(elm).parents().map(function () { alert(this.tagName); }); but the FORM never shows up. Reason is because the source looks like this: There's no need for any of this; elements of a form (input, select, textarea) has a form property, so: form action=something select name=some_name onchange=changeAction(this); !-- some options -- /select /form function changeAction(elm){ var formAction = elm.form.action; ... } And, as others have suggested, it's a better practice to do this all in JavaScript, so that becomes: form action=something select id=some_select name=some_name !-- some options -- /select /form jQuery(document).ready(function() { jQuery('select#some_select').change(function() { var formAction = this.form.action; ... }); }); -- hj
[jQuery] Re: jCarousel: question and feature reqs
Good initiative Bob, I would like to see if someone has been able to have the carousel display with the vertical mode on multiple lines and multiple columns an example of layout could be something like this - | __ __ __ __ | | | Item1| | Item2| | Item3| | Item4| | | |_| |_| |_| |_| | | | | __ __ __ __ | | | Item5| | Item8| | Item7| | Item8| | | |_| |_| |_| |_| | - so when clicking on arrow left and right, we could see other items (9 and above) Please advise, Thanks Jacques
[jQuery] Re: jQuery TShirt
$(complicatedCode).hide();
[jQuery] Re: fastest way to edit a select
An alternative... var destOpts = $('#hotel_destinazione option'); $('#hotel_paese').change(function(){ var sel_val = $(this).val() || ''; destOpts.each(function(){ var me = $(this); me[sel_val=='' || me.is('.'+sel_val) ? 'show' : 'hide'] (); }); }); On May 9, 11:57 am, andrea varnier [EMAIL PROTECTED] wrote: Hi :) what is the fastest way to edit a select item? I need to show some option's and hide some others, depending on the value of another select. let's say if the user selects a country for his holiday, in the '#hotel_paese' select, the '#hotel_destinazione' select will show only the hotels of that country. problem is that the '#hotel_destinazione' select has already got its values, so I'm using the class attribute to keep track of the country. so if, say, egypt has code '001', then sharm el sheik, abu simbel, aswan, luxor, and so on will all have class '001'. the .show() and .hide() methods seem to be a little too slow. or maybe is my code? // this is the select $('#hotel_paese').change(function(){ var $this = $(this); var sel_val = $this.val(); $('#hotel_destinazione option').show() if (sel_val != '') $('#hotel_destinazione option').not('.' + sel_val).hide(); }); thank you very much :)
[jQuery] Re: Help Creating jQuery UI style plugins
On Fri, May 9, 2008 at 3:33 PM, Adam V [EMAIL PROTECTED] wrote: Hey all, I've gone through some of the more obvious resources on creating jQuery Plugins (Mike Alsop's Plugin pattern, the documentation on docs.jquery.com, etc.) and I think I have a handle on things. There are a few things for which I can't seem to find a good explanation. First, I notice that much of the jQuery UI widgets make use of the dataCache (http://docs.jquery.com/Core/data#name) to keep references to things but I can't find anything that describes how or why you'd want to do such a thing. .data() is used anywhere you want to store data on a DOMElement, instead of expando properties. This is perfect for widget-style plugins that have all sorts of settings/options (plus the instance itself) that need to be stored on each element that is that widget. Also, there's namespacing, for a single element being multiple widgets. For example: $(#myEl).data(width) can be handled by a different getter/plugin than $(#myEl).data(width.dialog) which can both be entirely different than $(#myEl).width() pretty key when (as in the case of dialog) the width of the original element (the content of the dialog) is very different than the dialog itself (a wrapper with chrome+padding) Second, the latest versions of jQuery UI (1.5?) uses the same sort of overloading that jQuery itself uses to simplfy the interaface. See, for example, the interface for Tabs (http://docs.jquery.com/UI/Tabs). I like this pattern and I could implement it myself, but I'm hoping that there is a standard, simple way to implement it. There is a widget factory in ui.core.js that Scott and Jörn developed. For an example of doing the same without that, see a couple files in UI 1.5b2 (before the factory was added): http://dev.jquery.com/view/tags/ui/1.5b2/ui.selectable.js (lines 17-30, init with options, plugin methods) http://dev.jquery.com/view/tags/ui/1.5b2/ui.dialog.js (lines 50-97, plugin property getters and setters) This all needs better documenting. It's all quite new. - Richard Richard D. Worth http://rdworth.org/
[jQuery] Re: jQuery TShirt
$(code).simplify();
[jQuery] Re: Ajax: Posting Xml Data
Thanks Mike, That helps a lot. I have modified the code back to a more 'default' setting and have found that all I needed to do was encode the xml string (using the escape() method) and then, of course decode the string on the server. If I don't encode/escape the xml, I get an ajax call error. $.ajax({ type : POST, url : AjaxHandlerPage.aspx, data : { method : Save, data : escape(xmlString) }, dataType : json, cache : false, success : function(data) { // Process return status data here } }); Neil. On May 9, 6:35 pm, Mike Alsup [EMAIL PROTECTED] wrote: What seems odd is that jQuery throws an error before initiating the ajax call if I set the property 'processData: false' in the initialisation. I think you've misunderstood the use of the processData option. That option lets the ajax function know whether it should convert the data arg to an encoded string or if that has already be done by the caller. You need your data to be processed because it is not in a format that can be sent to the server. It is a JavaScript object (which happens to contain some XML). In addition, the contentType setting is also wrong. Your content is not XML, is just happens to contain some. You should be using the default x-www-form-urlencoded content type. So your post data would ultimately look something like: method=Savedata=%3Cmenu%3E%3CmenuItem+name%3D'Item+1'+%2F%3E%3CmenuItem+name%3D'Item+2'+%2F%3E%3C%2Fmenu%3E Mike
[jQuery] Re: List ul slideDown/Up Menu
Getting closer! I changed from using the mouseover() and mouseout() to hover(). That now seems to be working properly. The only issue at this point is that it doesn't slide down on the first hover. When the page loads and the mouse is over the li it just shows the list as the CSS does. Then when the mouse goes out it will slideUp() and any additional hovers it'll slideDown/Up. I have enclosed it in a ready() function... Test site is updated. Thanks for any help! $(document).ready(function() { $('#Main_Nav ul li').hover( function (e) { $ (this).children('ul').slideDown('normal'); }, function (e) { $(this).children('ul').slideUp('normal'); } ); } ); On May 9, 11:25 am, andrea varnier [EMAIL PROTECTED] wrote: not sure but you could try something like this, to get more specific... $('#Main_Nav li:has(ul)').mouseover(function(e) { e.stopPropagation(); $(this).children('ul').slideDown('normal');}).mouseout(function(e) { e.stopPropagation(); $(this).children('ul').slideUp('normal'); }); btw you don't need the .end() method at the end ;)
[jQuery] Re: List ul slideDown/Up Menu
Andrea, when I changed to hover() the stopPropagation() effected negatively. Once I removed that it started working ok. Also, what is variable e when passing it to the function? Thanks On May 9, 11:25 am, andrea varnier [EMAIL PROTECTED] wrote: not sure but you could try something like this, to get more specific... $('#Main_Nav li:has(ul)').mouseover(function(e) { e.stopPropagation(); $(this).children('ul').slideDown('normal');}).mouseout(function(e) { e.stopPropagation(); $(this).children('ul').slideUp('normal'); }); btw you don't need the .end() method at the end ;)
[jQuery] Re: jQuery TShirt
$(life).get()[0]; On May 9, 2:37 pm, Fontzter [EMAIL PROTECTED] wrote: $(complicatedCode).hide();
[jQuery] Re: ajax calls don't work in firefox 3 beta 4
FF Beta 4 Release notes says that Support for Cross-Site XmlHttpRequest has been removed until the specification becomes more stable and the security model is improved (bug 424923) http://www.mozilla.com/en-US/firefox/3.0b5/releasenotes/ it could be something releated that... On 9 Mayıs, 18:06, skunkwerk [EMAIL PROTECTED] wrote: I've got some code with post ajaxForm calls in it that work fine in IE and FF 2, but not firefox 3. Using firebug I can see that the calls are apparently being made as they should, but for some reason never get to the server. Is this a jQuery issue or a firefox issue? i'm using the latest jquery minified release. thanks
[jQuery] Re: jQuery TShirt
$('#enough').ofThisThread().alReady(); - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
[jQuery] Right way to write a function
Hi everybody, I'm new on jQuery and I wanted to know which is the correct way to right a function. For example I have a menu-list, and I want to clear the selected state of all elements, and set it to the selected element. So I wrote thi function: function toggleActive(e){ $('#iconBox ul.bar li').children(a).removeClass(active); e.addClass(active); return false; } And I invoke with: $('#page1').click(function() { toggleActive($(this).children(a)); [...rest of code...] return false; }); $('#page2').click(function() { toggleActive($(this).children(a)); [...rest of code...] return false; }); This works. But I think this is not the jQuery sintax, so I'm triying to do it right. So I wrote: jQuery.fn.toggleActive = function(e){ $('#iconBox ul.bar li').children(a).removeClass(active); e.addClass(active); return false; }; But I don't know how to call, and how to pass the param. Any help please? Thanks in advance. Max
[jQuery] Re: Tabs 3 Ajax issue
Hi Paul, the tabs plugin does not set innerhtml to anything with all tabs being unselected. You probably do not see the content because the tab panels are all hidden via CSS. --Klaus On May 8, 4:32 pm, HelloGoodbye [EMAIL PROTECTED] wrote: Hello dear JQ community, I'm having some problems regarding the Tabs 3 Plugin: My page has a div container called maincontent which contains all the data except the navigation, footer, etc. I use this container to store content served by my phpscript and to load other content dynamically via AJAX. Let's say I request a page like index.php?action=showusers (as a HTTP GET request, NOT AJAX) Then maincontent should contain all the info about the users. However, I also integrated a navigation based on the Tabs 3 plugin. The div-container the tabs are assigned to is maincontent. Allthough all tabs are disabled at start, say: $('#nav ul').tabs({selected:null}); And my list looks like this: ulli a href=ajaxserver.php?action=getportalpage id=0 class=catItem title=#mainContentspanMain/span/a /li li a href=ajaxserver.php?cat_id=1action=getnews id=1 class=catItem title=#mainContentspanCat 1/span/a /li li a href=ajaxserver.php?cat_id=2action=getnews id=2 class=catItem title=#mainContentspanCat 2/span/a /li li a href=ajaxserver.php?cat_id=7action=getnews id=7 class=catItem title=#mainContentspanCat 3/span/a /li li a href=ajaxserver.php?cat_id=8action=getnews id=8 class=catItem title=#mainContentspanCat 4/span/a /li /ul (It is obvious, that it works via ajax) maincontent's innerhtml is empty, because the tabs plugin hasn't got any tabs selected and therefore sets maincontent's innerhtml to nothing. However I want maincontent to keep its original html(e.g. the userlist) until the user has decided to move over to another category by switching to another tab. How can I preserve the original content, so it won't get overridden by the Tabs 3 plugin? Or can you give any other solutions? Thanks in regard Paul
[jQuery] Re: ajax tabs not working
div id=top class=flora ul lia href=http://www.domain.com/top/pop;Popular/a/li lia href=http://www.domain.com/top/rated;Rated/a/li /ul /div when I load up the site, however, there's nothing in the tabs, You cannot load external pages into tabs. and the links for the tabs are incorrect: /#ui-tabs-7, etc. which isn't in my code anywhere Such divs are created on the fly for Ajax tabs. (even for external links which is actually a little bug). --Klaus
[jQuery] Re: Preventing text field focus() when user tabs to field...
Hi Dan, I don't know off-hand, but the first place I'd look would be Josh Bush's Masked Input plugin. He has done a ton of work to make it an excellent plugin, so I'm guessing you could get some ideas by looking at his code: http://digitalbush.com/projects/masked-input-plugin Hope that helps. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On May 9, 2008, at 1:12 PM, Dan G. Switzer, II wrote: I'm working on an input field where I need to disable the browser from automatically doing this.select() on an input text field. In a nutshell, I've got an input box I basically am treating like a masked input. The reason is I'm manually pre-selecting a text range. If I invoke my function to pre-select the correct text asynchronously (via setTimeout) it works correctly, but you get a very brief flash as the browser natively does a select() on the text already in the input field. I've tried using both e.preventDefault() and e.stopPropagation(), but neither stopped the behavior in FF. Returning false doesn't prevent the behavior either. Here's basically what the code looks like: $(input#myField).bind(focus, function (){ setTimeout(function (){ // preselect just the first 2 chars setSelection(this, 0, 2); }, 0); }); // set the text selected in a text field function setSelection(field, start, end) { if( field.createTextRange ){ var selRange = field.createTextRange(); selRange.collapse(true); selRange.moveStart(character, start); selRange.moveEnd(character, end); selRange.select(); } else if( field.setSelectionRange ){ field.setSelectionRange(start, end); } else { if( field.selectionStart ){ field.selectionStart = start; field.selectionEnd = end; } } field.focus(); }; Does anyone know of a trick to completely prevent FF from trying to select all the text in a field automatically? -Dan
[jQuery] Re: Right way to write a function
Hi there, A quick fix is to modify your extension to: jQuery.fn.toggleActive = function(){ $('#iconBox ul.bar li').children(a).removeClass(active); $(this).addClass(active); }; You would then call by: $('#page2').click(function() { ($(this).children(a).toggleActive(); [...rest of code...] return false; }); Personally, if I was using extend, I'd try to make the function a little more generic (instead of hardcoding id's etc). I'd also use the 'extend' functionality (http://docs.jquery.com/Core/ jQuery.fn.extend#object). Eg: jQuery.fn.extend({ toggleActive: function() { $(this).parent().children('a').removeClass('active'); $(this).addClass('active'); } }); And you'd apply this by element instead of id: $('#iconBox ul.bar li').children(a).click(function(){ $(this).toggleActive(); return false; }); But use what works for you :) On May 10, 9:56 am, Max [EMAIL PROTECTED] wrote: Hi everybody, I'm new on jQuery and I wanted to know which is the correct way to right a function. For example I have a menu-list, and I want to clear the selected state of all elements, and set it to the selected element. So I wrote thi function: function toggleActive(e){ $('#iconBox ul.bar li').children(a).removeClass(active); e.addClass(active); return false; } And I invoke with: $('#page1').click(function() { toggleActive($(this).children(a)); [...rest of code...] return false; }); $('#page2').click(function() { toggleActive($(this).children(a)); [...rest of code...] return false; }); This works. But I think this is not the jQuery sintax, so I'm triying to do it right. So I wrote: jQuery.fn.toggleActive = function(e){ $('#iconBox ul.bar li').children(a).removeClass(active); e.addClass(active); return false; }; But I don't know how to call, and how to pass the param. Any help please? Thanks in advance. Max
[jQuery] Re: fastest way to edit a select
How about this? $('#hotel_paese').change(function(){ $('#hotel_destinazione option').hide() .filter(this.value? (.+this.value) : *).show(); }); I think I got that right...if not you can probably tell what I meant.
[jQuery] Re: Superfish - modified Richard Willis
Hi Drew, Here is another quick patch I've worked out for you. Remove that other line I gave you (the one that manually applies hideSuperfishUl on document ready. Then alter the following line of Superfish.js: CHANGE THIS: o.$path = $('li.'+o.pathClass,this).each(function(){ TO THIS: o.$path = $('li.'+o.pathClass+':first',this).each(function(){ That way, the path to restore only includes the submenu of the first li that has the 'active' class, both on page load and mouseouts. This limiting of the detected 'active' path seems like it may be the way to go to provide flexibility to the pathClass feature so that these types of menu are doable. I'll figure out a proper way of adjusting this from the options object, but for now I hope this hack finally solves the problem for you. Joel Birch.
[jQuery] Re: Preventing text field focus() when user tabs to field...
Karl, I don't know off-hand, but the first place I'd look would be Josh Bush's Masked Input plugin. He has done a ton of work to make it an excellent plugin, so I'm guessing you could get some ideas by looking at his code: http://digitalbush.com/projects/masked-input-plugin Hope that helps. I looked there after I made my post and he's also using setTimeout to do it asynchronously--so there may not be a cross browser way to actually stop the default behavior (there might be, but Josh didn't have a solution either.) -Dan