[jQuery] Re: Calling seperate function in each()
The markup will be generated from a MySQL database using PHP so it could look in many different ways. But as I have it now: pa href=# id=ExpandAll[+expand]/a | a href=# id=CollapseAll[-collapse]/a/p ul lia href=# class=Categorycategory 1/a ul lia href=# class=Categorycategory 1 1/a ul lia href=#file 1 1 1/a/li lia href=#file 1 1 2/a/li lia href=#file 1 1 3/a/li lia href=#file 1 1 4/a/li lia href=#file 1 1 5/a/li /ul /li lia href=#file 1 1/a/li lia href=#file 1 2/a/li lia href=#file 1 3/a/li lia href=#file 1 4/a/li lia href=#file 1 5/a/li /ul /li /ul On Oct 13, 12:43 am, Dave Methvin [EMAIL PROTECTED] wrote: There is a lot of similar-looking code there. You could use .toggle() but the added complication of OpenAll/CloseAll makes that tough. What does your markup look like?
[jQuery] Re: Thickbox vs jqModal
I personally prefer jqmodal, the result is snappier. Maybe this conversion tutorial will help you out: http://www.pixeline.be/blog/2008/javascript-loading-external-urls-in-jqmodal-jquery-plugin/ cheers, alexandre LAb[au] _ *lab*oratory for *a*rchitecture and *u*rbanism Alexandre Plennevaux Lakensestraat 104 Rue de Laeken Brussel 1000 Bruxelles België _ Belgique _ Belgium tel: +32 (0)2 2196555 fax: +32 (0)2 4266986 mail: [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.lab-au.com VAT: BE0475.210.720 On Mon, Oct 13, 2008 at 7:43 AM, bookme [EMAIL PROTECTED] wrote: Hi, I am confused what plugin should I use either Thickbox or jqModal? Can some body tell me which one is better in terms of performance, look and feel and for future help Thanks
[jQuery] Re: Match the filename to highlight current link on page
No one can help? I tought with jquery one can select everything!
[jQuery] focus and blur events
I have a table with one column. each cell contains a textbox. I want the user to be able to use the cursor keys to move up or down the cells. On the keyup I detect when the up key is pressed (event.keyCode==38) and navigate to the previous cell and call focus() on it. I am tracing the events to see what is fired and am getting confusing results. 1. If i click cell1, cell1.focus fires. If i now click cell2, cell1.blur fires and cell2.focus fires. This is what i expect. 2. if i click cell1, cell1.focus fires. If i now press the down key, the cell2.focus fires, then cell1.blur then cell2.focus - cell2.focus fires twice. I expect the blur to fire first and then the focus to fire. what am i missing? below my code: $('.editCell').focus(function () { $(this).addClass('highLight').select(); }).blur(function() { $(this).removeCalss(highLight); }.keyup(function(event) { if (event.keyCode == 38) // up key $(this).parent().parent().prev().find(.editCell).focus(); if (event.keyCode == 40) // down key $(this).parent().parent().next().find(.editCell).focus(); }); any help appreciated... thanks
[jQuery] Re: Check if contents of lis is an image
this should work: if ($(#medalist ul li:active img).length() 0) { // has image inside li/li } On Oct 13, 3:52 am, jdenkaat [EMAIL PROTECTED] wrote: Hi If I have the following list and I want to find if the contents of li class=active is an image how would I do it? div id=medalist ul li class=activeimg src=media/nin2.jpg/a/li lia href=media/nintendo.swf/a/li liimg src=media/nin2.jpg/li liimg src=media/nin3.jpg /li /ul /div I have tried the following: if ($('#medialist li.active.is(img)')){ alert(true); }); } else{ alert(false); } but I'm fairly sure that the if ($('#medialist li.active.is(img)')) { line is wrong. Could someone point me in the right direction Thanks in advanced Jdenkaat
[jQuery] Re: Thickbox vs jqModal
I also use jqModal i'm not sure what view you are looking for... use which ever one makes more sense for you and is easier for you to code/understand functionally they do the same things (as does UI's modal) On Oct 13, 5:01 am, bookme [EMAIL PROTECTED] wrote: Thanks for your suggestions !! Any body have any view for it On Oct 13, 11:51 am, Alexandre Plennevaux [EMAIL PROTECTED] wrote: I personally prefer jqmodal, the result is snappier. Maybe this conversion tutorial will help you out:http://www.pixeline.be/blog/2008/javascript-loading-external-urls-in-... cheers, alexandre LAb[au] _ *lab*oratory for *a*rchitecture and *u*rbanism Alexandre Plennevaux Lakensestraat 104 Rue de Laeken Brussel 1000 Bruxelles België _ Belgique _ Belgium tel:+32 (0)2 2196555 fax: +32 (0)2 4266986 mail: [EMAIL PROTECTED] [EMAIL PROTECTED]http://www.lab-au.com VAT: BE0475.210.720 On Mon, Oct 13, 2008 at 7:43 AM, bookme [EMAIL PROTECTED] wrote: Hi, I am confused what plugin should I use either Thickbox or jqModal? Can some body tell me which one is better in terms of performance, look and feel and for future help Thanks
[jQuery] Re: Removing google toolbar's autofill yellow
Great! Thanks! On Oct 9, 7:40 pm, Dave Methvin [EMAIL PROTECTED] wrote: How about assigning classes to them instead of using .css()? This might work: input[type='text'] { background: #FF !important; } input[type='text'].erroneous{ background: red !important; } I am thinking that because the second rule is more selective than the first, it should take precedence. If not, you'd need to assign a class to the first rule and do a remove/add class.
[jQuery] Re: don't understand this bug _ please review code
Hi, It's not really working here.. when I click experimental or people some bars get added, but depending on the combination the bars added have different widths. Deselecting all of them still leaves most of the bars, but they stop working. The grey box is one (or more) of the bars. When you click one of the keywords to regenerate the barcode, it starts growing in width. The one I looked at went up to 18808px, then shrank back to 33px, restoring the barcode - it's a long running function, took around 10 seconds. I don't have time to look at the code right now, but that should give you a clue of what's going on. Do you really need to preload all the images? It's a huge hit on the server and slows down the browser considerably. - ricardo On Oct 12, 4:40 pm, Alexandre Plennevaux [EMAIL PROTECTED] wrote: hi Friends, i'm about to finish an old project of a specific image viewer for a professional photographer. The whole idea is that her work becomes her identity. Therefore, the pictures are displayed in imagesets one next to each other, each being a line, thin or thick according to the number of images it contain. This generates an ID-related graphic: a barcode. Now, i'm about to be finished, but there is a bug i can't seem to nail down and i would be very grateful if you guys could spend some of your time helping me out. Please first check the live prototype:http://www.pixeline.be/test/lisapram/ (thanks for your patience, 101 images to load !) now, past the rudimentary preloader, you should see a grey barcode. You can hover then click on each line to expand the image set, and see what it does. Above, you get keywords summarizing her main work keywords: professional, experimental, people (portraits), etc. If you click on them, it should activate/disactivates the barcode (not) tagged with these keywords, thus generating a different barcode, according to the current combination of tags selected. Problem is exactly there: the barcode does not quite reinitalise, or i don't know exactly in fact how to describe it: a grey box appears underneath, and i don't find where it comes from. Can somebody check? If you want to peak at the code (js and html) are available in the nice jsbin app of remy: http://jsbin.com/eqime thank you very much for your help ! Alexandre Plennevaux
[jQuery] sortable links
Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Re: Remapping jquery to work on window.content?
Not sure what you are trying to do, but you can pass a context as a second parameter to a selector, like in: $('#blob', window.content.document) as in $('#blob', window.document) which is what happens by default. - ricardo On Oct 12, 11:38 pm, MichaelBalazs [EMAIL PROTECTED] wrote: Hello, I am working in a situation that I need to have jquery reference window.content rather than window. I assume that it want the base reference is to. Any ideas on how to do this? Thanks, Michael
[jQuery] Re: How to use a custom ajax code in page that was loaded with .load()?
A quick search for 'load javascript ajax' should bring you the answer, here or on google. http://groups.google.com/group/jquery-en/browse_thread/thread/8a8f6c139c9b7ade cheers, - ricardo On Oct 12, 7:41 pm, ivframes [EMAIL PROTECTED] wrote: I have a page that loads with jquery's .load() function. However, that page is a form with two custom JS files attached. When I load it separately, the JS code works. However, when used with .load(), it does not. What I'm missing here?
[jQuery] Re: sortable links
There's probably a return false option in the plugin options. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Adam Sent: Monday, October 13, 2008 8:50 AM To: jQuery (English) Subject: [jQuery] sortable links Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Re: Thickbox vs jqModal
i use SimpleModal! :) http://www.ericmmartin.com/projects/simplemodal/ On Oct 13, 8:22 am, MorningZ [EMAIL PROTECTED] wrote: I also use jqModal i'm not sure what view you are looking for... use which ever one makes more sense for you and is easier for you to code/understand functionally they do the same things (as does UI's modal) On Oct 13, 5:01 am, bookme [EMAIL PROTECTED] wrote: Thanks for your suggestions !! Any body have any view for it On Oct 13, 11:51 am, Alexandre Plennevaux [EMAIL PROTECTED] wrote: I personally prefer jqmodal, the result is snappier. Maybe this conversion tutorial will help you out:http://www.pixeline.be/blog/2008/javascript-loading-external-urls-in-... cheers, alexandre LAb[au] _ *lab*oratory for *a*rchitecture and *u*rbanism Alexandre Plennevaux Lakensestraat 104 Rue de Laeken Brussel 1000 Bruxelles België _ Belgique _ Belgium tel:+32 (0)2 2196555 fax: +32 (0)2 4266986 mail: [EMAIL PROTECTED] [EMAIL PROTECTED]http://www.lab-au.com VAT: BE0475.210.720 On Mon, Oct 13, 2008 at 7:43 AM, bookme [EMAIL PROTECTED] wrote: Hi, I am confused what plugin should I use either Thickbox or jqModal? Can some body tell me which one is better in terms of performance, look and feel and for future help Thanks
[jQuery] New to Jquery, have written Validation script...
Hello, I have never written a Jquery script, but have, over the last few days, compiled the following, but was hoping someone could look over this to see if I had problems. $(document).ready(function () { $(#my-form [EMAIL PROTECTED]'input']).blur(function() { var queryString = $.(#my-form).formSerialize(); $.post(/path/to/your/validation.php, queryString, function(validation_errors) { // do something like changing a css class, disable submit... $.each(validation_errors, function(err_id, err_message) { $(err_id).val() = err_message; } )}; }); )}); Thanks, Nishan
[jQuery] Re: sortable links
btw, just in case you must use a's... then maybe something like this would solve your issue if (sortable functionality is active) $(#ID_of_Sortable_Container a).click(function() { return false; }); else // sortable functionality is turned off $(#ID_of_Sortable_Container a).unbind(); On Oct 13, 10:03 am, MorningZ [EMAIL PROTECTED] wrote: if you don't want the user to go anywhere when clicking on a link, then why use a link? On Oct 13, 9:50 am, Adam [EMAIL PROTECTED] wrote: Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Re: sortable links
He's not talking about clicking on the link to activate it, but clcking on it to drag and sort it. I will say that you might be better off applying the sortable to an LI tag which contains the link, rather than directly to the link itself. Remember that a link isn't technically a list, but a group of li tags are. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MorningZ Sent: Monday, October 13, 2008 9:04 AM To: jQuery (English) Subject: [jQuery] Re: sortable links if you don't want the user to go anywhere when clicking on a link, then why use a link? On Oct 13, 9:50 am, Adam [EMAIL PROTECTED] wrote: Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] datepicker - how to select multiple dates?
Does anybody know how to select multiple dates with the JQuery UI datepicker, like this: 1. User Clicks text field. Datepicker calendar appears. 2. User Clicks on one or more dates (calendar remains open). As user clicks dates, a text area is populated with the choices.
[jQuery] help with $.getJSON() ... just cant figure it out
first off, i dont get the difference between using $.ajax, $.post or $.get instead since the concept is the same afaik: you send a request and receive a response. the only difference in this case is that the response would be a JSON object... right? anyway... i've managed to generate tons of JSON objects of all sorts but haven't been able to come up with a decent parser thats not uber specific to each case... does anyone have any tips or a more generic kind of jQuery JSON parser and some help on how to put it all together? thanks!! -Alex
[jQuery] Re: [validate] callback onblur on single input field
Try this: var fields = $(#tel, #mobile); fields.blur(function() { fields.valid(); }); That triggers validation for both field when one of them is blurred. Jörn On Mon, Oct 13, 2008 at 12:05 PM, hcvitto [EMAIL PROTECTED] wrote: hi i'm using tha validation plugin on a very long form. It works fine everywhere but for one little issues: i need to trigger a function onblur of a single field: i got a tel and a mobile input field one of which is required (at least). How i trigger the callback after i fill the input to erase th error class from the other field? Thank Vitto
[jQuery] Re: New to Jquery, have written Validation script...
Validation should always hook into the submit event, eg. $(#myform).submit(function() { ... }); That handles both clicking the submit button as well as hitting enter while an input field has focus. Apart from that, the form plugin handles submitting forms via ajax and handling the response quite well, including file uploads: http://malsup.com/jquery/form/ Jörn On Mon, Oct 13, 2008 at 5:57 AM, Nishan Karassik [EMAIL PROTECTED] wrote: Hello, I have never written a Jquery script, but have, over the last few days, compiled the following, but was hoping someone could look over this to see if I had problems. $(document).ready(function () { $(#my-form [EMAIL PROTECTED]'input']).blur(function() { var queryString = $.(#my-form).formSerialize(); $.post(/path/to/your/validation.php, queryString, function(validation_errors) { // do something like changing a css class, disable submit... $.each(validation_errors, function(err_id, err_message) { $(err_id).val() = err_message; } )}; }); )}); Thanks, Nishan
[jQuery] jquery-ui - draggables within a div with position: absolute
Hi I have draggables within a div that is absolutely positioned. When I click the draggable, the cloned images appears above the mouse pointer. To be precise, the distance between the draggable and the mouse pointer is the same as the distance between to top of the page and the top of the viewport. how to get the cloned image to be where to mouse pointer is ? Olivier
[jQuery] Re: help with $.getJSON() ... just cant figure it out
Hi Alex, maybe this tutorial can give you a start: http://www.prodevtips.com/2008/08/15/jquery-json-with-php-json_encode-and-json_decode/ Personally, I use the script from here: http://www.json.org/js.html But I don't think you really need an extra parser - $.getJSON should already parse the response text... Good luck! Mickster On Oct 13, 4:21 pm, Alex Weber [EMAIL PROTECTED] wrote: first off, i dont get the difference between using $.ajax, $.post or $.get instead since the concept is the same afaik: you send a request and receive a response. the only difference in this case is that the response would be a JSON object... right? anyway... i've managed to generate tons of JSON objects of all sorts but haven't been able to come up with a decent parser thats not uber specific to each case... does anyone have any tips or a more generic kind of jQuery JSON parser and some help on how to put it all together? thanks!! -Alex
[jQuery] Re: help with $.getJSON() ... just cant figure it out
$.post gets some data, puts the outgoing data in the header, data comes back as whatever $.get gets some data, but puts the outgoing data on the querystring, data comes back as whatever $.getJSON gets some data, using get by default, data comes back and jQuery *expects* it to be a JSON object $.ajax The underlying call for all of the above As for a tip on a generic kind of jQuery parser, if you use getJSON then there is nothing to parse, the returned object *will* be a JSON object (as long as you properly crafted it on the server) if you need a more configurable version of getJSON, i wrote and use this wrapper function function reqJSON(url, params, success, error) { var CallParams = {}; CallParams.type = params.Method || POST; CallParams.url = url; CallParams.processData = true; CallParams.data = params; CallParams.dataType = json; CallParams.success = success; if (error) { CallParams.error = error; } $.ajax(CallParams); } and call it like so var Params = {}; Params.SomeKey1 = some value; Params.SomeKey2 = some value; Params.Method = GET; // or POST, which it defaults to reqJSON( url of server page, Params, function(json) { // if here, then json *is* a JSON object }, function(x,y,z) { // if here, then some error on server, x has the details } ); On Oct 13, 10:21 am, Alex Weber [EMAIL PROTECTED] wrote: first off, i dont get the difference between using $.ajax, $.post or $.get instead since the concept is the same afaik: you send a request and receive a response. the only difference in this case is that the response would be a JSON object... right? anyway... i've managed to generate tons of JSON objects of all sorts but haven't been able to come up with a decent parser thats not uber specific to each case... does anyone have any tips or a more generic kind of jQuery JSON parser and some help on how to put it all together? thanks!! -Alex
[jQuery] Leandro's Lightbox and sIFR
'lo all, We're designing a website here at the mo which was previously in the hands of one of the other guys, who'd done a Lightbox on a gallery page using Prototype / Scriptaculous / Lightbox from huddletogether.com. The page in question also uses sIFR and when the Lightbox is opened, the sIFR Flash shows through over the top, which looks messy. I thought I'd rip the P/S Lightbox out and replace it with Leandro's from http://leandrovieira.com/projects/jquery/lightbox/ but unfortunately it suffers from the same problem. I thought it used the bgiframe plugin if available but perhaps not. Is this an easy fix or is there another one I can use? All help appreciated :) Regards, Michael Price
[jQuery] ajax submit a form (when a select box changes) and load the result in the same page
hi all! greetings to everyone! I am sorry if I missed the solution of this problem given here already but I searched for quite some time. here is my problem I have written a form with only a select box which, when changed, should submit its form and load the response from the server in the same page under a specific div/div so that the user doesn't have to navigate away from that page when he wants to change that select box again. So far I am trying with a submit button and when I click on submit after changing the select box, it works. code:: script language='javascript' $(document).ready(function() { var options = { target:'#content', // target element(s) to be updated with server response beforeSubmit: function() { document.body.style.cursor = 'wait'; }, // pre-submit callback success: function() { document.body.style.cursor = 'default'; } // post-submit callback }; // bind to the form's submit event $('form').submit(function() { $(this).ajaxSubmit(options); return false; }); }); /script div id='content' style='border:1px solid black' form id=publicationform id=publicationform action=show.jsp method=POST select name=publication id=pubitemlist .. input type=submit value=Select/ /form how can I make it work without the submit button? (I have tried select name=publication id=pubitemlist onChange=this.form.submit(); which causes it to load a new page what I want is to load the response (page) in the div specified in AJAX fashion! Thanks in advance! Regards, Supratim.
[jQuery] Accordion problem - closing issue
Hi, I can't seem to get my accordion to work. I have nested ul's, and I'd like it to close the open ul when you open another (normal accordion function). I would appreciate any help/tips. Thanks! Here is my jquery: $(document).ready(function(){ $(.accordion:eq(0) li ul:gt(0)).hide(); $(.accordion li a).hover(function(){ $(this).next(ul).slideToggle(slow) .siblings(ul:visible).slideUp(slow); }); }); And here is my accordion structure: ul class=accordion lia href=#2008/a ul lia href=#August/a/li lia href=#July/a/li lia href=#June/a/li lia href=#May/a/li /ul /li lia href=#2007/a ul lia href=#December/a/li lia href=#October/a/li lia href=#June/a/li lia href=#April/a/li lia href=#February/a/li lia href=#January/a/li /ul /li /ul
[jQuery] Re: New to Jquery, have written Validation script...
Wouldn't the $(#my-form [EMAIL PROTECTED]'input']).blur(function() { be my trigger? I would like to validate as the user tabs through the form. How would I not run the function if the field just tabbed from is blank? Thanks for your validation of my script. Nishan On Oct 13, 7:30 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Validation should always hook into the submit event, eg. $(#myform).submit(function() { ... }); That handles both clicking the submit button as well as hitting enter while an input field has focus. Apart from that, the form plugin handles submitting forms via ajax and handling the response quite well, including file uploads:http://malsup.com/jquery/form/ Jörn On Mon, Oct 13, 2008 at 5:57 AM, Nishan Karassik [EMAIL PROTECTED] wrote: Hello, I have never written a Jquery script, but have, over the last few days, compiled the following, but was hoping someone could look over this to see if I had problems. $(document).ready(function () { $(#my-form [EMAIL PROTECTED]'input']).blur(function() { var queryString = $.(#my-form).formSerialize(); $.post(/path/to/your/validation.php, queryString, function(validation_errors) { // do something like changing a css class, disable submit... $.each(validation_errors, function(err_id, err_message) { $(err_id).val() = err_message; } )}; }); )}); Thanks, Nishan
[jQuery] Re: How do I remove a plugin melodramatically
lol! Josh, I didn't even get that until today when I saw the title I put up! That's awesome. me-and-jQuery, your solution worked great. Thanks! Dan On Oct 10, 5:31 pm, Josh Nathanson [EMAIL PROTECTED] wrote: I think when you unbind it, you should put the back of your hand to your forehead and say, Oh woe is me! Sorry, it's Friday. - Original Message - From: me-and-jQuery [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Friday, October 10, 2008 2:23 PM Subject: [jQuery] Re: How do I remove a plugin melodramatically One option is to use unbind on the event that this plugin uses. $. (element).unbind(click); Anyone has any other solution? On Oct 10, 9:21 pm, Dan M [EMAIL PROTECTED] wrote: All, If I were to add a plugin to an element on a page, say clueTip. How could I remove the plugin from the element when I want without reloading the page? Regards, Dan
[jQuery] Re: sortable links
if you don't want the user to go anywhere when clicking on a link, then why use a link? On Oct 13, 9:50 am, Adam [EMAIL PROTECTED] wrote: Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Re: sortable links
Actually, I am applying the sortable to an LI tag which contains the link, but if I sort and the mouse pointer is on top of the link, the link click event is still executed. On Oct 13, 10:09 am, Andy Matthews [EMAIL PROTECTED] wrote: He's not talking about clicking on the link to activate it, but clcking on it to drag and sort it. I will say that you might be better off applying the sortable to an LI tag which contains the link, rather than directly to the link itself. Remember that a link isn't technically a list, but a group of li tags are. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MorningZ Sent: Monday, October 13, 2008 9:04 AM To: jQuery (English) Subject: [jQuery] Re: sortable links if you don't want the user to go anywhere when clicking on a link, then why use a link? On Oct 13, 9:50 am, Adam [EMAIL PROTECTED] wrote: Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Re: blockUI blocking table rows
Ok, that worked quite well, I made following 2 functions $.fn.block_row = function(opts) { row = $(this) height = row.height(); $('td, th', row).each(function() { cell = $(this); //$('input', cell).hide().addClass('hiddenInputByBlock'); cell.wrapInner('div class=holderByBlock container style=width: 100%; height: ' + height + 'px; overflow: hidden;/div'); cell.addClass('cleanByBlock'); cell.attr('style', 'border: 0; padding: 0;') $('div.holderByBlock', cell).block(); }) }; $.fn.unblock_row = function(opts) { row = $(this) $('.cleanByBlock', row).each(function() { cell = $(this); $('div.holderByBlock', cell).unblock({ onUnblock: function(cell, opts) { this_cell = $(cell).parent('td, th'); //$('input.hiddenInputByBlock', this_cell).show().removeClass('hiddenInputByBlock'); this_cell.html($('.holderByBlock', this_cell).html()); this_cell.removeAttr('style'); this_cell.removeClass('cleanByBlock'); } }); }) }; However I now have a second problem. Two of my table cells contain checkboxes that have click events enabled on them (the click events gets set by a JS function that is called on document load. When I click a checkbox these steps happen: - Block parent row - send ajax request - when ajax request is finished unblock row However, after the unlock, the checkboxes no longer work (the click event has gone). I could re attach them, but then these methods wouldn't be reusable at all. On Oct 10, 1:05 pm, Mike Alsup [EMAIL PROTECTED] wrote: Blocking table cells may work in some browsers but in won't work reliably in an x-browser environment. The blocked element needs to be an element that can have a relative position, and that is not true of TRs and TDs. Further, the block overlay (a div) is appended to the blocked element, and appending a div to a table is not valid. If you need to block a table, wrap it in a div and block that div instead. If you need to block a table cell, wrap the cell contents in a div and block that div instead. If you need to block a row, block each TD's content div. For example: // block 3rd row $('tr:eq(2) td div.cellContent').block(); Mike On Oct 10, 6:37 am, Bertg [EMAIL PROTECTED] wrote: When trying to block a row (tr), cell (td) or an entire table using blockui the entire window gets blocked. eg: $('table tr:first').block(); Anyone have a patch laying around to get that behaviour working or is interested in creating that functionality, cause my JS knowledge isn't that advanced yet. I'm using blockui 2.09 .
[jQuery] jQueryWTP 0.2 released,this release is for jQuery1.2.6
jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript. Eclipse WTP support javascript code content assistance,but does not support jQuery. a href=http://www.langtags.com/jquerywtp/index.html;jQueryWTP/a is a tool make Eclipse WTP support jQuery code content assistance. PDT(PHP Development Tools framework for the Eclipse platform) is based on WTP,so the plug-in also support PDT. jQueryWTP also support other tools based on WTP,such as MyEclipse.
[jQuery] $('div/')
$('div/') returns array of one object. Is this some kind of virtual element? $('anything/') also returns one element. I am using this element to make html encode (Example $('div/ ').text('br/').html()). Is this jquery bug? I didn't find any documentation of this behavior. I don't want to rely on bug in my code.
[jQuery] Re: How to use a custom ajax code in page that was loaded with .load()?
On Oct 12, 5:41 pm, ivframes [EMAIL PROTECTED] wrote: I have a page that loads with jquery's .load() function. However, that page is a form with two custom JS files attached. When I load it separately, the JS code works. However, when used with .load(), it does not. What I'm missing here? Can you post some code so we can see how the custom JS files are attached to the content you pull in with .load()? -- joel
[jQuery] jQueryWTP 0.2 released,this release is for jQuery1.2.6
jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript. Eclipse WTP support javascript code content assistance,but does not support jQuery. a href=http://www.langtags.com/jquerywtp/index.html;jQueryWTP/a is a tool make Eclipse WTP support jQuery code content assistance. PDT(PHP Development Tools framework for the Eclipse platform) is based on WTP,so the plug-in also support PDT. jQueryWTP also support other tools based on WTP,such as MyEclipse.
[jQuery] Re: [validate] callback onblur on single input field
great thanks! as soon as the for is online i'll tell you the link, in case it's useful!! Vitto On 13 Ott, 16:28, Jörn Zaefferer [EMAIL PROTECTED] wrote: Try this: var fields = $(#tel, #mobile); fields.blur(function() { fields.valid(); }); That triggers validation for both field when one of them is blurred. Jörn On Mon, Oct 13, 2008 at 12:05 PM, hcvitto [EMAIL PROTECTED] wrote: hi i'm using tha validation plugin on a very long form. It works fine everywhere but for one little issues: i need to trigger a function onblur of a single field: i got a tel and a mobile input field one of which is required (at least). How i trigger the callback after i fill the input to erase th error class from the other field? Thank Vitto
[jQuery] input field html
does this html has any flaws (from a jQuery perspective) that could make jQuery break ?? input name=ctl00$body1$Tab_Customer1$txtAddr1 type=text value=text value id=ctl00_body1_Tab_Customer1_txtAddr1 class=field-data / ??
[jQuery] [Validation plugin] attaching onclick validation to checkboxes before submit button is clicked?
Using the Validation plugin (http://docs.jquery.com/Plugins/ Validation/) I've got checkboxes like this: input type=checkbox name=q4 id=q4 value=1 / input type=checkbox name=q4 id=q4 value=2 / input type=checkbox name=q4 id=q4 value=3 / input type=checkbox name=q4 id=q4 value=4 / input type=checkbox name=q4 id=q4 value=5 / and the following code making sure that only 3 can be chosen: $(document).ready(function() { $('#fQuestionnaire1').validate({ rules: { q4: { required: true, maxlength: 3 } } }); }); This sort of works fine - when I click the form's Submit button, the error message is displayed if more than three are selected. And from then on, the error message is toggled on and off by my ticking the required number of boxes. But - and here's my question - I want that behaviour BEFORE I've hit Submit. As soon as I click that 4th checkbox, I want the error message to appear. Currently it's happy to let me select 4 items and then gives me the message when I hit Submit. I notice that the docs for the validate() onfocusout option - which defaults to true - says Validate elements (except checkboxes/radio buttons) on blur. Why are they excluded? It's clearly possible to do, because it does validate onblur AFTER the submit button has fired once. Is this work-aroundable? Am I missing something important? Thanks :)
[jQuery] Re: sortable links
Well, as mentioned above use the Sortable's event handlers (sort start, end, etc) to wire/unwire on an return false to the anchors... On Oct 13, 11:09 am, Adam [EMAIL PROTECTED] wrote: Actually, I am applying the sortable to an LI tag which contains the link, but if I sort and the mouse pointer is on top of the link, the link click event is still executed. On Oct 13, 10:09 am, Andy Matthews [EMAIL PROTECTED] wrote: He's not talking about clicking on the link to activate it, but clcking on it to drag and sort it. I will say that you might be better off applying the sortable to an LI tag which contains the link, rather than directly to the link itself. Remember that a link isn't technically a list, but a group of li tags are. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MorningZ Sent: Monday, October 13, 2008 9:04 AM To: jQuery (English) Subject: [jQuery] Re: sortable links if you don't want the user to go anywhere when clicking on a link, then why use a link? On Oct 13, 9:50 am, Adam [EMAIL PROTECTED] wrote: Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Re: [Validation plugin] attaching onclick validation to checkboxes before submit button is clicked?
Details about the default behaviour are here: http://docs.jquery.com/Plugins/Validation/Reference#Validation_event You can make the validation more aggresive with some custom event handling: $(input[name=q4]).click(function() { $(this).valid(); }); Jörn PS: You really shouldn't use a single id more then once (id=q4) On Mon, Oct 13, 2008 at 5:34 PM, w1ntermut3 [EMAIL PROTECTED] wrote: Using the Validation plugin (http://docs.jquery.com/Plugins/ Validation/) I've got checkboxes like this: input type=checkbox name=q4 id=q4 value=1 / input type=checkbox name=q4 id=q4 value=2 / input type=checkbox name=q4 id=q4 value=3 / input type=checkbox name=q4 id=q4 value=4 / input type=checkbox name=q4 id=q4 value=5 / and the following code making sure that only 3 can be chosen: $(document).ready(function() { $('#fQuestionnaire1').validate({ rules: { q4: { required: true, maxlength: 3 } } }); }); This sort of works fine - when I click the form's Submit button, the error message is displayed if more than three are selected. And from then on, the error message is toggled on and off by my ticking the required number of boxes. But - and here's my question - I want that behaviour BEFORE I've hit Submit. As soon as I click that 4th checkbox, I want the error message to appear. Currently it's happy to let me select 4 items and then gives me the message when I hit Submit. I notice that the docs for the validate() onfocusout option - which defaults to true - says Validate elements (except checkboxes/radio buttons) on blur. Why are they excluded? It's clearly possible to do, because it does validate onblur AFTER the submit button has fired once. Is this work-aroundable? Am I missing something important? Thanks :)
[jQuery] Re: [validate] callback onblur on single input field
I've started gathering sites using the plugin some time ago, its still a very small list, though I'm quite sure there are a ton of unlisted sites. You're welcome to add yours: http://docs.jquery.com/Plugins/Validation#Sites_using_the_plugin Jörn On Mon, Oct 13, 2008 at 5:16 PM, hcvitto [EMAIL PROTECTED] wrote: great thanks! as soon as the for is online i'll tell you the link, in case it's useful!! Vitto On 13 Ott, 16:28, Jörn Zaefferer [EMAIL PROTECTED] wrote: Try this: var fields = $(#tel, #mobile); fields.blur(function() { fields.valid(); }); That triggers validation for both field when one of them is blurred. Jörn On Mon, Oct 13, 2008 at 12:05 PM, hcvitto [EMAIL PROTECTED] wrote: hi i'm using tha validation plugin on a very long form. It works fine everywhere but for one little issues: i need to trigger a function onblur of a single field: i got a tel and a mobile input field one of which is required (at least). How i trigger the callback after i fill the input to erase th error class from the other field? Thank Vitto
[jQuery] Re: Problems creating a simple auto-expand panel
Hi Martin, The main cause of the problem is you're using the e.target as the starting selector on the effect. So when the mouseout event occurs the event's target can be different from what you're expecting. So the initial fix is to change $(e.target)... to $(this)... However, using the .stop() is also causing a bug - so I've removed it from the demo I put together: http://jsbin.com/aseno/edit Regards, Remy. On Oct 12, 9:08 pm, Martin [EMAIL PROTECTED] wrote: Hi, I'm a jquery beginner and have problems creating a simple (?) effect on my page. I have the following markup: div class=panel div class=panelTitletitle/div div class=panelContentcontent.../div /div What I'd like to achieve, is that the panel content should be shown when the mouse is moved over the panel DIV and then hidden again when the mouse is moved away. My current solution looks like this: $(document).ready(function() { $('.panel').hover(function(e) { $(e.target).children('.panelContent').stop().slideDown('slow'); }, function(e) { $(e.target).children('.panelContent').stop().slideUp('slow'); }); } This code basically works, but very unreliably. I especially have problems when the mouse pointer is moved fast, e.g. when the mouse leaves the panel DIV before the content was fully shown. I have also tried binding the mouseenter and mouseleave events, but the results were the same. A full sample can be viewed here:http://jsbin.com/afuwa To view/edit the source code use the URL :http://jsbin.com/afuwa/edit Can anyone give me some hints, pointers to documentation, etc. how to implement something like I'm trying to achieve? Thanks a lot. -- Martin
[jQuery] ajax submit a form (when a select box changes) and load the result in the same page
hi all! greetings to everyone! I am sorry if I missed the solution of this problem given here already but I searched for quite some time. here is my problem I have written a form with only a select box which, when changed, should submit its form and load the response from the server in the same page under a specific div/div so that the user doesn't have to navigate away from that page when he wants to change that select box again. So far I am trying with a submit button and when I click on submit after changing the select box, it works. code:: script language='javascript' $(document).ready(function() { var options = { target:'#content', // target element(s) to be updated with server response beforeSubmit: function() { document.body.style.cursor = 'wait'; }, // pre-submit callback success: function() { document.body.style.cursor = 'default'; } // post-submit callback }; // bind to the form's submit event $('form').submit(function() { $(this).ajaxSubmit(options); return false; }); }); /script div id='content' style='border:1px solid black' form id=publicationform id=publicationform action=show.jsp method=POST select name=publication id=pubitemlist .. input type=submit value=Select/ /form how can I make it work without the submit button? (I have tried select name=publication id=pubitemlist onChange=this.form.submit(); which causes it to load a new page what I want is to load the response (page) in the div specified in AJAX fashion! Thanks in advance! Regards, Supratim.
[jQuery] Re: sortable links
Actually, I am applying the sortable to an LI tag which contains the link, but if I sort and the mouse pointer is on top of the link, the link click event is still executed. On Oct 13, 10:09 am, Andy Matthews [EMAIL PROTECTED] wrote: He's not talking about clicking on the link to activate it, but clcking on it to drag and sort it. I will say that you might be better off applying the sortable to an LI tag which contains the link, rather than directly to the link itself. Remember that a link isn't technically a list, but a group of li tags are. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MorningZ Sent: Monday, October 13, 2008 9:04 AM To: jQuery (English) Subject: [jQuery] Re: sortable links if you don't want the user to go anywhere when clicking on a link, then why use a link? On Oct 13, 9:50 am, Adam [EMAIL PROTECTED] wrote: Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Check if contents of lis is an image
Hi If I have the following list and I want to find if the contents of li class=active is an image how would I do it? div id=medalist ul li class=activeimg src=media/nin2.jpg/a/li lia href=media/nintendo.swf/a/li liimg src=media/nin2.jpg/li liimg src=media/nin3.jpg /li /ul /div I have tried the following: if ($('#medialist li.active.is(img)')){ alert(true); }); } else{ alert(false); } but I'm fairly sure that the if ($('#medialist li.active.is(img)')) { line is wrong. Could someone point me in the right direction Thanks in advanced Jdenkaat
[jQuery] issue with block in a Div with scrollbar
Hi, I'm using .block while the content of a Div is refreshed. It's all fine if the scrollbar of that div is a the top, but if it's not, then the .block interface is no longer hiding the content of the grid. How can I align the top of the block ui with the position of the vertical scrollbar in the div ? Thanks
[jQuery] how to collage list of value in custom attribute
my form have custom attribute for configure jquery function like form id=tform input type=text name=email1 custom=req ,isEmail / input type=text name=email2 custom=eq|email1 / /form how to collage list of value in custom attribute in tform?
[jQuery] Re: sortable links
Hmmm... here's some example code i worked up really quick http://paste.pocoo.org/show/87852/ even *without* the bind and unbind it worked as it should (dragging an li or a sorted it, just clicking it made it go to the href) On Oct 13, 11:52 am, Alexandre Plennevaux [EMAIL PROTECTED] wrote: how about preventing event bubbling ? $(.mydraggable).click(function(e){ e.stopPropagation();}); On Mon, Oct 13, 2008 at 5:38 PM, MorningZ [EMAIL PROTECTED] wrote: Well, as mentioned above use the Sortable's event handlers (sort start, end, etc) to wire/unwire on an return false to the anchors... On Oct 13, 11:09 am, Adam [EMAIL PROTECTED] wrote: Actually, I am applying the sortable to an LI tag which contains the link, but if I sort and the mouse pointer is on top of the link, the link click event is still executed. On Oct 13, 10:09 am, Andy Matthews [EMAIL PROTECTED] wrote: He's not talking about clicking on the link to activate it, but clcking on it to drag and sort it. I will say that you might be better off applying the sortable to an LI tag which contains the link, rather than directly to the link itself. Remember that a link isn't technically a list, but a group of li tags are. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MorningZ Sent: Monday, October 13, 2008 9:04 AM To: jQuery (English) Subject: [jQuery] Re: sortable links if you don't want the user to go anywhere when clicking on a link, then why use a link? On Oct 13, 9:50 am, Adam [EMAIL PROTECTED] wrote: Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Form Fieldset
Hello, I have a form with 5 fieldsetss Does anyone knows how to do one of the following (or maybe a plugin)? 1. Collapse/Expand a fieldset when its legend is clicked. 2. Turn the fieldsets into tabs. When the form is submitted I should always have access to all form input values. Thanks, Miguel
[jQuery] Re: sortable links
how about preventing event bubbling ? $(.mydraggable).click(function(e){ e.stopPropagation();}); On Mon, Oct 13, 2008 at 5:38 PM, MorningZ [EMAIL PROTECTED] wrote: Well, as mentioned above use the Sortable's event handlers (sort start, end, etc) to wire/unwire on an return false to the anchors... On Oct 13, 11:09 am, Adam [EMAIL PROTECTED] wrote: Actually, I am applying the sortable to an LI tag which contains the link, but if I sort and the mouse pointer is on top of the link, the link click event is still executed. On Oct 13, 10:09 am, Andy Matthews [EMAIL PROTECTED] wrote: He's not talking about clicking on the link to activate it, but clcking on it to drag and sort it. I will say that you might be better off applying the sortable to an LI tag which contains the link, rather than directly to the link itself. Remember that a link isn't technically a list, but a group of li tags are. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MorningZ Sent: Monday, October 13, 2008 9:04 AM To: jQuery (English) Subject: [jQuery] Re: sortable links if you don't want the user to go anywhere when clicking on a link, then why use a link? On Oct 13, 9:50 am, Adam [EMAIL PROTECTED] wrote: Using the jquery UI plugin, I have setup a list of links (anchors) to be sortable, but after I sort an item, the link is executed, and I am taken to the web page for that link. Is there a way to setup the Sortable plugin to prevent this from happening?
[jQuery] Re: help with $.getJSON() ... just cant figure it out
Thanks Mickster and MorningZ! :) Gonna read up on those articles and functions tonight and give it a shot! :) I know its terrible practice but laziness always made me return AJAX requests as CSV strings that i'd then explode and access the array's indices (since i know in what order the values come) But yeah, terrible, i know I'm working on implementing JSON as the standard for my AJAX stuff which will not only make my code more buzzword-compliant but secure :) and yeah im aware that JSON isn't the magic solution to ajax security but it sure as hell beats plain-text! :) -Alex On Oct 13, 11:30 am, MorningZ [EMAIL PROTECTED] wrote: $.post gets some data, puts the outgoing data in the header, data comes back as whatever $.get gets some data, but puts the outgoing data on the querystring, data comes back as whatever $.getJSON gets some data, using get by default, data comes back and jQuery *expects* it to be a JSON object $.ajax The underlying call for all of the above As for a tip on a generic kind of jQuery parser, if you use getJSON then there is nothing to parse, the returned object *will* be a JSON object (as long as you properly crafted it on the server) if you need a more configurable version of getJSON, i wrote and use this wrapper function function reqJSON(url, params, success, error) { var CallParams = {}; CallParams.type = params.Method || POST; CallParams.url = url; CallParams.processData = true; CallParams.data = params; CallParams.dataType = json; CallParams.success = success; if (error) { CallParams.error = error; } $.ajax(CallParams); } and call it like so var Params = {}; Params.SomeKey1 = some value; Params.SomeKey2 = some value; Params.Method = GET; // or POST, which it defaults to reqJSON( url of server page, Params, function(json) { // if here, then json *is* a JSON object }, function(x,y,z) { // if here, then some error on server, x has the details } ); On Oct 13, 10:21 am, Alex Weber [EMAIL PROTECTED] wrote: first off, i dont get the difference between using $.ajax, $.post or $.get instead since the concept is the same afaik: you send a request and receive a response. the only difference in this case is that the response would be a JSON object... right? anyway... i've managed to generate tons of JSON objects of all sorts but haven't been able to come up with a decent parser thats not uber specific to each case... does anyone have any tips or a more generic kind of jQuery JSON parser and some help on how to put it all together? thanks!! -Alex
[jQuery] Re: $('div/')
Thanks to Felix Geisendörfer, he answered in his blog: It's an element not attached to the document tree. Until you attach it to an existing element it pretty much is isolated from anything else. On Oct 13, 9:43 am, Viktar [EMAIL PROTECTED] wrote: $('div/') returns array of one object. Is this some kind of virtual element? $('anything/') also returns one element. I am using this element to make html encode (Example $('div/ ').text('br/').html()). Is this jquery bug? I didn't find any documentation of this behavior. I don't want to rely on bug in my code.
[jQuery] Re: help with $.getJSON() ... just cant figure it out
Any security you feel like you get from JSON or CSV is flat out naive Either one is just as insecure as plain ol text The advantage of using the $.getJSON method (which remember, is just $.ajax but with the dataType set to json) is that you don't need to do anything special to parse it when you get it back from the call On Oct 13, 12:04 pm, Alex Weber [EMAIL PROTECTED] wrote: Thanks Mickster and MorningZ! :) Gonna read up on those articles and functions tonight and give it a shot! :) I know its terrible practice but laziness always made me return AJAX requests as CSV strings that i'd then explode and access the array's indices (since i know in what order the values come) But yeah, terrible, i know I'm working on implementing JSON as the standard for my AJAX stuff which will not only make my code more buzzword-compliant but secure :) and yeah im aware that JSON isn't the magic solution to ajax security but it sure as hell beats plain-text! :) -Alex On Oct 13, 11:30 am, MorningZ [EMAIL PROTECTED] wrote: $.post gets some data, puts the outgoing data in the header, data comes back as whatever $.get gets some data, but puts the outgoing data on the querystring, data comes back as whatever $.getJSON gets some data, using get by default, data comes back and jQuery *expects* it to be a JSON object $.ajax The underlying call for all of the above As for a tip on a generic kind of jQuery parser, if you use getJSON then there is nothing to parse, the returned object *will* be a JSON object (as long as you properly crafted it on the server) if you need a more configurable version of getJSON, i wrote and use this wrapper function function reqJSON(url, params, success, error) { var CallParams = {}; CallParams.type = params.Method || POST; CallParams.url = url; CallParams.processData = true; CallParams.data = params; CallParams.dataType = json; CallParams.success = success; if (error) { CallParams.error = error; } $.ajax(CallParams); } and call it like so var Params = {}; Params.SomeKey1 = some value; Params.SomeKey2 = some value; Params.Method = GET; // or POST, which it defaults to reqJSON( url of server page, Params, function(json) { // if here, then json *is* a JSON object }, function(x,y,z) { // if here, then some error on server, x has the details } ); On Oct 13, 10:21 am, Alex Weber [EMAIL PROTECTED] wrote: first off, i dont get the difference between using $.ajax, $.post or $.get instead since the concept is the same afaik: you send a request and receive a response. the only difference in this case is that the response would be a JSON object... right? anyway... i've managed to generate tons of JSON objects of all sorts but haven't been able to come up with a decent parser thats not uber specific to each case... does anyone have any tips or a more generic kind of jQuery JSON parser and some help on how to put it all together? thanks!! -Alex
[jQuery] jquery history_remote IE bug?
I'm not sure if this is a bug so I thought I'd ask folks and see what they had to say. I have some export links on a page, and despite me not using $.remote or $.history (I use $.click) when a user clicks on these export links in IE, if they use the browser back button afterwards, it tries to re- do the export. I'm not exactly sure what to do about this. I've looked at my code and looked at the plugin code, and nothing jumps out as me as the cause of this issue. Firefox handles it beautifully.
[jQuery] Re: Translate standard HREF's into JavaScript expressions -- string manipulation help..
Hi, Rather than replace the href in the source code you could add a click handler to call your JavaScript function. A bit like this: $(function(){ $('a[rel=paginate]').click(function(){ ajax_getPage($(this).attr(href).split(=)[1]); return false; }); }); Paul On Oct 12, 10:56 pm, jsw_nz [EMAIL PROTECTED] wrote: Just needing some pointers on jQuery string manipulation I have a content management system - in which I am applying experimental (jQuery) ajax functions - these work OK - ! But ather than hack the CMS source code, I want to create a function that replaces the standard hrefs that the CMS generates with javascript functions, which are triggered on Ajax success event basically here are the translation requirements: TRANSLATE FROM a rel=paginate href=index.php?aid=1-2content/a TO a href=javascript:ajax_getPage('1-2')content/a guessing it is a matter of getting the hrefs, based on rel=paginate as a selector; then replacing with the javascript string, where the key variable is aid, ie 1-2 in this case... I have tried getting this to work, but am having problems so wanted to ask if any more experience jQuery programmers might provide pointers thanks is advance.
[jQuery] Re: Check if contents of lis is an image
Try: $(document).ready(function(){ if ($('#medalist li.active').children().is('img')){ alert(true); }else{ alert(false); } }); There are typos errors in your sintaxe. Double check it! -Mensagem Original- De: jdenkaat [EMAIL PROTECTED] Para: jQuery (English) jquery-en@googlegroups.com Enviada em: segunda-feira, 13 de outubro de 2008 05:52 Assunto: [jQuery] Check if contents of lis is an image Hi If I have the following list and I want to find if the contents of li class=active is an image how would I do it? div id=medalist ul li class=activeimg src=media/nin2.jpg/a/li lia href=media/nintendo.swf/a/li liimg src=media/nin2.jpg/li liimg src=media/nin3.jpg /li /ul /div I have tried the following: if ($('#medialist li.active.is(img)')){ alert(true); }); } else{ alert(false); } but I'm fairly sure that the if ($('#medialist li.active.is(img)')) { line is wrong. Could someone point me in the right direction Thanks in advanced Jdenkaat
[jQuery] [validate] callback onblur on single input field
hi i'm using tha validation plugin on a very long form. It works fine everywhere but for one little issues: i need to trigger a function onblur of a single field: i got a tel and a mobile input field one of which is required (at least). How i trigger the callback after i fill the input to erase th error class from the other field? Thank Vitto
[jQuery] Re: jCarousel - flickr intergration
Thanks for the reply Jose, although that won't work in my scenario. I am using it for the very first slide so that the left arrow is disabled, but I can't determine when the end of the photostream has been reached in order to disable the right arrow - thats the problem I'm having! Check it out here: http://www.westcoastlife.co.za Regards Jason On Oct 10, 4:53 pm, Jose P. Carballo [EMAIL PROTECTED] wrote: *All I'm really looking for is a solution to not having a blank picture appearing when the it reaches the end of the photostream.* Well if I'm correct JCarousel controls is a .png picture called next-horizontal.png and another one called prev-horizontal.png. Usually is a picture with 4 arrows, where the brighter arrow is the one displayed once the scrolling reaches the end. In my implementation I just cutted out this arrow with a photo editor (like gimp), and when scrolling reaches the end the right arrow, or left arrow is not displayed and automatically JCarousel understands. *or alternatively, how to start scrolling from the beginning again. * I think that's called a circular feature and is also there somehwere in sorgallascom reference. Hope this helps. 2008/10/10 JBagley [EMAIL PROTECTED] I'm using Sorgalla.com's excellent jCarousel plugin on http://www.westcoastlife.co.za and integrating it with a flickr photostream: http://www.flickr.com/photos/westcoastlife/sets/72157607068305740/ The problem I am having is that I don't know how to determine when the end of the photostream has been reached, and then disabling the controls, or alternatively, how to start scrolling from the beginning again. Here is the code that I'm currently using on the dynamic_flickr_api.php: $url = 'http://api.flickr.com/services/rest/? method=flickr.photosets.getPhotosapi_key=http://api.flickr.com/services/rest/?method=flickr.photosets.getPhoto...' . $api_key . 'photoset_id=72157607068305740'; Other than that, I haven't made much changes to the code that is supplied onhttp://sorgalla.com/jcarousel/ All I'm really looking for is a solution to not having a blank picture appearing when the it reaches the end of the photostream. Thanks in advance Jason Bagley -- Jose Pablo Carballo
[jQuery] Re: help with $.getJSON() ... just cant figure it out
true :) short of encrypting the hell outta all my responses and then decrypting them client-side there's nothing to do really.. and even in that case since the decryption is done client-side the algorithm would be easily accessible :P i guess just try not to pass sensitive information and also minify production js to make it less easy for people to glance at it and see whats goin on :) On Mon, Oct 13, 2008 at 1:21 PM, MorningZ [EMAIL PROTECTED] wrote: Any security you feel like you get from JSON or CSV is flat out naive Either one is just as insecure as plain ol text The advantage of using the $.getJSON method (which remember, is just $.ajax but with the dataType set to json) is that you don't need to do anything special to parse it when you get it back from the call On Oct 13, 12:04 pm, Alex Weber [EMAIL PROTECTED] wrote: Thanks Mickster and MorningZ! :) Gonna read up on those articles and functions tonight and give it a shot! :) I know its terrible practice but laziness always made me return AJAX requests as CSV strings that i'd then explode and access the array's indices (since i know in what order the values come) But yeah, terrible, i know I'm working on implementing JSON as the standard for my AJAX stuff which will not only make my code more buzzword-compliant but secure :) and yeah im aware that JSON isn't the magic solution to ajax security but it sure as hell beats plain-text! :) -Alex On Oct 13, 11:30 am, MorningZ [EMAIL PROTECTED] wrote: $.post gets some data, puts the outgoing data in the header, data comes back as whatever $.get gets some data, but puts the outgoing data on the querystring, data comes back as whatever $.getJSON gets some data, using get by default, data comes back and jQuery *expects* it to be a JSON object $.ajax The underlying call for all of the above As for a tip on a generic kind of jQuery parser, if you use getJSON then there is nothing to parse, the returned object *will* be a JSON object (as long as you properly crafted it on the server) if you need a more configurable version of getJSON, i wrote and use this wrapper function function reqJSON(url, params, success, error) { var CallParams = {}; CallParams.type = params.Method || POST; CallParams.url = url; CallParams.processData = true; CallParams.data = params; CallParams.dataType = json; CallParams.success = success; if (error) { CallParams.error = error; } $.ajax(CallParams); } and call it like so var Params = {}; Params.SomeKey1 = some value; Params.SomeKey2 = some value; Params.Method = GET; // or POST, which it defaults to reqJSON( url of server page, Params, function(json) { // if here, then json *is* a JSON object }, function(x,y,z) { // if here, then some error on server, x has the details } ); On Oct 13, 10:21 am, Alex Weber [EMAIL PROTECTED] wrote: first off, i dont get the difference between using $.ajax, $.post or $.get instead since the concept is the same afaik: you send a request and receive a response. the only difference in this case is that the response would be a JSON object... right? anyway... i've managed to generate tons of JSON objects of all sorts but haven't been able to come up with a decent parser thats not uber specific to each case... does anyone have any tips or a more generic kind of jQuery JSON parser and some help on how to put it all together? thanks!! -Alex
[jQuery] Changing Pictures and Frames
I have more than 20 pictures. I'd like to show them in different frames, let's say 5 different kinds of frames. I want to set up showing a default picture and frame. And you can select one of frames and hover pictures to see how it fits. I bought two jquery books, and started reading them. So I am a begginner. Could anyone help me how to do it, or any website I can refer to? Thanks in advance.
[jQuery] Re: Thickbox vs jqModal
Thanks for your suggestions !! Any body have any view for it On Oct 13, 11:51 am, Alexandre Plennevaux [EMAIL PROTECTED] wrote: I personally prefer jqmodal, the result is snappier. Maybe this conversion tutorial will help you out:http://www.pixeline.be/blog/2008/javascript-loading-external-urls-in-... cheers, alexandre LAb[au] _ *lab*oratory for *a*rchitecture and *u*rbanism Alexandre Plennevaux Lakensestraat 104 Rue de Laeken Brussel 1000 Bruxelles België _ Belgique _ Belgium tel:+32 (0)2 2196555 fax: +32 (0)2 4266986 mail: [EMAIL PROTECTED] [EMAIL PROTECTED]http://www.lab-au.com VAT: BE0475.210.720 On Mon, Oct 13, 2008 at 7:43 AM, bookme [EMAIL PROTECTED] wrote: Hi, I am confused what plugin should I use either Thickbox or jqModal? Can some body tell me which one is better in terms of performance, look and feel and for future help Thanks
[jQuery] Re: jCarousel problem in Safari 3.1.2: next button disabled
damn this has been driving me crazy all day! and i can only find you with the same problem... after going round in circles i have found that for some reason to enable jCarousel in safari the code needs to be in the page rather than an external file??? I hope someone might be able to shed a little light to why it does this, or a workaround On Oct 3, 5:06 pm, Ben Byrne [EMAIL PROTECTED] wrote: I love jCarousel and have used it with success, but I'm in a situation where it's not behaving as expected in Safari (works fine in Firefox, thankfully). The next button, while being rendered in the DOM, isn't being enabled — both the CSS class and HTML attribute for disabled are remaining present according to Safari's element inspector. Safari's error console reports no javascript errors. You can see it athttp://dev.byrnecreative.com-- click any of the 3 nav items and then any sub-nav item to bring up the carousel. Any insight? Thanks, Ben Byrne
[jQuery] Newbie traversal question
I have a click event tied to an element and I need to access a grandparent element that is quite a few jumps away. I could count the jumps and hard code it but is there a way to recursively roll out until you reach a parent that matches a given id? Or do you manually have to do it? Cheers in advance for any replies. -- View this message in context: http://www.nabble.com/Newbie-traversal-question-tp19958727s27240p19958727.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] JQuery Selector and Java Script Variable
Hiya, I've not been able to find an answer to this online! can someone point out the correct syntax for this: var myRel = $(this).attr(rel); var largePath = $('a[rel*=' + myRel +']').attr(href); Basicly the myRel gets set correctly, but how do i use the javascript variable as part of the jquery selector so that i can get a selector that looks like: (assuming myRel was 5)... var largePath = $('a[rel*=5]').attr(href); Thanks in advance! Shadi
[jQuery] Trouble getting parent anchor tag of child list
I have nested lists that are are trigged by clicking on an anchor tag. I hardcode a specific sublist to display initially, which works. The problem is parent anchors that have sublists get two arrows, down and right, depending on if it's expanded or not, and I can't get the down arrow to display initially. I am trying to add a class to the parent anchor tag based on the selected child sublist to expand. function initMenu() { $('ul.mainmenu ul').hide(); var expandDefaultMenu = $('ul.mainmenu ul:eq(0)'); //First submenu expanded expandDefaultMenu.parent('a').addClass('defaultopen'); // -- Cannot get this to work. expandDefaultMenu.show(); $('ul.mainmenu li a').click( function() { var checkElement = $(this).next(); if((checkElement.is('ul')) (checkElement.is(':visible'))) { $(this).css('background-image','url(/images/templates2008/ arrowright.gif)'); checkElement.slideUp('normal'); return false; } if((checkElement.is('ul')) (!checkElement.is(':visible'))) { $(this).css('background-image','url(/images/templates2008/ arrowdown.gif)'); $('ul.mainmenu ul:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; } } ); } $(document).ready(function() { initMenu(); });
[jQuery] JQuery Selector and Java Script Variable
Hiya, I've not been able to find an answer to this online! can someone point out the correct syntax for this: var myRel = $(this).attr(rel); var largePath = $('a[rel*=' + myRel +']').attr(href); Basicly the myRel gets set correctly, but how do i use the javascript variable as part of the jquery selector so that i can get a selector that looks like: (assuming myRel was 5)... var largePath = $('a[rel*=5]').attr(href); Thanks in advance! Shadi
[jQuery] TreeView plugin
Even considering the TV plugin works nice ,we need some specific features like handling each graph (+,- ) instead of using an unique image.Plus we need to generate them from a Perl CGI ,using our interface.We are advanced on the matter but I think a check with the group would be useful. Comments welcome. R Jorge Borgia Trieste
[jQuery] Different Namespace Tags
Hello. I have appended a svg into the html. Now I want to get those svgs in jquery wrapper but I couldnt manage to fin a way. Below is the code. How can I get different namspace tags by jQuery. html xmlns=http://www.w3.org/1999/xhtml; xmlns:svg=http://www.w3.org/2000/svg; head script type=text/javascript src=http://jqueryjs.googlecode.com/ files/jquery-1.2.6.min.js /script /head body h1SVG embedded inline in XHTML/h1 svg:svg width=300px height=200px svg:circle cx=150 cy=100 r=50 fill=#ff/ /svg:svg h2 onclick=alert(jQuery('svg:svg').length)Click Me/h2 /body /html
[jQuery] Re: JQuery Selector and Java Script Variable
That looks like the proper syntax to get your desired selector. Are you getting an error or unexpected results? -- Josh - Original Message - From: Shadi Almosri [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, October 13, 2008 9:32 AM Subject: [jQuery] JQuery Selector and Java Script Variable Hiya, I've not been able to find an answer to this online! can someone point out the correct syntax for this: var myRel = $(this).attr(rel); var largePath = $('a[rel*=' + myRel +']').attr(href); Basicly the myRel gets set correctly, but how do i use the javascript variable as part of the jquery selector so that i can get a selector that looks like: (assuming myRel was 5)... var largePath = $('a[rel*=5]').attr(href); Thanks in advance! Shadi
[jQuery] Re: Thickbox vs jqModal
Thanks to all of you! But Now got more congused by. I am using jquery validation plugin in thickbox plugin but this function : equalTo: Enter the same password as above was not working so planning to move to new UI modal. can somebody tell me why this is not working? Thanks On Oct 13, 7:02 pm, Alex Weber [EMAIL PROTECTED] wrote: i use SimpleModal! :)http://www.ericmmartin.com/projects/simplemodal/ On Oct 13, 8:22 am, MorningZ [EMAIL PROTECTED] wrote: I also use jqModal i'm not sure what view you are looking for... use which ever one makes more sense for you and is easier for you to code/understand functionally they do the same things (as does UI's modal) On Oct 13, 5:01 am, bookme [EMAIL PROTECTED] wrote: Thanks for your suggestions !! Any body have any view for it On Oct 13, 11:51 am, Alexandre Plennevaux [EMAIL PROTECTED] wrote: I personally prefer jqmodal, the result is snappier. Maybe this conversion tutorial will help you out:http://www.pixeline.be/blog/2008/javascript-loading-external-urls-in-... cheers, alexandre LAb[au] _ *lab*oratory for *a*rchitecture and *u*rbanism Alexandre Plennevaux Lakensestraat 104 Rue de Laeken Brussel 1000 Bruxelles België _ Belgique _ Belgium tel:+32 (0)2 2196555 fax: +32 (0)2 4266986 mail: [EMAIL PROTECTED] [EMAIL PROTECTED]http://www.lab-au.com VAT: BE0475.210.720 On Mon, Oct 13, 2008 at 7:43 AM, bookme [EMAIL PROTECTED] wrote: Hi, I am confused what plugin should I use either Thickbox or jqModal? Can some body tell me which one is better in terms of performance, look and feel and for future help Thanks
[jQuery] Re: jquery validation
Hi Eric! data[User][password]: { required: Provide a password, rangelength: jQuery.format(Enter at least {0} characters) }, data[User][password2]: { required: Repeat your password, minlength: jQuery.format(Enter at least {0} characters), equalTo: Enter the same password as above This equalTo is not working ? Do u have any solution why is not working? Thanks On Oct 12, 11:50 pm, Eric [EMAIL PROTECTED] wrote: Plugins sometimes conflict. One of the mark of a goodpluginis a minimum of conflicts. Also, the tricks we sometimes have to play on the DOM can interact in non-intuitive ways. Can you please describe in more detail the problem that you're having? You may also try to use other plugins, such as jqModal (http:// dev.iceburg.net/jquery/jqModal/) instead of Thickbox. -E On Oct 12, 2:32 pm, bookme [EMAIL PROTECTED] wrote: Thanks a lot to u jorn. I am facing one more problem. Belowvalidationis working without thickboxpluginbut when I used it in thickbox it's not working ? I think equalTo function is not working in thickbox? data[User][password2]: { required: Repeat your password, minlength:jQuery.format(Enter at least {0} characters), equalTo: Enter the same password as above } Please help me Thanks On Oct 12, 8:30 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Seehttp://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl... Jörn On Sun, Oct 12, 2008 at 4:49 PM, bookme [EMAIL PROTECTED] wrote: Hi, I am usingJquerypluginfor client sidevalidation. But due to a filednameI am facing a problem. Example var validator = $(#UserSignupForm).validate({ rules: { data[User][username]: { required: true, minlength: 2, remote: users.php } }); HTML :inputid=id_username1 name=data[User][username] type=text value= maxlength=50 / When I am using data[User][username] as a filed name injquery validation, it's not working but in case of other name like username it's working. I think there is problem of [][] (bracket of array). But I can notchange data[User][username] so I want to use id_username1 instead of filename invalidationpluginbut don't know how to use ID?. Is there any other solution? Also I have to face same problem in many plugins becuase CakePHP return name like data[User][username] so How can I override a name fromID? Please Help me Thanks
[jQuery] Ajax update on visible viewport of my div
Hi, I have a scrollable div containing a table that can have like 100 thousands of lines from my database. I want to have an ajax update every 5 seconds on this data. So I tought I could update only the records which are visible in the area of the div that the user scrolled to. How would you achieve this ? Is there any way to bind an event on a scroll event ? Thank you for any advice. -- View this message in context: http://www.nabble.com/Ajax-update-on-visible-viewport-of-my-div-tp19959477s27240p19959477.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Thickbox vs jqModal
We'll need a larger code sample to help you out. Are you using Equal To as an in-html class name? or are you using it as a part of a Rules object that's passed to the validate() call? -E On Oct 13, 1:46 pm, bookme [EMAIL PROTECTED] wrote: Thanks to all of you! But Now got more congused by. I am using jquery validation plugin in thickbox plugin but this function : equalTo: Enter the same password as above was not working so planning to move to new UI modal. can somebody tell me why this is not working? Thanks On Oct 13, 7:02 pm, Alex Weber [EMAIL PROTECTED] wrote: i use SimpleModal! :)http://www.ericmmartin.com/projects/simplemodal/ On Oct 13, 8:22 am, MorningZ [EMAIL PROTECTED] wrote: I also use jqModal i'm not sure what view you are looking for... use which ever one makes more sense for you and is easier for you to code/understand functionally they do the same things (as does UI's modal) On Oct 13, 5:01 am, bookme [EMAIL PROTECTED] wrote: Thanks for your suggestions !! Any body have any view for it On Oct 13, 11:51 am, Alexandre Plennevaux [EMAIL PROTECTED] wrote: I personally prefer jqmodal, the result is snappier. Maybe this conversion tutorial will help you out:http://www.pixeline.be/blog/2008/javascript-loading-external-urls-in-... cheers, alexandre LAb[au] _ *lab*oratory for *a*rchitecture and *u*rbanism Alexandre Plennevaux Lakensestraat 104 Rue de Laeken Brussel 1000 Bruxelles België _ Belgique _ Belgium tel:+32 (0)2 2196555 fax: +32 (0)2 4266986 mail: [EMAIL PROTECTED] [EMAIL PROTECTED]http://www.lab-au.com VAT: BE0475.210.720 On Mon, Oct 13, 2008 at 7:43 AM, bookme [EMAIL PROTECTED] wrote: Hi, I am confused what plugin should I use either Thickbox or jqModal? Can some body tell me which one is better in terms of performance, look and feel and for future help Thanks
[jQuery] Re: jquery validation
As described in this section of the Validation documentation, 'equalTo:' takes an expression which relates to another element, and it goes inside the 'rules:' object in the options. You seem to be describing the messages below. Where is your code that defines the rules? May I recommend posting your code to JSBin.com so that we can collaboratively debug it? -E On Oct 13, 1:48 pm, bookme [EMAIL PROTECTED] wrote: Hi Eric! data[User][password]: { required: Provide a password, rangelength: jQuery.format(Enter at least {0} characters) }, data[User][password2]: { required: Repeat your password, minlength: jQuery.format(Enter at least {0} characters), equalTo: Enter the same password as above This equalTo is not working ? Do u have any solution why is not working? Thanks On Oct 12, 11:50 pm, Eric [EMAIL PROTECTED] wrote: Plugins sometimes conflict. One of the mark of a goodpluginis a minimum of conflicts. Also, the tricks we sometimes have to play on the DOM can interact in non-intuitive ways. Can you please describe in more detail the problem that you're having? You may also try to use other plugins, such as jqModal (http:// dev.iceburg.net/jquery/jqModal/) instead of Thickbox. -E On Oct 12, 2:32 pm, bookme [EMAIL PROTECTED] wrote: Thanks a lot to u jorn. I am facing one more problem. Belowvalidationis working without thickboxpluginbut when I used it in thickbox it's not working ? I think equalTo function is not working in thickbox? data[User][password2]: { required: Repeat your password, minlength:jQuery.format(Enter at least {0} characters), equalTo: Enter the same password as above } Please help me Thanks On Oct 12, 8:30 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Seehttp://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl... Jörn On Sun, Oct 12, 2008 at 4:49 PM, bookme [EMAIL PROTECTED] wrote: Hi, I am usingJquerypluginfor client sidevalidation. But due to a filednameI am facing a problem. Example var validator = $(#UserSignupForm).validate({ rules: { data[User][username]: { required: true, minlength: 2, remote: users.php } }); HTML :inputid=id_username1 name=data[User][username] type=text value= maxlength=50 / When I am using data[User][username] as a filed name injquery validation, it's not working but in case of other name like username it's working. I think there is problem of [][] (bracket of array). But I can notchange data[User][username] so I want to use id_username1 instead of filename invalidationpluginbut don't know how to use ID?. Is there any other solution? Also I have to face same problem in many plugins becuase CakePHP return name like data[User][username] so How can I override a name fromID? Please Help me Thanks
[jQuery] Re: jquery validation
oops. forgot link to Validation documentation: http://docs.jquery.com/Plugins/Validation/Methods/equalTo On Oct 13, 2:08 pm, Eric [EMAIL PROTECTED] wrote: As described in this section of the Validation documentation, 'equalTo:' takes an expression which relates to another element, and it goes inside the 'rules:' object in the options. You seem to be describing the messages below. Where is your code that defines the rules? May I recommend posting your code to JSBin.com so that we can collaboratively debug it? -E On Oct 13, 1:48 pm, bookme [EMAIL PROTECTED] wrote: Hi Eric! data[User][password]: { required: Provide a password, rangelength: jQuery.format(Enter at least {0} characters) }, data[User][password2]: { required: Repeat your password, minlength: jQuery.format(Enter at least {0} characters), equalTo: Enter the same password as above This equalTo is not working ? Do u have any solution why is not working? Thanks On Oct 12, 11:50 pm, Eric [EMAIL PROTECTED] wrote: Plugins sometimes conflict. One of the mark of a goodpluginis a minimum of conflicts. Also, the tricks we sometimes have to play on the DOM can interact in non-intuitive ways. Can you please describe in more detail the problem that you're having? You may also try to use other plugins, such as jqModal (http:// dev.iceburg.net/jquery/jqModal/) instead of Thickbox. -E On Oct 12, 2:32 pm, bookme [EMAIL PROTECTED] wrote: Thanks a lot to u jorn. I am facing one more problem. Belowvalidationis working without thickboxpluginbut when I used it in thickbox it's not working ? I think equalTo function is not working in thickbox? data[User][password2]: { required: Repeat your password, minlength:jQuery.format(Enter at least {0} characters), equalTo: Enter the same password as above } Please help me Thanks On Oct 12, 8:30 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Seehttp://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl... Jörn On Sun, Oct 12, 2008 at 4:49 PM, bookme [EMAIL PROTECTED] wrote: Hi, I am usingJquerypluginfor client sidevalidation. But due to a filednameI am facing a problem. Example var validator = $(#UserSignupForm).validate({ rules: { data[User][username]: { required: true, minlength: 2, remote: users.php } }); HTML :inputid=id_username1 name=data[User][username] type=text value= maxlength=50 / When I am using data[User][username] as a filed name injquery validation, it's not working but in case of other name like username it's working. I think there is problem of [][] (bracket of array). But I can notchange data[User][username] so I want to use id_username1 instead of filename invalidationpluginbut don't know how to use ID?. Is there any other solution? Also I have to face same problem in many plugins becuase CakePHP return name like data[User][username] so How can I override a name fromID? Please Help me Thanks
[jQuery] Re: How to use a custom ajax code in page that was loaded with .load()?
That works now, but I have some issues with other functions. Apparently, the problem is not in loading the external javascript files as I previously thought, they load correctly just with .load() function. Problem is in window.onload function. This part of the script is causing the problem: window.onload = init; function init() { var ajax = getXMLHttpRequestObject(); if (ajax) { if (document.getElementById('results')) { document.getElementById('loginform').onsubmit = function() { var postdata = name= + document.getElementById('form1').value + pass= + document.getElementById('form2').value + message= + document.getElementById('message').value; if (document.getElementById('cbx').checked) { postdata += chkbx=1; } ajax.open('post', 'bazajax.php', true); ajax.setRequestHeader(Content-type, application/x-www-form- urlencoded); ajax.onreadystatechange = function() { handler(ajax); } ajax.send(postdata); return false; } // end anonymous postdata } // end DOM } // end if } // end init If I delete window.onload = init and init function, everything will work correctly (in FF IE, but not in Chrome) when loaded through jquery's .load(). But if I start the page manually, like edit.php? edit=about, it will not, because it cannot initialize. Is there a way for me to code so that it'll work in both ways and in all browsers? I see the trouble is with onload event, because it does not know when to fire as the page is loaded through jquery's ajax. Thanks. On Oct 13, 2:31 pm, joel boonstra [EMAIL PROTECTED] wrote: On Oct 12, 5:41 pm, ivframes [EMAIL PROTECTED] wrote: I have a page that loads with jquery's .load() function. However, that page is a form with two custom JS files attached. When I load it separately, the JS code works. However, when used with .load(), it does not. What I'm missing here? Can you post some code so we can see how the custom JS files are attached to the content you pull in with .load()? -- joel
[jQuery] Re: New to Jquery, have written Validation script...
I've done something similar to this, where validation is may be run at either field level or on form submit, or both (default is both, can be overridden by invocation setting, below). http://beta.ksscholl.com/jquery/formvalidate.html Routine is invoked by the following snippet in the HEAD of the document: $(#myFormSample).jqValidate({ // validateAt : both, // blur | submit | both passMin : 6 }); The validation script itself is the bottom half of the following: http://beta.ksscholl.com/jquery/js/jqforms.js and checks that required fields have data, as well as various specialized fields have proper formatting and such. I'm quite sure that it could be cleaned up considerably by anyone more versed than myself in the intricacies of jQuery, but I'm pretty pleased thus far. Kevin On Oct 13, 10:45 am, Nishan Karassik [EMAIL PROTECTED] wrote: Wouldn't the $(#my-form [EMAIL PROTECTED]'input']).blur(function() { be my trigger? I would like to validate as the user tabs through the form. How would I not run the function if the field just tabbed from is blank? Thanks for your validation of my script. Nishan On Oct 13, 7:30 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Validation should always hook into the submit event, eg. $(#myform).submit(function() { ... }); That handles both clicking the submit button as well as hitting enter while an input field has focus. Apart from that, the form plugin handles submitting forms via ajax and handling the response quite well, including file uploads:http://malsup.com/jquery/form/ Jörn On Mon, Oct 13, 2008 at 5:57 AM, Nishan Karassik [EMAIL PROTECTED] wrote: Hello, I have never written a Jquery script, but have, over the last few days, compiled the following, but was hoping someone could look over this to see if I had problems. $(document).ready(function () { $(#my-form [EMAIL PROTECTED]'input']).blur(function() { var queryString = $.(#my-form).formSerialize(); $.post(/path/to/your/validation.php, queryString, function(validation_errors) { // do something like changing a css class, disable submit... $.each(validation_errors, function(err_id, err_message) { $(err_id).val() = err_message; } )}; }); )}); Thanks, Nishan
[jQuery] jFrame and images - need help
So something is going very wonky with jFrame. When a page loads into a div, and I click on an image, it spits out the longest string of unreadable junk. Qa2q��B�R#��3���brCS$����?���Lz%�2��쩻 �`�1��H5i�G�0��E�{wd�{��M���TGܙi��Qn��#J���l9U[�իxw��4V�l! �Bb�m�or ��.q ]�a����� ���S��$�7|�f�~V���b� M�/ m���f�Le,�7��Z�R�oZW7�I����m�n.P�sW51���*��(�B� �l�1�1 ��JM?ȝo�~��:��;%�x!D��pQG괴 z�ZF���_�Tڏ�P(��Ǯ�2�Oq UT��^�IV�m�뾙 T;[EMAIL PROTECTED]SB��Q��i�� What is going on here? is it at all possible to use jQuery and jFrame to load content into a div, an then use ThickBox to open that image? Thanks!
[jQuery] preventDefault() question
Hi guys, I'm new to jQuery but already see lots of potential to use it above let's say Flash. Very excited about learning more!! I have a question pertaining the jQuery event.preventDefault() method: Is there a way to reinvoke the default action again? I would like to fade out or ease out (haven't made up my mind as yet) certain elements on a website on clicking a hyperlink. So I figured I'd make use of jQuery's animation effects methods. At the moment I use the preventDefault method to stop the browser from retrieving the URL. But I would certainly need the browser to retrieve the page after the animation effects are done. So far I couldn't come up with anything better than just using javascripts 'this.location.href'. But I figured there might also be some API in the core for this. Kind regards, Dwayne!
[jQuery] Re: jQuery selector that matches dd's elements
I doubt that will work, since all of the dd elements are siblings of the clicked dt. Mauricio, Take a look at the nextUntil plugin. That should do what you're looking for: http://docs.jquery.com/JQuery_1.2_Roadmap#.nextUntil.28.29_.2F_.prevUntil.28.29 After including the plugin, you can do this: $('dt').click(function() { $(this).nextUntil('dt').doSomething(); }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 10, 2008, at 2:56 PM, [EMAIL PROTECTED] wrote: This should work for you: $('dt').click(function() { $(this).nextAll('dd').doSomething() });
[jQuery] draggable performance issues
On Firefox 2.0, Linux, I'm seeing horrible performance issues on a draggable div. I thought it might be due to images in the div, but I removed all of that and even a simple div with little content performs poorly. Interestingly enough the demo on the jqueryUI site works great. This makes me think it's something else on my page. My question is: what kinds of things could effect the performance of the draggable?
[jQuery] Re: .after not really after
Exactly and thats what I did to make it work. thanks, Johan On Oct 9, 8:58 am, ricardobeat [EMAIL PROTECTED] wrote: DIVs are not allowed inside a table like that anyway, you should be adding another tr and td for the map - right now the browser is figuring it out and doing that job for you. - ricardo On Oct 9, 12:42 am, Johanm [EMAIL PROTECTED] wrote: you're right. thats whats going on. I didnt have any table tags in the initial load image but only in the resultset i get from the ajax call (sloppy coding). This made the call end up in an ugly place and THEN add the table tags which then was of no good. thank you! Johan On Oct 8, 7:59 pm, Dave Methvin [EMAIL PROTECTED] wrote: i was under the impression that .after should be after the /td and not after the tr which is an append to me. If this is the clicked row, $(this).append(tdhi/td) puts a new td inside the tr, at the end. $(this).after(trtdhi/td/tr); puts a new tr after this one. $(this).after(div id=\mytripinfoblock\img src=\/ You're putting a div there? Inside or outside the tr, that seems wrong. Did you want to put it in one of the td elements in the clicked row? if ($(#mytripinfoblock).length 0) { $(#mytripinfoblock).fadeOut(slow); $(#mytripinfoblock).remove(); } Try this instead. If there is no element the rest of the chain doesn't execute so you don't need to use an if. However, you do want to wait for the fade to complete before removing the element. $(#mytripinfoblock).fadeOut(slow, function(){ $(this).remove(); });
[jQuery] Saving draggable div positions to html?
Is it possible to save the state of a draggable DIV's position? I can make a DIV draggable as explained here: http://docs.jquery.com/UI/Draggables But how can I acquire the new DIV position, and save it somewhere, so that when my web page is accessed again, the new DIV position is remembered. I don't want to use cookies.
[jQuery] How to avoid throbbing Hover actions?
Using either $.fn.hover or $.fn.mouse(over|out), I can't figure out how to prevent my animations from firing repeatedly. You'll see what I mean: http://703designs.com/jQuery/port.php (view source to see what's going on). How would I change this so that the over/hover event can't fire until the element is finished with its current animation? How would I change this so an animation only continues until the mouse leaves rather than taking the full step from 80px h/w to 120px h/w?
[jQuery] Re: Variable Scope
I tried it out and it fixes the problem - thanks a ton Michael!
[jQuery] Re: jQuery Package Downloader
Nice work on the packager, Stuart. It's something we've considered including in the past, but never implemented -- except, of course, for jQuery UI. One drawback of offering a public packager such as this one is that it makes third-party troubleshooting and support quite a bit more difficult. One of the nice things about helping others on this list, for example, is that we all know what we're dealing with. We can offer suggestions based on the assumption that everyone has all the core functionality at his or her disposal. Imagine how hard it would be with the 49 varieties of jQuery core available from this packager. This level of fine-tuning is already available for more experienced coders who want to pull down the svn copy and build their own jQuery core from the individual files in the /src/ directory. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 12, 2008, at 9:35 AM, Isaak Malik wrote: Alexandra, it doesn't necessarily mean that every developer uses all the jQuery features. Some might only need the core feature while some the AJAX features, this will give them the opportunity to customize their framework. On Sun, Oct 12, 2008 at 2:55 PM, Alexandre Plennevaux [EMAIL PROTECTED] wrote: maybe and then, maybe not, depending on the case : the kilobyte footprint of jquery minified is light, compared to the footprint of additional server requests for each additional file to load. at the very least, a production website should have all its javascript compiled into one single minified file. This is left to the responsibility of the web developer to decide that according to its own project, not to this gentleman's fine download application, of course. On Sun, Oct 12, 2008 at 12:25 PM, Isaak Malik [EMAIL PROTECTED] wrote: Very interesting, such a feature should be implemented on the main jQuery website. On Sat, Oct 11, 2008 at 8:35 PM, stuartloxton [EMAIL PROTECTED] wrote: Just to let you all know even though this is my first post it may seem a tad spammy but it's not. It just happens I didn't have an account on general discussion yet. I've just kind of alpha released a super small jquery downloader. Allowing you to choose exactly what parts of jQuery you need creating a REALLY small download. http://demos.stuartloxton.com/downloader/ I'm still making changes to it, theres a larger description, and some notes on stuff I'm going to change on my site over at: http://stuartloxton.com/creating-a-really-small-jquery/ All feedback is welcome! Thanks, Stuart -- Isaak Malik Web Developer -- Isaak Malik Web Developer
[jQuery] Re: Match the filename to highlight current link on page
You could try something like this: function filterPath(pathString) { return pathString.replace(/^\//,'').replace(/\/(index\.\w{3,4})? $/,'') } $('a').filter(function() { return filterPath(this.pathname) == filterPath(location.pathname); }).addClass('active'); Then, style an active class in your stylesheet. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 13, 2008, at 7:22 AM, suntrop wrote: No one can help? I tought with jquery one can select everything!
[jQuery] Cycle actions that happen faster than the javascript transitions
For actions that happen faster than the javascript transitions, is there a way to make the javascript break it's current loop, and start doing the new action?
[jQuery] Re: jQuery selector that matches dd's elements [SOLVED]
@Paperboy: Sorry, both solutions you pointed out selects ALL dd after the dt clicked. Tks! @Karl: The plugin you pointed out do the job. Tks! Maurício
[jQuery] Re: Calling seperate function in each()
How about this? It creates a couple of custom events (showme and hideme) that you trigger to set the state, and the click event just delegates to the right one based on the current state. I just triggered a click on CollapseAll to set the initial state; if you didn't want the coloring to be there you could add some code to remove it at the bottom. $(document).ready(function() { $(a.Category) .bind('showme', function() { $(this).data(hidden, false).parent(li) .css({background: #00ff00}).children(ul).show(); return false; }) .bind('hideme', function() { $(this).data(hidden, true).parent(li) .css({background: #ff}).children(ul).hide(); return false; }) .bind('click', function() { $(this).trigger($(this).data(hidden)? showme : hideme); return false; }); $(#ExpandAll).bind('click', function() { $(a.Category).trigger(showme); return false; }); $(#CollapseAll).bind('click', function() { $(a.Category).trigger(hideme); return false; }).trigger(click); });
[jQuery] Flowplayer, Facebox and jQuery odd behavior - Works on Dev but not on others
I am having a strange problem. I am using jQuery 1.2.6, Flowplayer and Facebox for a little effect that opens a Facebox when a video is done playing. All the code seems to be right. It plays great on my dev machine. Then when I load it to a server, again plays great. But if I go to any other machine, and access the same URL, it doesn't work. Which made me think it was a cache issue, but I can empty the cache, refresh and the problem persists. Same if I try to load on my dev machine. Works great until I go to a different machine. Here is the links... and suggestions would be helpful. Thanks. Complete Concept: http://ui.davemerwin.com/orcas/tween-safety/ jQuery: http://ui.davemerwin.com/orcas/tween-safety/js/site.settings.js Thanks!
[jQuery] Re: id same as name confuses JQuery?
I assume your use of braces instead of parenthesis is just a typo? I am unable to reproduce this. This works for me: $('body').append('div id=foobar name=foobar.../div'); $('#foobar').size(); // 1 Could you provide a sample page? --Erik On Mon, Oct 13, 2008 at 1:30 PM, Tim Scott [EMAIL PROTECTED] wrote: Given this element... div id=foo name=foo/div ...why this does not match the element... ${'#foo'} If I change or remove the name attribute, it does match. Is this by design or a bug?
[jQuery] id same as name confuses JQuery?
Given this element... div id=foo name=foo/div ...why this does not match the element... ${'#foo'} If I change or remove the name attribute, it does match. Is this by design or a bug?
[jQuery] [Autocomplete] Use of flush cache in autocomplete plugin and how to update data
How can I update the data from autocomplete plugin? I tried it with flushCache, but it doesn't work. Someone has a example code that could show me? -- Att, Antonio Lazaro
[jQuery] Re: Newbie traversal question
... is there a way to recursively roll out until you reach a parent that matches a given id? It sounds like you want .parents(selector), which looks for the ancestor elements matching the selector. http://docs.jquery.com/Traversing/parents#expr
[jQuery] Re: id same as name confuses JQuery?
As Erik says, a sample page would help. I am guessing that you may be using IE6/7, where getElementById returns elements that match the name attribute as well. Also, what doctype are you using? I don't think any of the common ones support a name attribute for the div element.
[jQuery] Re: Accordion problem - closing issue
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html lang=en head script src=http://jqueryjs.googlecode.com/files/ jquery-1.2.6.pack.js type=text/javascript charset=utf-8/script script src=http://ui.jquery.com/js/ui.js; type=text/javascript charset=utf-8/script script type=text/javascript charset=utf-8 $(document).ready(function(){ $('.accordion').accordion({ event: mouseover }); }); /script link rel=stylesheet type=text/css href=ajaxexperience.css /head body ul class=accordion lia href=#2008/a ul class=accordion lia href=#August/a/li lia href=#July/a/li lia href=#June/a/li lia href=#May/a/li /ul /li lia href=#2007/a ul class=accordion lia href=#December/a/li lia href=#October/a/li lia href=#June/a/li lia href=#April/a/li lia href=#February/a/li lia href=#January/a/li /ul /li /ul hr / pWorks like that for me. Make sure to put local script references specifically to the accordeon JS file./p hr / /body /html
[jQuery] Re: Accordion problem - closing issue
Of course, I assumed that you needed nested accordions - so that inner uls can be made into accordions as well.
[jQuery] Get Location Of A Div
Hey, What I'm trying to do is create a popup that appears below an icon when you mouseover the icon. To do this I need to get the location of the icon (div) and then I can position the popup accordingly from there. The issue that I'm running into is if I don't actually directly assign the icon an absolute position using CSS, then when I use css(top) and such, it just returns a value of auto rather than an actual numerical value (pixels). I need to somehow get the location (in pixels from top and left - eg. left: 500px; top: 50px;) of the icon on the screen. The reason for this being that I can't really add/ subtract pixels to position the popup properly because it isn't giving me a numerical value to work with. So, is there any way to do this? For anyone who's wondering, my code currently looks something like this: var pixelsFromTop = $(#icon).css(top); // Value is auto Any help is greatly appreciated! P.S. jQuery rocks - I absolutely love it! Oh, and in case anyone was going to suggest a tooltip plugin: yes, I have heard of the various ones for jQuery and have tried a wide variety of them yet none can seem to accomplish what I'm looking for, so I figured I'd work some of my own magic, or attempt to anyway :)
[jQuery] Re: Get Location Of A Div
Nevermind, I've figured it out now. Turns out I just wasn't using the right search term for the jQuery Documentation. For anyone who is wondering, I ended up using the position() function. Thanks again.