Re: [jQuery] jQuery AUTOCOMPLETE (by bassistance): submit on click
I'd imagine you'd want something like this? $('input#query').autocomplete('yoururl',{ . your options . }).result(function(event, item, formatted) { $(this).parents().find('form:first').submit(); }); I hope this helps RobL jjunior wrote: I'm having a problem with the plugin. Right now, when a user clicks on a list of suggestions from the autocomplete, it takes that selection and puts in the input. The user then has to click again or hit enter to submit the form. It seems that most search forms work on a single click system: click on the desired entry in the list and the desired search is executed. Can anyone offer some assistance? Thanks!
[jQuery] jquery.autocomplete, setting additional params based on dom element
Hi there, I'm having an awful lot of bother trying to get this working. I want to implement auto completion for a text field as follows Currently our application returns a json string which we eval to extract the results and once the item is selected it fills in the hidden field value with the id as well as the user_name content of the text field. While the code we have works I need to make it more generic so I can reuse this for lots of form fields on the same page, with different ids / names and select not only the correct data to be returned but populate the parsed array with the correct data based on the dom element's id. First up I really just want to be able to set extraParams in order to get the right data, something like... extraParams: { type: function() { $(this).id.split('_')[0] } method: function() { $(this).id.split('_')[1] } } I appreciate that this doesn't work because $(this) is the autocomplete object and not the dom element. I can see that $input/input is used internally to reference the dom element but I can't seem to hook into it inside the overriding methods I am using. Can anyone give me any pointers? current code --- $('input.autocomplete').autocomplete('/autocomplete',{ minChars: 3, parse: function(data) { parsed = []; var data = eval(data); for (var i = 0; i < data.length; i++) { console.log(data[i].full_name); parsed[parsed.length] = { data: data[i], value: data[i].full_name, result: data[i].full_name }; } return parsed; }, formatItem: function(item) { return item.full_name; }, extraParams: { type: function() { return $(this).id.split('_')[0] }, method: function() { return $(this).id.split('_')[1] } }).result(function(event, item, formatted) { $(this).attr('value', item.full_name); $('#' + $(this).attr('rel')).attr('value', item.id); }); Any help on this would be greatly appreciated, Cheers RobL
[jQuery] Superfish and Wordpress
I am having trouble getting my wordpress theme to use the Superfish in the nav menu. My problem is I have subcategories that go 3 tabs deep and currently it is very tough to navigate through the drop down menu so I wanted to get Superfish to work since I have used it with other non-Wordpress sites in the past. a link to the site I am working on is http://robgivans.com/hssportszone/ I have called these files. //link to the CSS files for this menu type // link to the JavaScript files (hoverIntent is optional) Then right above my Navbar I have called the script file for super fish, this is exactly how it is in my file. $(document).ready(function(){ $("ul.sf-menu").supersubs({ minWidth:12, // minimum width of sub-menus in em units maxWidth:27, // maximum width of sub-menus in em units extraWidth: 1 // extra width can ensure lines don't sometimes turn over // due to slight rounding differences and font-family }).superfish(); // call supersubs first, then superfish, so that subs are // not display:none when measuring. Call before initialising // containing tabs for same reason. }); Home I have changed the DIV Navbar to sf-menu but it makes no difference. If you have any idea what I could be doing wrong please let me know, I have been messing with this way too long, maybe I am missing something stupid. Thanks.
[jQuery] Re: Selectors and Internet Explorer
option tags are closed, i just didn't write them in here... @MorningZ: What I'm trying to do is update a second select box with options that are specific to options in the first box. Basically, a linked menus program. What was happening was all browser except IE were handling the event function just fine. IE wasn't recognizing any of the selectors *above*, except the #parentMenu (by itself). I basically got something to work, so now I'm just after information. Why does IE ignore JQuery notation for handling child (classes or elements)? You wrote " >option['parentMenu'] "... what is this notation called? On Dec 10, 2:12 pm, "Josh Nathanson" wrote: > Maybe try closing the option tag? > > > > -- Josh > > -Original Message- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of rob > Sent: Thursday, December 10, 2009 12:54 PM > To: jQuery (English) > Subject: [jQuery] Selectors and Internet Explorer > > I'm having some problem with selectors in Internet Explorer. I have > this demo setup that is basically a modified "linked menus" > application. When you select something from one menu, it updates the > contents in it's child menu. > > For some reason Internet Explorer will not read the correct selector. > > I have tested the following: I've tried each of these selectors with > and without "this". > $(".parentMenu").click(); > $("#parentMenu > .parentMenu").click(); > $("#parentMenu > option").click(); > > This was the only one I got to trigger anything. > $("#parentMenu").click(); > > The elements in question here are: > > > > > My question is: > > Why do all the other browsers recognize the content within the > except internet explorer. It seems like it won't call any of > the option elements, whether they're created by script or loaded fresh > from the server. > > Any ideas??
[jQuery] Selectors and Internet Explorer
I'm having some problem with selectors in Internet Explorer. I have this demo setup that is basically a modified "linked menus" application. When you select something from one menu, it updates the contents in it's child menu. For some reason Internet Explorer will not read the correct selector. I have tested the following: I've tried each of these selectors with and without "this". $(".parentMenu").click(); $("#parentMenu > .parentMenu").click(); $("#parentMenu > option").click(); This was the only one I got to trigger anything. $("#parentMenu").click(); The elements in question here are: My question is: Why do all the other browsers recognize the content within the except internet explorer. It seems like it won't call any of the option elements, whether they're created by script or loaded fresh from the server. Any ideas??
[jQuery] Re: Linked Menus Help
So everything seems to work now, except in Internet Explorer. I tested out the application in FF3, Safari4, Chrome3, and Opera10... They all work fine. It's just IE8 (both modes). It's almost like the event on the selector doesn't trigger. Same as earlier, but I'm using live(). I tried switching this to bind(), but same thing. Just for giggles, I even tried creating a $(selector).click() function and this didn't do anything either. Any ideas? On Dec 9, 10:51 am, "T.J. Simmons" wrote: > Haha, no problem. I've been having one of those weeks. Glad it works. > > -T.J. > > On Dec 9, 11:42 am, rob wrote: > > > Nevermind... I found the error... I'm having one of those mornings... > > Thanks for you help tho > > > On Dec 9, 10:30 am, rob wrote: > > > > I switched the .click event with .live(click), and it sort of works > > > now. The problem with the parentMenu not updating is now ok. When I > > > click the navigation links, the parentMenu now updates with new items > > > and is clickable. The problem now is still with the childMenu. I can > > > see in the .js file from the browser, that the HTML being written > > > during the click event is this: > > > > var modelHTML = " > > class='childMenu'>" +model+ ""; > > > > However, when I inspect the item with firebug, it's not showing the > > > class attribute for each of the items. This is probably why it's not > > > triggering the function. What would cause this from writing the class > > > attribute? > > > > On Dec 8, 6:21 pm, "T.J. Simmons" wrote: > > > > > This is somewhere in the jQuery documentation, but use .live("click", > > > > function(){ > > > > > instead of .click(function(){ > > > > > to delegate the function to all matched elements on the page and > > > > loaded in via AJAX or otherwise. > > > > > Hope that helps. > > > > > T.J. Simmons > > > > Sent from my iPhone > > > > > On Dec 8, 2009, at 5:28 PM, rob wrote: > > > > > > I built a little utility modeling a linked menus concept... Click an > > > > > item in the parent menu, and the child menu will update. > > > > > > When a parent option is selected the childMenu is reloaded with new > > > > > . Selecting these no longer triggers $("#childMenu > > > > > > option").click(function(){}); Does anyone have any idea why this may > > > > > be happening? > > > > > > Here's an example: > > > > > > $(".parentMenu").click(function(){ > > > > > var s = $("#parentMenu :selected").text(); > > > > > > $.ajax({ > > > > > type: 'GET', > > > > > url: 'xml/file.xml', > > > > > datatype: 'xml', > > > > > success: function(xml){ > > > > > > alert(s); //this is displaying correctly > > > > > > $('#childMenu').empty(); > > > > > > $(xml).find("series[name='"+s+"']).each(function(){ > > > > > $(this).find("model").each(function(){ > > > > > var model = $(this).text(); > > > > > var modelHTML = " > > > > value='"+model+"'>" +model+ ""; > > > > > $("#childMenu").append(modelHTML); > > > > > }); > > > > > }); > > > > > > }); > > > > > > alert(s) will show when the menu is the original content (whether it > > > > > is parentMenu or childMenu), but once that content is changed with > > > > > something else, it no longer works. > > > > > > Any help would be greatly appreciated.
[jQuery] Re: Linked Menus Help
Nevermind... I found the error... I'm having one of those mornings... Thanks for you help tho On Dec 9, 10:30 am, rob wrote: > I switched the .click event with .live(click), and it sort of works > now. The problem with the parentMenu not updating is now ok. When I > click the navigation links, the parentMenu now updates with new items > and is clickable. The problem now is still with the childMenu. I can > see in the .js file from the browser, that the HTML being written > during the click event is this: > > var modelHTML = " class='childMenu'>" +model+ ""; > > However, when I inspect the item with firebug, it's not showing the > class attribute for each of the items. This is probably why it's not > triggering the function. What would cause this from writing the class > attribute? > > On Dec 8, 6:21 pm, "T.J. Simmons" wrote: > > > This is somewhere in the jQuery documentation, but use .live("click", > > function(){ > > > instead of .click(function(){ > > > to delegate the function to all matched elements on the page and > > loaded in via AJAX or otherwise. > > > Hope that helps. > > > T.J. Simmons > > Sent from my iPhone > > > On Dec 8, 2009, at 5:28 PM, rob wrote: > > > > I built a little utility modeling a linked menus concept... Click an > > > item in the parent menu, and the child menu will update. > > > > When a parent option is selected the childMenu is reloaded with new > > > . Selecting these no longer triggers $("#childMenu > > > > option").click(function(){}); Does anyone have any idea why this may > > > be happening? > > > > Here's an example: > > > > $(".parentMenu").click(function(){ > > > var s = $("#parentMenu :selected").text(); > > > > $.ajax({ > > > type: 'GET', > > > url: 'xml/file.xml', > > > datatype: 'xml', > > > success: function(xml){ > > > > alert(s); //this is displaying correctly > > > > $('#childMenu').empty(); > > > > $(xml).find("series[name='"+s+"']).each(function(){ > > > $(this).find("model").each(function(){ > > > var model = $(this).text(); > > > var modelHTML = " > > value='"+model+"'>" +model+ ""; > > > $("#childMenu").append(modelHTML); > > > }); > > > }); > > > > }); > > > > alert(s) will show when the menu is the original content (whether it > > > is parentMenu or childMenu), but once that content is changed with > > > something else, it no longer works. > > > > Any help would be greatly appreciated.
[jQuery] Re: Linked Menus Help
I switched the .click event with .live(click), and it sort of works now. The problem with the parentMenu not updating is now ok. When I click the navigation links, the parentMenu now updates with new items and is clickable. The problem now is still with the childMenu. I can see in the .js file from the browser, that the HTML being written during the click event is this: var modelHTML = "" +model+ ""; However, when I inspect the item with firebug, it's not showing the class attribute for each of the items. This is probably why it's not triggering the function. What would cause this from writing the class attribute? On Dec 8, 6:21 pm, "T.J. Simmons" wrote: > This is somewhere in the jQuery documentation, but use .live("click", > function(){ > > instead of .click(function(){ > > to delegate the function to all matched elements on the page and > loaded in via AJAX or otherwise. > > Hope that helps. > > T.J. Simmons > Sent from my iPhone > > On Dec 8, 2009, at 5:28 PM, rob wrote: > > > I built a little utility modeling a linked menus concept... Click an > > item in the parent menu, and the child menu will update. > > > When a parent option is selected the childMenu is reloaded with new > > . Selecting these no longer triggers $("#childMenu > > > option").click(function(){}); Does anyone have any idea why this may > > be happening? > > > Here's an example: > > > $(".parentMenu").click(function(){ > > var s = $("#parentMenu :selected").text(); > > > $.ajax({ > > type: 'GET', > > url: 'xml/file.xml', > > datatype: 'xml', > > success: function(xml){ > > > alert(s); //this is displaying correctly > > > $('#childMenu').empty(); > > > $(xml).find("series[name='"+s+"']).each(function(){ > > $(this).find("model").each(function(){ > > var model = $(this).text(); > > var modelHTML = " > value='"+model+"'>" +model+ ""; > > $("#childMenu").append(modelHTML); > > }); > > }); > > > }); > > > alert(s) will show when the menu is the original content (whether it > > is parentMenu or childMenu), but once that content is changed with > > something else, it no longer works. > > > Any help would be greatly appreciated.
[jQuery] Linked Menus Help
I built a little utility modeling a linked menus concept... Click an item in the parent menu, and the child menu will update. When a parent option is selected the childMenu is reloaded with new . Selecting these no longer triggers $("#childMenu > option").click(function(){}); Does anyone have any idea why this may be happening? Here's an example: $(".parentMenu").click(function(){ var s = $("#parentMenu :selected").text(); $.ajax({ type: 'GET', url: 'xml/file.xml', datatype: 'xml', success: function(xml){ alert(s); //this is displaying correctly $('#childMenu').empty(); $(xml).find("series[name='"+s+"']).each(function(){ $(this).find("model").each(function(){ var model = $(this).text(); var modelHTML = "" +model+ ""; $("#childMenu").append(modelHTML); }); }); }); alert(s) will show when the menu is the original content (whether it is parentMenu or childMenu), but once that content is changed with something else, it no longer works. Any help would be greatly appreciated.
[jQuery] jquery.form.js and uploading only files
Hi there, I'm trying to use jquery.form.js to allow file uploads with my application. I'm trying to replace saving the whole form and uploading a image all at the same time by hijacking just the input[type=file] change event when you select a file and saving just the file using ajax and then the whole form can be submitted as usual without the image. Basically to always save the image first to avoid uploading it multiple times if the rest of the form data is found to be invalid. I can get this uploading the image working fine, but by submitting the entire form. I want to filter down the form data conserving only the file upload. Can anyone point me in the right direction on how to filter the uploaded data? Many thanks RobL
[jQuery] Image not loading
I have this set of code... $('#thumbnails').append(""); This creates thumbnails on my webpage. In internet Explorer, they show up fine, but in Firefox they do not. I checked the image properties (right click -> properties). In IE, it is listed as a JPEG, but in FF, it says text/html. I have a feeling the browser isn't getting the encoding type correct. It's somehow seeing it come across as a string, instead of an image. This encoding is in the header: I've had this problem occur in a number of places, and not just with JQuery language... (also with Google Maps API)... Can anyone explain why this happens? What is a possible solution? Thanks in advance
[jQuery] Re: return values
Awesome thanks... On Oct 23, 12:16 pm, James wrote: > $.each(data.feed.entry, function(i, entry){ > > var postlink = []; // empty array > > $.each(entry.link, function(j, link){ > if(link.rel == "self"){ > // add to array > postlink.push(link.href); > } > }); > > alert(postlink.join(', ')); > > }); > > On Oct 22, 8:02 pm, rob wrote: > > > I'm having some problem withreturnvalue for a function. I have read > > some postings about this, but I'm just not understanding something. > > Hopefully somebody can help me with this > > > I'm trying to access google blogger's API to display blog entries on > > my site. I'm doing this through JQuery and requesting a JSON > > response. Everything seems to work ok, but I want to access the link > > for the blog entry. This is a subset of the "entry" object. It's > > structured like this: > > > entry: > > title, > > content, > > link: > > rel, > > type, > > href, > > > rel, > > type, > > href, > > > I want to get the link where the "link.rel == "self". To do this I > > have to loop through the link object (5 times). The loop and > > conditional statement works correctly, but I can't get the variable > > inside this loop back to my original function. > > > I have this code: > > > $.each(data.feed.entry, function(i, entry){ > > > $.each(entry.link, function(j, link){ > > if(link.rel == "self"){ > > var postlink = link.href; > > alert("link : " + postlink); > > returnpostlink; > > } > > }); > > > alert(postlink); > > > }); > > > Thanks for your help in advance.
[jQuery] return values
I'm having some problem with return value for a function. I have read some postings about this, but I'm just not understanding something. Hopefully somebody can help me with this I'm trying to access google blogger's API to display blog entries on my site. I'm doing this through JQuery and requesting a JSON response. Everything seems to work ok, but I want to access the link for the blog entry. This is a subset of the "entry" object. It's structured like this: entry: title, content, link: rel, type, href, rel, type, href, I want to get the link where the "link.rel == "self". To do this I have to loop through the link object (5 times). The loop and conditional statement works correctly, but I can't get the variable inside this loop back to my original function. I have this code: $.each(data.feed.entry, function(i, entry){ $.each(entry.link, function(j, link){ if(link.rel == "self"){ var postlink = link.href; alert("link : " + postlink); return postlink; } }); alert(postlink); }); Thanks for your help in advance.
[jQuery] Re: JQuery, JFeed, Blogger
I'm not sure if this JFeed plugin is not being used much, or maybe I'm using it for the wrong thing. Here's a better way to pull the Blogger Content... http://code.google.com/apis/gdata/samples/blogger_sample.html On Oct 19, 2:59 pm, rob wrote: > Hello, > > I've been working on this for a while and I can't seem to figure this > out. I'm trying to use the jFeed plugin to access an RSS feed from > Blogger. I'm not trying to use any authentication, I just want to use > public read-only access. > > I tried some real simple examples at first (using jFeed Demo from > jQuery.com). When using the local XML file, everything works fine. > When I try to use a blogger address it doesn't work. > > I've tried using: > > http://blogName.blogspot.com/atom.xmlhttp://blogName.blogspot.com/feeds/posts/defaulthttp://www.blogger.com/feeds/blogID/posts/default > > None of these seem to work. Since a local XML file worked in the > demo, I decided to use my own local XML file. This worked fine, > however, when I copied it over to another web server, I was seeing the > same behavior. > > In all cases where there's an error, I see an Error 405 message. In > the function, it is requesting the file by 'GET' instead of 'POST', > but when I look in firebug, it says 'OPTION.' > > Any help would be appreciated.
[jQuery] JQuery, JFeed, Blogger
Hello, I've been working on this for a while and I can't seem to figure this out. I'm trying to use the jFeed plugin to access an RSS feed from Blogger. I'm not trying to use any authentication, I just want to use public read-only access. I tried some real simple examples at first (using jFeed Demo from jQuery.com). When using the local XML file, everything works fine. When I try to use a blogger address it doesn't work. I've tried using: http://blogName.blogspot.com/atom.xml http://blogName.blogspot.com/feeds/posts/default http://www.blogger.com/feeds/blogID/posts/default None of these seem to work. Since a local XML file worked in the demo, I decided to use my own local XML file. This worked fine, however, when I copied it over to another web server, I was seeing the same behavior. In all cases where there's an error, I see an Error 405 message. In the function, it is requesting the file by 'GET' instead of 'POST', but when I look in firebug, it says 'OPTION.' Any help would be appreciated.
[jQuery] Re: background position plugin
try taking the numbers out of the parentheses like this: .animate({ backgroundPosition: "0px 0px",},{duration:400}) On Oct 13, 2:45 pm, vicix wrote: > hi, > > i build a menu with a background position animation plugin by Jonathan > Snook’s. > The mouseover and mouseout are correct, but i dont't know to put when > click to stop animation and dont run a onmouseout action. > > the code: > > > > HTML > > > > Empresa > Pvc & Alu > Produtos > Eventos > Contactos > > > > JAVASCRIPT (jquery) > > $('#menu a.menu') > .css( {backgroundPosition: "0 40px"} ) > .mouseover(function(){ > $(this).stop().animate( > {backgroundPosition:"(0 0)"}, > {duration:300}) > }) > .mouseout(function(){ > $(this).stop().animate( > {backgroundPosition:"(0 40px)"}, > {duration:300}) > }) > > > > Can someone help me? > > thanks > > (Sorry my english)
[jQuery] Re: Selecting Form Element Labels
Thanks for the help... that should work just fine. I was just hoping there was some way to utilize those linked items with a single call. On Oct 1, 12:08 pm, James wrote: > I'm sure there are many ways to go about this. Here's one: > > var fieldName = 'FirstName'; > $("#"+fieldName).remove(); // removes input > $("label[for="+fieldName+"]").remove(); // removes label > > Assuming that your label will always have the same "for" as the ID of > the input. > > On Oct 1, 8:09 am, rob wrote: > > > I'm using a form in several places for this project. I don't want to > > duplicates of this form so I have it as an include file. Each page > > requires all the same fields, however, there is one page where I'd > > like to remove two fields. > > > > > First Name > > > > > > > Is there a way to remove an input field and it's label by selecting > > the ID of the input field? > > > I looked at the JQuery doc, and there's a prev + next selector which > > shows $('label + input').css ... this will set css properties for an > > input element that follows a label element. > > > something like $('#FirstName > label + input').remove...
[jQuery] Selecting Form Element Labels
I'm using a form in several places for this project. I don't want to duplicates of this form so I have it as an include file. Each page requires all the same fields, however, there is one page where I'd like to remove two fields. First Name Is there a way to remove an input field and it's label by selecting the ID of the input field? I looked at the JQuery doc, and there's a prev + next selector which shows $('label + input').css ... this will set css properties for an input element that follows a label element. something like $('#FirstName > label + input').remove...
[jQuery] Trouble with backgroundPosition Plugin
Having some trouble with this plugin. I've tried in both IE8 and FF3, but it doesn't seem to work. Basically the background position isn't moving... the function toArray(strg) is suppose to return the following return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]]; this is the line where I'm getting an error code. The values res[2] and res[4] are coming back as NaN. I'm not sure what these values represent, or why they are Null. I'm calling the backgroundPosition like this: $('#nav li') .css({backgroundPosition: "-150px 0px"}) .mouseover(function(){ $(this).stop().animate( {backgroundPosition: "300px 0px" }, {duration:200}) }); my css reads: #nav li { background:url(../gfx/btn_navbg.jpg) 0px 0px; float:right; min-width: 100px; max-width: 150px; margin:0; padding:0; text-align:center; } Any help would be much appreciated.
[jQuery] Re: selectors, events, and scripted elements not working
Looks like this will work. Thanks for your help. On Sep 15, 4:29 pm, Charlie Griefer wrote: > Have a look at live() > > http://docs.jquery.com/Events/live > > "Binds a handler to an event (like click) for all current - and future - > matched element." > > Basically, when you add elements to the DOM dynamically after page load, > jQuery won't recognize those elements unless the live() method is used. > > > > On Tue, Sep 15, 2009 at 4:20 PM, rob wrote: > > > Hello, > > > I am having some problems with selectors and events. I have a row of > > thumbnails all part of the "thumbnails" class. I'm trying to run some > > code when a thumbnail is clicked, but something weird is happening. > > > When i use this selector/event: > > " $(".thumbnails").click(function(){ // run some code }); > > > nothing happens. > > > I've tested this: > > " $("img").click(function(){ // run some code }); > > > And the code does run on what seems like all that are set in the > > HTML doc, but not the elements that are created from JQuery > > script. > > > Can anyone help to explain this? What am I doing wrong here? > > > For reference: > > > The jquery script creating elements is: > > > $(function(){ > > var image = new Image(); > > > $(img).attr('src', path) > > $(img).attr('class', "thumbnails"); > > > $('#thumbnailwrapper').append(img); > > -- > I have failed as much as I have succeeded. But I love my life. I love my > wife. And I wish you my kind of success.
[jQuery] Re: selectors, events, and scripted elements not working
Looks like this will work. Thanks for your help. On Sep 15, 4:29 pm, Charlie Griefer wrote: > Have a look at live() > > http://docs.jquery.com/Events/live > > "Binds a handler to an event (like click) for all current - and future - > matched element." > > Basically, when you add elements to the DOM dynamically after page load, > jQuery won't recognize those elements unless the live() method is used. > > > > On Tue, Sep 15, 2009 at 4:20 PM, rob wrote: > > > Hello, > > > I am having some problems with selectors and events. I have a row of > > thumbnails all part of the "thumbnails" class. I'm trying to run some > > code when a thumbnail is clicked, but something weird is happening. > > > When i use this selector/event: > > " $(".thumbnails").click(function(){ // run some code }); > > > nothing happens. > > > I've tested this: > > " $("img").click(function(){ // run some code }); > > > And the code does run on what seems like all that are set in the > > HTML doc, but not the elements that are created from JQuery > > script. > > > Can anyone help to explain this? What am I doing wrong here? > > > For reference: > > > The jquery script creating elements is: > > > $(function(){ > > var image = new Image(); > > > $(img).attr('src', path) > > $(img).attr('class', "thumbnails"); > > > $('#thumbnailwrapper').append(img); > > -- > I have failed as much as I have succeeded. But I love my life. I love my > wife. And I wish you my kind of success.
[jQuery] selectors, events, and scripted elements not working
Hello, I am having some problems with selectors and events. I have a row of thumbnails all part of the "thumbnails" class. I'm trying to run some code when a thumbnail is clicked, but something weird is happening. When i use this selector/event: " $(".thumbnails").click(function(){ // run some code }); nothing happens. I've tested this: " $("img").click(function(){ // run some code }); And the code does run on what seems like all that are set in the HTML doc, but not the elements that are created from JQuery script. Can anyone help to explain this? What am I doing wrong here? For reference: The jquery script creating elements is: $(function(){ var image = new Image(); $(img).attr('src', path) $(img).attr('class', "thumbnails"); $('#thumbnailwrapper').append(img);
[jQuery] Cluetip - Tooltip positioning issue within an iFrame in a UI dialog box
I began using Cluetip (which is a wonderful plug-in - thank you) on a project I'm working on, but encountered positioning issues for tooltips associated with elements housed within an iFrame in a UI dialog box. On parent pages, tooltips appear as expected outside the associated element (e.g., hyperlink, input, button, div). Within an iFrame, which is in a UI dialog box, tooltips appear wherever the cursor hovers over the element. This behaviour can obstruct the view and subsequently result in display issues (e.g., "flashing tooltip"). Has anyone else encountered this issue? If so, is there a workaround? Many thanks, Rob
[jQuery] Re: Set value in Parent
Found my own anser from earlier post. This worked: $(function() { $("#dollar1").bind("click",function() { $("#EndUser",top.document).val( $("#setEndUser").val() ); }); }); On Thu, Jun 11, 2009 at 9:36 AM, robert...@gmail.com wrote: > Hello, > > I have a page in an Iframe and when the user clicks a image (href), I > want a value to be set in the parent page. I don't know why this is > not working...please assist. > > In the iframe page , dollar1 is the id of the Imagebutton, then I have > a hidden variable id= setEndUser. On the parent page I have a textbox > id = Enduser. > > $(function() { > $("#dollar1").bind("click",function() { > $("#EndUserT").parent().val( $("#setEndUser").val() ); > }); > }); > > -- Thanks, Robert Bruce
[jQuery] select range of code and wrap, multiple times
Hi folks, I hope you can help me out, I have a bit of html that looks something like: div --h1 --h2 --p --p --h2 --ul --h2 --p And am trying to figure out a way to grab from that code each h2 and its siblings, up-to-but-stopping-at the next h2, for example, I want to grab from the simplified tree above: h2,p,p; then h2,ul; then 2,p and wrap each group in a div so that the final result looks like div --h1 --div h2 p p --div h2 ul --div h2 p I hope what I need is clear and that you fine folks can help me out!
[jQuery] Re: jQuery click actions not functioning in redrawn HTML
BTW, don't mind the double pound signs, those get escaped by Coldfusion when the page is loaded.
[jQuery] jQuery UI Autocomplete - Removing items / detecting all values from multiselect
Hello, Is there a way to always know what values are selected inside of a jquery ui autocomplete widget? I know there is a "result" event that fires when you select a value, but what about when you remove a value? Thanks, Rob
[jQuery] addClass and removeClass
Hi there, I'm getting an interesting problem with addClass and removeClass. I'm attempting to build a rating system using radio buttons to select the rating. I'm actually hiding my radio buttons and styling the label to have pretty stars instead for a nicer interface. I want to highlight the star when the radio button is selected, so when the label is clicked by adding the 'active' class. I also need to remove the 'active' class from all other labels so that only one is selected at any one time. I assumed that removing the class from all of them and then re-adding for the one I am clicking would be the most efficient way for doing this like so. jQuery(document).ready(function () { jQuery('label.star').click(function (event) { jQuery('label.star').removeClass('active'); jQuery(event.target).addClass('active'); }); }); However this now has no effect, the class is simply not added at all now. Anyone got any ideas why this doesn't work? Cheers RobL http://www.robl.me
[jQuery] Re: Problem getting selected value from drop-down
I should have expounded more on the rest of it, but I had to run to a meeting. My apologies. :( On Mar 31, 11:21 am, LinkGuru wrote: > Apologies to Rob (I had only tried his 'add the id attribute to > the select tag' suggestion), I now find that if I write p_viewSelector= > $("select[name='dllViewSelector'] option:selected").text(); it works > fine. Thanks Rob (and also Ricardo). > > On Mar 31, 3:53 pm, Ricardo wrote: > > > The val() method returns the selected option for the element: > > > $('[name=dllViewSelector]').val() > > > 'selectedIndex' is a property of the node. When you call $ > > ('#dllViewSelector') (ignoring the fact that this selector is wrong) > > you get a jQuery object with a reference to the element, not the > > element itself. You can access it like in an array: > > $("#dllViewSelector")[0].selectedIndex; > > > On Mar 31, 7:51 am, LinkGuru wrote: > > > > Hi, Can anyone help with the following? With JQuery, I can't > > > successfully grab the selected value from a drop-down. The alert just > > > shows an empty message. At least it is not showing undefined (as it > > > was for my other attempts - you can see what these were from the > > > commented out code), but I would expect it to display one of the > > > values One-way, Reciprocal or Other. Perhaps I have to do some > > > conversion on the result. Your contributions to this post will be > > > greatly appreciated. > > > > In my HTML I have: > > > > > > onchange="showSelectedView(this, allViews, > > > allSections,4,10)"> > > > > One- > > > way > > > Reciprocal > > > Other > > > > > > . > > > . > > > . > > > > > name="btnOk_AddToProject_0" class="button-click-grey" value="Add to > > > Project" /> > > > . > > > . > > > . > > > And in my JQuery I have > > > > $(".actionOptAdd").bind("click", > > > function() > > > { > > > p_viewSelector=$("#dllViewSelector > > > option:selected").text(); > > > alert(p_viewSelector); > > > // Also get blank message for: > > > // p_viewSelector=$("#dllViewSelector > > > option:selected",this).text > > > (); > > > // (Also tried - getting undefined as a result) > > > // > > > p_viewSelector=$("#dllViewSelector").selectedIndex; > > > // > > > p_viewSelector=$("#dllViewSelector").attr("selectedIndex");
[jQuery] Re: Problem getting selected value from drop-down
One thing I see wrong there: You are referencing dllViewSelector as an id in your jQuery, but you only have that as a name in your html. either add the id attribute to the select tag, or reference it as $("select[name='dllViewSelector'] option:selected") in your jQuery. On Mar 31, 6:51 am, LinkGuru wrote: > Hi, Can anyone help with the following? With JQuery, I can't > successfully grab the selected value from a drop-down. The alert just > shows an empty message. At least it is not showing undefined (as it > was for my other attempts - you can see what these were from the > commented out code), but I would expect it to display one of the > values One-way, Reciprocal or Other. Perhaps I have to do some > conversion on the result. Your contributions to this post will be > greatly appreciated. > > In my HTML I have: > > onchange="showSelectedView(this, allViews, > allSections,4,10)"> > > One- > way > Reciprocal > Other > > . > . > . > name="btnOk_AddToProject_0" class="button-click-grey" value="Add to > Project" /> > . > . > . > And in my JQuery I have > > $(".actionOptAdd").bind("click", > function() > { > p_viewSelector=$("#dllViewSelector > option:selected").text(); > alert(p_viewSelector); > // Also get blank message for: > // p_viewSelector=$("#dllViewSelector > option:selected",this).text > (); > // (Also tried - getting undefined as a result) > // > p_viewSelector=$("#dllViewSelector").selectedIndex; > // > p_viewSelector=$("#dllViewSelector").attr("selectedIndex");
[jQuery] Intercepting AJAX responses globally
Hi all, I'm trying to write a global AJAX response handler which hooks in *before* the client code receives requested data. The response data from the server might be in JSON or HTML format depending on where the request has come from. I'm trying to build in some client-side handling in case the user's login session ends between page load and asynchronous request. The server-side is easy - if the request wants JSON just return "{login_required: true}", if HTML then something like "" should work for the equivalent. I have 2 issues here: 1. The global AJAX event "ajaxSuccess" is being generated after the local AJAX event "success". This means that I can't just prevent the "success" handler from running and call the "error" one instead. 2. Even if I can intercept the events / response in a generic handler before it is passed to the request-specific handler, I won't know whether I've got HTML or JSON data. The other option I can think of is in each response-handler function, call e.g. 'checkResponse(data, type)' function which does the necessary checking and returns true/false for ok/not-ok. That seems risky though as anyone adding a feature which uses async. requests might forget to use the check function. Obviously I can't defend against all eventualities but this idea is a bit lacking in 'defensive programming'. I know this is a little vague...has anyone implemented this sort of thing before? Cna anyone point me in the right direction for how to implement this? I feel like I'm approaching it wrong... TIA --rob
[jQuery] Re: Problems with
IE allows users to type in the value in a file field, it's Firefox that prevents that. Also I think the syntax there may be wrong. I would use the name of the file field and change it's value attribute to blank. HTML: jQuery (using 1.3.x) $("#button").click(function(){ $("input[name='fileName']").attr("value",""); }); You can change the attributes of any other kind of input field that way, I can't image a file field is any different. On Mar 6, 8:29 am, Martijn Houtman wrote: > On Mar 6, 2:24 pm, Renato Bezerra wrote: > > > $('#button').click(funtion(){ > > $('#fileName').val(''); > > > }); > > > In the Firefox it works, but in the IE7 don't works. > > I believe this is a security issue, where the browser does not allow > you to set the value for a file input, because some malicious script > might send a different file than you selected by setting the value of > the input.
[jQuery] Re: Why does $.width return innerWidth but set outerWidth?
Filed on trac too: http://dev.jquery.com/ticket/4146 --rob On Feb 13, 5:04 pm, "[rob desbois]" wrote: > Hi Brandon, > > Give this a whirl:http://pastebin.com/d20276791 > Shows the described behaviour in Firefox 3.0.6 > > o_0 > > --rob > > On Feb 13, 2:34 pm, Brandon Aaron wrote: > > > This isn't the normal behavior. Could you create a test case for this? > > > -- > > Brandon Aaron > > > On Fri, Feb 13, 2009 at 5:07 AM, [rob desbois] wrote: > > > > Hi all, > > > > I was just writing a bit of JS to set the width of some buttons to the > > > width of the largest. > > > While doing this I found that the largest one would shrink! > > > > Doing this in a debugger gives: > > > $("#x").width(); // 222 > > > $("#x").width(222); // makes element shrink > > > $("#x").width(); // 216 > > > > The number returned from $.width() is equal to the innerWidth() (at > > > least it is on my button, which has a border but no padding). > > > When you set it though, if you set it to the value returned, it will > > > shrink! It won't do this if you pass the return from $.outerWidth(). > > > > This seems backwards; I would never expect that passing the return of > > > a getter to its corresponding setter to change the return from the > > > getter! > > > > Can someone tell me if this is a bug or is by design - and if by > > > design, why? > > > TIA, > > > --rob
[jQuery] Re: Why does $.width return innerWidth but set outerWidth?
Hi Brandon, Give this a whirl: http://pastebin.com/d20276791 Shows the described behaviour in Firefox 3.0.6 o_0 --rob On Feb 13, 2:34 pm, Brandon Aaron wrote: > This isn't the normal behavior. Could you create a test case for this? > > -- > Brandon Aaron > > On Fri, Feb 13, 2009 at 5:07 AM, [rob desbois] wrote: > > > > > Hi all, > > > I was just writing a bit of JS to set the width of some buttons to the > > width of the largest. > > While doing this I found that the largest one would shrink! > > > Doing this in a debugger gives: > > $("#x").width(); // 222 > > $("#x").width(222); // makes element shrink > > $("#x").width(); // 216 > > > The number returned from $.width() is equal to the innerWidth() (at > > least it is on my button, which has a border but no padding). > > When you set it though, if you set it to the value returned, it will > > shrink! It won't do this if you pass the return from $.outerWidth(). > > > This seems backwards; I would never expect that passing the return of > > a getter to its corresponding setter to change the return from the > > getter! > > > Can someone tell me if this is a bug or is by design - and if by > > design, why? > > TIA, > > --rob
[jQuery] Why does $.width return innerWidth but set outerWidth?
Hi all, I was just writing a bit of JS to set the width of some buttons to the width of the largest. While doing this I found that the largest one would shrink! Doing this in a debugger gives: $("#x").width(); // 222 $("#x").width(222); // makes element shrink $("#x").width(); // 216 The number returned from $.width() is equal to the innerWidth() (at least it is on my button, which has a border but no padding). When you set it though, if you set it to the value returned, it will shrink! It won't do this if you pass the return from $.outerWidth(). This seems backwards; I would never expect that passing the return of a getter to its corresponding setter to change the return from the getter! Can someone tell me if this is a bug or is by design - and if by design, why? TIA, --rob
[jQuery] Re: [validate] Attaching events to dynamically added fields
Thanks! On Jan 9, 2:18 am, "Jörn Zaefferer" wrote: > The new element has the same name as the existing one, while the validation > plugin requires unique names. You'd have to add an index to each name to get > this to work, eg. item_title[0], item_title[1] etc. > > For another example on generating > those:http://jquery.bassistance.de/validate/demo/dynamic-totals.html > > Jörn > > On Fri, Jan 9, 2009 at 12:34 AM, Rob wrote: > > > Hi Jörn, > > > I have been plugging away at this for a while now, with no luck. I > > set up a test page, and stripped it down to be as basic as possible > > (it's much more basic than even the demos). It is located here: > >http://cymantix.net/validation > > > When you add new items, they don't appear to be validated along with > > the other fields. Could I trouble you to take a quick peek at my test > > page? > > > Thanks, > > > Rob > > > On Jan 6, 2:34 am, "Jörn Zaefferer" > > wrote: > > > The validation plugin binds various events to the form, handling > > everything > > > that bubbles up from its form elements. So you don't have to add any > > event > > > binding after adding new elements, just make sure the validation rules > > are > > > present. If it isn't working, its probably a different issue. > > > > Jörn > > > > On Mon, Jan 5, 2009 at 11:26 PM, Rob wrote: > > > > > Thanks Brian, > > > > > At the moment I'm using basically the simplest implementation of the > > > > plugin. I'm using inline rules, so I don't have to worry about the > > > > brackets yet. I do understand the event delegation, I had thought > > > > that calling $("#form").validate() again after inserting the elements > > > > would do the trick, but no such luck. > > > > > Rob > > > > > On Jan 5, 1:12 pm, brian wrote: > > > > > On Mon, Jan 5, 2009 at 2:40 PM, Rob > > wrote: > > > > > > > Hi Jörn or anyone else familiar with this plugin, > > > > > > > First off, thanks for the great validation plugin. I hope I do not > > > > > > impose too much with this question. > > > > > > > I have a dynamic form with fields named using brackets ([]). > > > > > > See this note: > > > >http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl. > > .. > > > > > > > Validation is working for fields that existed on the initial page > > > > > > load, but when I add append the code for a new field, the > > validation > > > > > > events are, of course, not attached to the new DOM elements. > > What's > > > > > > the best way to accomplish this? > > > > > > Make sure you understand event delegation. There's some info in the > > > > > docs. Basically, you need to ensure that any newly-created elements > > > > > are bound to event handlers. You can either bind them when they are > > > > > added or bind the container and findthe specific element in your > > event > > > > > handler by getting event.target. > > > > > > Though, I've no idea how to do this with the Validation plugin, > > > > specifically.
[jQuery] Re: [validate] Attaching events to dynamically added fields
Hi Jörn, I have been plugging away at this for a while now, with no luck. I set up a test page, and stripped it down to be as basic as possible (it's much more basic than even the demos). It is located here: http://cymantix.net/validation When you add new items, they don't appear to be validated along with the other fields. Could I trouble you to take a quick peek at my test page? Thanks, Rob On Jan 6, 2:34 am, "Jörn Zaefferer" wrote: > The validation plugin binds various events to the form, handling everything > that bubbles up from its form elements. So you don't have to add any event > binding after adding new elements, just make sure the validation rules are > present. If it isn't working, its probably a different issue. > > Jörn > > On Mon, Jan 5, 2009 at 11:26 PM, Rob wrote: > > > Thanks Brian, > > > At the moment I'm using basically the simplest implementation of the > > plugin. I'm using inline rules, so I don't have to worry about the > > brackets yet. I do understand the event delegation, I had thought > > that calling $("#form").validate() again after inserting the elements > > would do the trick, but no such luck. > > > Rob > > > On Jan 5, 1:12 pm, brian wrote: > > > On Mon, Jan 5, 2009 at 2:40 PM, Rob wrote: > > > > > Hi Jörn or anyone else familiar with this plugin, > > > > > First off, thanks for the great validation plugin. I hope I do not > > > > impose too much with this question. > > > > > I have a dynamic form with fields named using brackets ([]). > > > > See this note: > >http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl... > > > > > Validation is working for fields that existed on the initial page > > > > load, but when I add append the code for a new field, the validation > > > > events are, of course, not attached to the new DOM elements. What's > > > > the best way to accomplish this? > > > > Make sure you understand event delegation. There's some info in the > > > docs. Basically, you need to ensure that any newly-created elements > > > are bound to event handlers. You can either bind them when they are > > > added or bind the container and findthe specific element in your event > > > handler by getting event.target. > > > > Though, I've no idea how to do this with the Validation plugin, > > specifically.
[jQuery] Re: [validate] Attaching events to dynamically added fields
Ok, the rules are inline, thank you very much for the response, I will take a second look at it to see if I can figure out what's going on. On Jan 6, 2:34 am, "Jörn Zaefferer" wrote: > The validation plugin binds various events to the form, handling everything > that bubbles up from its form elements. So you don't have to add any event > binding after adding new elements, just make sure the validation rules are > present. If it isn't working, its probably a different issue. > > Jörn > > On Mon, Jan 5, 2009 at 11:26 PM, Rob wrote: > > > Thanks Brian, > > > At the moment I'm using basically the simplest implementation of the > > plugin. I'm using inline rules, so I don't have to worry about the > > brackets yet. I do understand the event delegation, I had thought > > that calling $("#form").validate() again after inserting the elements > > would do the trick, but no such luck. > > > Rob > > > On Jan 5, 1:12 pm, brian wrote: > > > On Mon, Jan 5, 2009 at 2:40 PM, Rob wrote: > > > > > Hi Jörn or anyone else familiar with this plugin, > > > > > First off, thanks for the great validation plugin. I hope I do not > > > > impose too much with this question. > > > > > I have a dynamic form with fields named using brackets ([]). > > > > See this note: > >http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl... > > > > > Validation is working for fields that existed on the initial page > > > > load, but when I add append the code for a new field, the validation > > > > events are, of course, not attached to the new DOM elements. What's > > > > the best way to accomplish this? > > > > Make sure you understand event delegation. There's some info in the > > > docs. Basically, you need to ensure that any newly-created elements > > > are bound to event handlers. You can either bind them when they are > > > added or bind the container and findthe specific element in your event > > > handler by getting event.target. > > > > Though, I've no idea how to do this with the Validation plugin, > > specifically.
[jQuery] Re: [validate] Attaching events to dynamically added fields
Thanks Brian, At the moment I'm using basically the simplest implementation of the plugin. I'm using inline rules, so I don't have to worry about the brackets yet. I do understand the event delegation, I had thought that calling $("#form").validate() again after inserting the elements would do the trick, but no such luck. Rob On Jan 5, 1:12 pm, brian wrote: > On Mon, Jan 5, 2009 at 2:40 PM, Rob wrote: > > > Hi Jörn or anyone else familiar with this plugin, > > > First off, thanks for the great validation plugin. I hope I do not > > impose too much with this question. > > > I have a dynamic form with fields named using brackets ([]). > > See this > note:http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl... > > > Validation is working for fields that existed on the initial page > > load, but when I add append the code for a new field, the validation > > events are, of course, not attached to the new DOM elements. What's > > the best way to accomplish this? > > Make sure you understand event delegation. There's some info in the > docs. Basically, you need to ensure that any newly-created elements > are bound to event handlers. You can either bind them when they are > added or bind the container and findthe specific element in your event > handler by getting event.target. > > Though, I've no idea how to do this with the Validation plugin, specifically.
[jQuery] [validate] Attaching events to dynamically added fields
Hi Jörn or anyone else familiar with this plugin, First off, thanks for the great validation plugin. I hope I do not impose too much with this question. I have a dynamic form with fields named using brackets ([]). Validation is working for fields that existed on the initial page load, but when I add append the code for a new field, the validation events are, of course, not attached to the new DOM elements. What's the best way to accomplish this? Rob
[jQuery] [validate] Attaching events to dynamically added fields
Hi Jörn or anyone else familiar with this plugin, First off, thanks for the great validation plugin. I hope I do not impose too much with this question. I have a dynamic form with fields named using brackets ([]). Validation is working for fields that existed on the initial page load, but when I add append the code for a new field, the validation events are, of course, not attached to the new DOM elements. What's the best way to accomplish this? Rob
[jQuery] Re: HowTo: Trigger error callback in ajax request
On Dec 17, 9:57 am, MorningZ wrote: > "Is it a non-200 status code" > > I can't say it's 100% of the time, but in my code it seems to be the > case Ding, ding, ding. Looks like that's it. In my PHP script, this is what I did to test... try { throw new Exception ( 'Something I made up' ); } catch ( Exception $e ) { header ( 'HTTP/1.0 500 Internal Server Error', true, '500' ); echo $e->getMessage(); } My error callback picks it up nicely and reports the message in XMLHttpRequest.responseText. Thanks again.
[jQuery] HowTo: Trigger error callback in ajax request
I have an ajax request being sent to a PHP script. If that script captures an error, I'd like it to echo that error and return whatever it needs to return to trigger the error callback in my ajax call. I can't seem to find what that is. Is it a non-200 status code? Simply throwing an error (throw new Exception()) just triggers the success callback with the error text (not unexpectedly, of course). I'm using the jQuery form plugin and using the .ajaxSubmit() method, but I suspect the answer would be the same for a core .ajax() call. My simplified case looks like this: $(document).ready ( function() { $( '#CommercialVendorAddForm' ).submit ( function() { $(this).block(); $(this).ajaxSubmit ({ beforeSubmit: function() { alert ( 'validating' ); }, success: function ( responseText, responseCode ) { alert ( 'success' ); alert ( responseText ); }, error: function() { alert ( 'An error has occured. Your application could not be submitted.' ); }, complete: function() { $( '#CommercialVendorAddForm' ).unblock(); } }); return false; } ); }); I can't believe that there's not a way to force the error callback to receive the response if the server page returns an error, but what is that way? Thanks. Rob
[jQuery] Re: Access Elements Rendered in a Thickbox
On Dec 16, 3:33 pm, Ricardo Tomasi wrote: > Your thickbox script most certainly provides a callback function where > you could add those handlers, which one are you using? Hey Ricardo - I'm using http://jquery.com/demo/thickbox/. I'll dig a little deeper. I was hoping someone already knew the answer and could spare me hours. :-) Thanks.
[jQuery] Access Elements Rendered in a Thickbox
Hey all - I'm looking for/wondering whether there is a way to access an element loaded in a thickbox. I have a page that launches thickbox to load a form. I need to be able to set a click() event listener on the submit button of that form so that I can submit the form via ajax. Unfortunately, I can't come up with a clever way of doing that. Any ideas? I tried (just for the sake of eliminating the obvious) applying the event listener on document ready, but no luck, of course, since I assume that the form's submit button doesn't exist until the thickbox is loaded. Is there any way to make this happen? Thanks.
[jQuery] Day and Month Picker
Hello; I am new here, sorry if this may have been covered before but my searching on the group did not return anything useful. I need to be able to allow entry of just the month and day of a date, no year. I am aware of DatePicker but it doesn't seem to allow this. Is there a way, using jQuery or a plugin, to accomplish this? Right now I have two drop down lists, one for Month and the other for Day but no validation is implemented for an invalid number of days in a month if the user chooses Sept, they can choose 31 as the day. I am looking for the recommended best approach for this. Thank you, Rob Bazinet
[jQuery] Re: Accordian menu + FadeIn - some weirdness...can someone help me?
how about if you click the item that is open and you click that item again...how would you make it close? And does the contents of the menu have to be wrapped in tags? Rob On Sun, Oct 5, 2008 at 5:34 PM, Alex <[EMAIL PROTECTED]> wrote: > > i have managed to pull this off pretty well, with no apparent > glitch's > > http://www.renderrobot.com/?p=33 > > as explained to make it load closed just remove the "open" class from > the html, should do the trick > > > On Sep 12, 8:34 pm, "Rob Fletcher" <[EMAIL PROTECTED]> wrote: > > Noone knows how to stabilize the animation and make this run better? > > > > On Fri, Sep 12, 2008 at 11:42 AM, RFletcher <[EMAIL PROTECTED] > >wrote: > > > > > I am making an accordian menu with 4 main buttons. All buttons should > > > be closed at start. When you click 1 button the content area should > > > slide down and then the content should fade-in. I have for the most > > > part written the script to create this effect however i see some > > > glitches with it. When you click the next tab i can see the two > > > buttons at the bottom moving up and down slightly. Its not a huge > > > deal, but i would rather them not move at all. I only want the button > > > i click to move. > > > > > Here is my script, please let me know if there is a better way to > > > write this as many google searches didn't reveal anything good. I'm > > > sure someone else has wanted to make an accordian menu (slide and then > > > fade-in) effect. > > > > > $(document).ready(function() { > > > $("dd").hide(); > > > $("span").hide(); > > > > > $("dt a").click(function () { > > > > > $("span").fadeOut(100); > > > > >$("dd:visible").slideUp("slow"); > > > > >$(this).parent().next().slideDown("slow", function () { > > >$("span").fadeIn("slow"); > > >}); > > >return false; > > >}); > > > }); > > > > > And my HTML code looks like this: > > > > > > > > > > > > > > > > > > > > > > >Loreum Ipsum > > >Futurum veniam est claritatem lorem lorem. Sequitur legunt > > > consequat qui Investigationes Investigationes. Ut quam me gothica > > > dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui > > > et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit. > > > facilisis et nis4 > > > > >Loreum Ipsum > > >Zzril legere quam lectorum parum hendrerit. Iriure exerci > option > > > euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum. > > > Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip > > > hendrerit et ut eodem. Dynamicus claritatem placerat. facilisis et > > > nis4 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >Loreum Ipsum > > >Futurum veniam est claritatem lorem lorem. Sequitur legunt > > > consequat qui Investigationes Investigationes. Ut quam me gothica > > > dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui > > > et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit. > > > facilisis et nis4 > > > > >Loreum Ipsum > > >Zzril legere quam lectorum parum hendrerit. Iriure exerci > option > > > euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum. > > > Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip > > > hendrerit et ut eodem. Dynamicus claritatem placerat. facilisis et > > > nis4 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >Loreum Ipsum > > >Futurum veniam est claritatem lorem lorem. Sequitur legunt > > > consequat qui Investigationes Investigationes. Ut quam me gothica > > > dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui > > > et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit. > > > facilisis et nis4 > > > > >Lore
[jQuery] flv page turner
Hi, Hopefully this is not too OT. I have a page turner web app that should play a new audio FLV for each new view in Thickbox. It works for me on OS X with FF, Safari and Opera. It does not work for (2) folks on Windows -- with FF the pages turn, but no audio. On Windows IE, the pages don't turn and no audio. Here is the site (CSS is a little messed up from the move to thickbox from a separate browser window): (you would need to click on Al Roker -- the only one with audio currently -- and yes, I know the voice is Giordi LaForge's, if you hear it) http://pearsonf.ipower.com/celeb-readings/ did you hear it on a windows box? Custom JS here (using jQuery and thickbox): http://pearsonf.ipower.com/celeb-readings/js/readings.js The page in Thickbox uses inline content and only an image is changed (a page from a book) for each new page view. There is also an object element outside of the thickbox inline content like so: blah For the audio, I thought the easiest thing to do is reset the FlashVars, clone the object element and reinsert it. For some reason this does not work on the PC. Here is the code from the js file referenced above: var playAudio = function(filename) { var fvBuf = []; fvBuf.push("MM_ComponentVersion=1&skinName=Clear_Skin_3&streamName="); // SOUND_DIR= "media/sound/"; fvBuf.push(SOUND_DIR); // READER_ID = "roker"; fvBuf.push(READER_ID); fvBuf.push("/"); fvBuf.push(filename); fvBuf.push("&autoPlay=true&autoRewind=true"); $("#flashvars-data").attr("value", fvBuf.join("")); var player = $("#playerContainer").clone(true); //console.log("player: ", player.html()); $("#playerContainer").html(player.html()); } Any ideas? thanks, -Rob
[jQuery] Re: Accordian menu + FadeIn - some weirdness...can someone help me?
Noone knows how to stabilize the animation and make this run better? On Fri, Sep 12, 2008 at 11:42 AM, RFletcher <[EMAIL PROTECTED]>wrote: > I am making an accordian menu with 4 main buttons. All buttons should > be closed at start. When you click 1 button the content area should > slide down and then the content should fade-in. I have for the most > part written the script to create this effect however i see some > glitches with it. When you click the next tab i can see the two > buttons at the bottom moving up and down slightly. Its not a huge > deal, but i would rather them not move at all. I only want the button > i click to move. > > Here is my script, please let me know if there is a better way to > write this as many google searches didn't reveal anything good. I'm > sure someone else has wanted to make an accordian menu (slide and then > fade-in) effect. > > $(document).ready(function() { > $("dd").hide(); > $("span").hide(); > > $("dt a").click(function () { > > $("span").fadeOut(100); > >$("dd:visible").slideUp("slow"); > >$(this).parent().next().slideDown("slow", function () { >$("span").fadeIn("slow"); >}); >return false; >}); > }); > > And my HTML code looks like this: > > > > > > > >Loreum Ipsum >Futurum veniam est claritatem lorem lorem. Sequitur legunt > consequat qui Investigationes Investigationes. Ut quam me gothica > dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui > et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit. > facilisis et nis4 > >Loreum Ipsum >Zzril legere quam lectorum parum hendrerit. Iriure exerci option > euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum. > Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip > hendrerit et ut eodem. Dynamicus claritatem placerat. facilisis et > nis4 > > > > > > > > > > > > >Loreum Ipsum >Futurum veniam est claritatem lorem lorem. Sequitur legunt > consequat qui Investigationes Investigationes. Ut quam me gothica > dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui > et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit. > facilisis et nis4 > >Loreum Ipsum >Zzril legere quam lectorum parum hendrerit. Iriure exerci option > euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum. > Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip > hendrerit et ut eodem. Dynamicus claritatem placerat. facilisis et > nis4 > > > > > > > > > > > > >Loreum Ipsum >Futurum veniam est claritatem lorem lorem. Sequitur legunt > consequat qui Investigationes Investigationes. Ut quam me gothica > dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui > et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit. > facilisis et nis4 > >Loreum Ipsum >Zzril legere quam lectorum parum hendrerit. Iriure exerci option > euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum. > Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip > hendrerit et ut eodem. Dynamicus claritatem placerat. facilisis et > nis4 > > > > > > > > > > > > >Loreum Ipsum >Futurum veniam est claritatem lorem lorem. Sequitur legunt > consequat qui Investigationes Investigationes. Ut quam me gothica > dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui > et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit. > facilisis et nis4 > >Loreum Ipsum >Zzril legere quam lectorum parum hendrerit. Iriure exerci option > euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum. > Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip > hendrerit et ut eodem. Dynamicus claritatem placerat. facilisis et > nis4 > > > > > > >
[jQuery] Re: How to prevent multiple click sound in IE 6 using jQuery History plugin
Hi Klaus, thanks for replying and pointing out this option. Yes, it would be nice to lose the sound and keep the navigation! Hopefully there may be another way out there :) On Sep 8, 3:12 am, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Although there's a way to supress that sound: > > http://www.julienlecomte.net/blog/2007/11/30/ > > you can't have both: "By using this trick, you will break the back / > forward navigation buttons. Therefore, this trick should only be used > for a non-navigational purpose only." > > --Klaus > > On Sep 7, 12:25 pm,RobAnderson<[EMAIL PROTECTED]> wrote: > > > I am hoping someone might be able to help with this problem. > > > I am using thejQueryhistoryplugin and it is working fine, except > > that in IE 6, I hear the 'start navigation' click sound twice when > > navigating backwards and forwards between pages. > > > I have got as far as identifying the parts of the plugin code where > > this is occurring, but do not know enough to stop prevent the annoying > > double-click sound (it seems to fire once when the age is loaded and > > again when the hidden iframe is populated). > > > Here is the relevant code segment and I have added two comments > > indicating where the clicks occur: > > > - > > > load: function(hash) { > > var newhash; > > > if ($.browser.safari) { > > newhash = hash; > > } else { > > newhash = '#' + hash; > > // First click heard in IE 6 > > location.hash = newhash; > > } > > this._curHash = newhash; > > > if ($.browser.msie) { > > var ihistory = $("#jQuery_history")[0]; // TODO: > > need > > contentDocument? > > var iframe = ihistory.contentWindow.document; > > iframe.open(); > > iframe.close(); > > // Second click heard in IE 6 > > iframe.location.hash = newhash; > > > this._callback(hash); > > } > > > - > > > I note that the multiple click sounds occur in thejQueryHistorydemo > > as well, so don't think it is just my implementation. > > > Is there perhaps another way to load the new hsh location into the > > iframe? > > > Any help much appreciated :) > > > Thanks,Rob
[jQuery] How to prevent multiple click sound in IE 6 using jQuery History plugin
I am hoping someone might be able to help with this problem. I am using the jQuery history plugin and it is working fine, except that in IE 6, I hear the 'start navigation' click sound twice when navigating backwards and forwards between pages. I have got as far as identifying the parts of the plugin code where this is occurring, but do not know enough to stop prevent the annoying double-click sound (it seems to fire once when the age is loaded and again when the hidden iframe is populated). Here is the relevant code segment and I have added two comments indicating where the clicks occur: - load: function(hash) { var newhash; if ($.browser.safari) { newhash = hash; } else { newhash = '#' + hash; // First click heard in IE 6 location.hash = newhash; } this._curHash = newhash; if ($.browser.msie) { var ihistory = $("#jQuery_history")[0]; // TODO: need contentDocument? var iframe = ihistory.contentWindow.document; iframe.open(); iframe.close(); // Second click heard in IE 6 iframe.location.hash = newhash; this._callback(hash); } - I note that the multiple click sounds occur in the jQuery History demo as well, so don't think it is just my implementation. Is there perhaps another way to load the new hsh location into the iframe? Any help much appreciated :) Thanks, Rob
[jQuery] Re: div magic
Thanks for the reply, but I think what you did was take the first way and convert it to the second. I think anyway, I gave it a shot just in case and it didn't end up as desired. What I'd like to do is start writing my "box" divs like the second way (without the nested h3 and div) so there's less reduntant and repeated code. Thus the javascript would take the second, more streamlined, div and expand it to an end result that looks like the first did originally. On Aug 21, 8:01 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote: > Whether or not this should be done, I don't know. It modifies the way > the user gets the title (much more subtle/hidden the second way). > > How to do this ? > > $('div.box').each(function(){ > this.title = $(this).find('h3').remove().attr('title') || ''; > > }); > > -- > Ariel Fleslerhttp://flesler.blogspot.com/ > > On Aug 21, 6:36 pm, Rob <[EMAIL PROTECTED]> wrote: > > > > > I'm very new to jquery and I'm finding that I'm flooding myself with > > ideas of how to use it! Good stuff. > > > I have this repeating pattern on my site: > > > > > Some Neat Title > > > > Some neat content... > > > > > > > What I think would be cool is to change that to the below and just put > > some script in my site's startup script that looks for all divs with > > the class "box" and modifies them so the ending result is like the > > above. > > > > > Some neat content > > > > > What do you think? > > > Thanks in advance, > > Rob- Hide quoted text - > > - Show quoted text -
[jQuery] div magic
I'm very new to jquery and I'm finding that I'm flooding myself with ideas of how to use it! Good stuff. I have this repeating pattern on my site: Some Neat Title Some neat content... What I think would be cool is to change that to the below and just put some script in my site's startup script that looks for all divs with the class "box" and modifies them so the ending result is like the above. Some neat content What do you think? Thanks in advance, Rob
[jQuery] UI/TABS: Can't enable multiple tabs in one call
Hi all, I want to enable/disable a couple of tabs at will. The docs say "To enable more than one tab at once reset the disabled property like: $('#example').data('disabled.ui-tabs', []);" I cannot get this to work at all - what element is the #example supposed to select? I've been trying on the element I called .tabs() on initially to create the tabs but that just does nothing TIA, --rob
[jQuery] Re: expr in $("", expr) not as expected
On Jul 2, 2:11 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > On Jul 2, 2008, at 7:57 AM, [rob desbois] wrote: > > > > > > > Hi, have a feeling this may be a silly question but here goes.. > > > Test output from Firebug's console is below to explain my issue. > > > I select an array of divs by their parent: > >>>> divs = $("#sidebar > div").get() > > [div#sidebar-search-tabcont, div#sidebar-events-tabcont] > > > I then want to find a particular one: > >>>> $("div", divs) > > Object length=0 prevObject=Object jquery=1.2.6 > > > Given that the 'expr' parameter to $(...) contains an array of divs, > > why is using the selector "div" not returning anything from that?? Am > > I misunderstanding expr? > > > Confused... > > --rob > > Hi Rob, > > Your selector $('div', divs) is looking for all div elements contained > in any of the divs stored in your variable. So, it's like doing $ > (divs).find('div') . I think you may have been expecting it to work > like $(divs).filter('div')? Do any of the divs selected by $("#sidebar > > div").get() have child divs? If not, the second selector shouldn't > be returning anything. > > Hope that makes sense > > --Karl > > > Karl Swedbergwww.englishrules.comwww.learningjquery.com Aha! Yes it does. Seems a bit odd though, the array (or jQuery/DOM object if so) *does* contain 2 div elements, so I would naturally expect those to be found. Thanks Karl, --rob
[jQuery] expr in $("", expr) not as expected
Hi, have a feeling this may be a silly question but here goes.. Test output from Firebug's console is below to explain my issue. I select an array of divs by their parent: >>> divs = $("#sidebar > div").get() [div#sidebar-search-tabcont, div#sidebar-events-tabcont] I then want to find a particular one: >>> $("div", divs) Object length=0 prevObject=Object jquery=1.2.6 Given that the 'expr' parameter to $(...) contains an array of divs, why is using the selector "div" not returning anything from that?? Am I misunderstanding expr? Confused... --rob
[jQuery] Re: Opera, IE8, JQuery Dialogs
Cool. Sorry for posting this in the wrong area, I thought I'd hit the UI place (I thought it had been deleted for a moment..) On May 31, 11:08 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > Thanks. This has been fixed in svn: > > http://dev.jquery.com/view/trunk/ui/ui.dialog.js > > and will be included in the next jQuery UI release, in a couple days. > > - Richard > > On Sat, May 31, 2008 at 5:12 PM, Rob Ashton <[EMAIL PROTECTED]> wrote: > > > Two things. > > > In opera: > > > $('#confirmSnippetDelete').dialog( > > { > > position: new Array(600 , 500) > > } > > ); > > > The script ignores the 'top' position specified as the second value of > > that coordinate pair. This was narrowed down to a local variable > > called 'top' which was conflicting with the 'top in the global > > namespace (window.top). > > Changing the name to dlgTop fixed my problems and it carried on > > working again. > > > In IE8 > > > I'm not sure if you really care about IE8 for the moment, but I'm > > getting an exception on the following line of code in jquery.ui. > > > var wnd = $(window), doc = $(document), minTop = top = > > doc.scrollTop(), left = doc.scrollLeft(); > > > IE8 is complaining about doc.scrollTop being assigned to top. > > > Again, changing the name of the variable to dlgTop resolves this > > issue. > > > === > > > I have no idea what the standard for Javascript says (Apparently it's > > a laughable thing anyway). I'm a desktop developer by trade, and I > > consider it a miracle that somebody has gone to all this effort of > > writing such a lovely library. So I'll end this on a positive note by > > saying thanks to all you lovely developers. I hope I can be of service > > once I wrap my head around all this javascript gubbins...
[jQuery] Opera, IE8, JQuery Dialogs
Two things. In opera: $('#confirmSnippetDelete').dialog( { position: new Array(600 , 500) } ); The script ignores the 'top' position specified as the second value of that coordinate pair. This was narrowed down to a local variable called 'top' which was conflicting with the 'top in the global namespace (window.top). Changing the name to dlgTop fixed my problems and it carried on working again. In IE8 I'm not sure if you really care about IE8 for the moment, but I'm getting an exception on the following line of code in jquery.ui. var wnd = $(window), doc = $(document), minTop = top = doc.scrollTop(), left = doc.scrollLeft(); IE8 is complaining about doc.scrollTop being assigned to top. Again, changing the name of the variable to dlgTop resolves this issue. === I have no idea what the standard for Javascript says (Apparently it's a laughable thing anyway). I'm a desktop developer by trade, and I consider it a miracle that somebody has gone to all this effort of writing such a lovely library. So I'll end this on a positive note by saying thanks to all you lovely developers. I hope I can be of service once I wrap my head around all this javascript gubbins...
[jQuery] Preventing command+A (select all) in FF/Mac
I have a Flash movie inside of a standard HTML page with text. When a user hits command+A to select something in the textfield of the Flash movie, it selects all the text from the HTML part of the page as well. Really annoying. I can detect the command+A with the following code, just can't prevent it from selecting the HTML part. Any ideas? Pastebin: http://pastie.caboo.se/162497 // Command+A in FF/Mac only triggers a keyup on the A. $('#buildermovie').bind('keyup', function (e) { if (e.which == 65 && e.metaKey) { console.log(e, e.metaKey);console.log("Try to cancel select-all"); // This gets triggered. e.preventDefault(); //e.stopPropagation(); //var t = setTimeout("$('#header-login').trigger('click');console.log('click');", 20); return false; } }); -Rob
[jQuery] Passing extra data to AJAX handler functions
I commonly want to pass an ID or some other information I know to an AJAX success handler. > $.post('/ajax/asset/insert', { > folder_tid : lastUploadedFolderTID, > link : linkQueue[id] > }, handleAddLinkComplete, 'json'); In this example, I want to pass an ID to handleAddLinkComplete function. I know I can do the following, but they seem crufty to me. 1. I can set a global variable with the link ID, but what if I have a bunch of post calls, there are synchronous issues (I know I can do async : false too) 2. I could have my /ajax/asset/insert callback return the link ID back to me in the response, but it seems silly if I already know it. I would love to do something like... > $.post('/ajax/asset/insert', { > folder_tid : lastUploadedFolderTID, > link : linkQueue[id] > }, { callback : handleAddLinkComplete, arguments : [123] }, 'json'); or something. What is the best way here or is my dream a reality? Cheers, -Rob
[jQuery] Re: Selector Not Working in IE7?
On Nov 20, 2007 5:02 PM, Josh Nathanson <[EMAIL PROTECTED]> wrote: > > WOW, thanks for that link to debugbar.com -- I had been searching far and > wide for an IE debugger and couldn't find anything good -- that is sweet! It's no Firebug, but it's the best I've seen for IE.
[jQuery] Re: Selector Not Working in IE7?
On Nov 16, 1:33 pm, Rob Wilkerson <[EMAIL PROTECTED]> wrote: > I'm trying to "manually" interact with the multifile plugin and, as > part of that endeavor, I need to systemically access the anchor tag > that provides "Delete" functionality. The following works great in FF > (of course): > > $('a[href^="#multimulti_"]') > > The objects are returned as expected and alert ( $ > ('a[href^="#multimulti_"]').length ) returns the expected number of > elements. In IE7, though, the former value is undefined and the > latter is 0. Anyone have any idea why this might be happening? For anyone who may be interested and searching, I finally tracked this down thanks to the most excellent DebugBar (http:// www.debugbar.com/). Seems that IE, in its infinite wisdom, thinks that the hrefs created by the multifile upload code aren't good enough and prepends the rest of the page URI to them at runtime. The href coded "Delete", rendered in IE, is transformed into "http://www.mydomain.com/survey#multimulti_0";>Delete". As a result, the attribute-begins-with selector ([attribute^=value]) doesn't work. I replaced it with the attribute-contains selector ([attribute*=value]) so that the code will work in both IE & Firefox.
[jQuery] Selector Not Working in IE7?
I'm trying to "manually" interact with the multifile plugin and, as part of that endeavor, I need to systemically access the anchor tag that provides "Delete" functionality. The following works great in FF (of course): $('a[href^="#multimulti_"]') The objects are returned as expected and alert ( $ ('a[href^="#multimulti_"]').length ) returns the expected number of elements. In IE7, though, the former value is undefined and the latter is 0. Anyone have any idea why this might be happening? A high level end-to-end process looks like this: 1. User selects a file to upload 2. File is uploaded via the ajax file upload plugin and validated 3. If an error is thrown (dimensions incorrect, file size too large, etc.), the error is displayed and the delete link is triggered so that the file is removed from the display. Any insight would be much appreciated. I don't see any indication in the jQuery docs that this type of selector shouldn't work in IE... Thanks. Rob
[jQuery] Re: Dynamically Populating Select Box
Hi Snooze, 1. Check out the following tutorials if you haven't already: http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/ http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/ 2. Check out Shelane's plugin: http://code.google.com/p/jqueryselectcombo/ http://lasso.pro/selectCombo/ 3. Check out my plugin: http://www.msxhost.com/jquery/linked-selects/json/ Perhaps you can use the example php code in the download to work it out for ASP! Cheers Rob Snooze wrote: I am trying to make a select box that with populate depending on what is selected in the select box before it. Both of these select boxes need to draw information from the sql database (I have to use ASP to get this information). I've been looking at some tutorials but am overall very confused as how to accomplish this. I understand that I need to look for a change in the first select box to populate the second, but I don't understand how to tell ASP to query for different information. I would like something like this: label from db label from db label from db (I get the list of categories from a database using ASP, there is 37 of them but this might change.) label from db depending on cat chosen label from db depending on cat chosen label from db depending on cat chosen (I need the criteria to be drawn from the database, preferrably using ASP, there is also a different number of criteria for each category.) __ NOD32 2627 (20071030) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com
[jQuery] Re: problem with jquery
Mark, I think you are saving the document as rich text format (RTF). Try pasting the code sample into notepad and save it from there. Once that works, make sure that in whatever editor you're using you save things as 'plain text'. Hope that helps --rob On 10/24/07, mark <[EMAIL PROTECTED]> wrote: > > > Hi All, > > I am a new person to the world of jQuery. > > I am having a problem in my first program only. Please tell me what is > wrong over here. > > My code is : > > > > > $(document).ready(function() { >$("a").click(function() { > alert("Hello world!"); >}); > }); > > > http://google.com";>google > > > > Output which I am getting is : > > {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss > \fcharset0 Arial;}} {\*\generator Msftedit > 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 \par \par \par \par \tab > google\par \par \par } > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: jqMultiSelects suggestion
Rodrigo, This has now been implemented along with some additional features. jqMultiSelects v0.2 is available from http://code.google.com/p/jqmultiselects/ Cheers, --rob On 10/22/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > > Hey Rodrigo, > > Apologies for the massive time in replying, I am very busy these days. > > That is a great suggestion, and one which a few people have mentioned. I > will modify the official plugin source as soon as possible, but for now your > fix does just great :-) > > All the best > --rob > > On 9/22/07, Rodrigo Moraes <[EMAIL PROTECTED]> wrote: > > > > > > Hey Rob, > > > > Thanks for jqMultiSelects. Useful one. :) > > > > One suggestion: let the user decide the selectors that will be used > > for the elements, instead of forcing an ID. I modified it to allow > > this: > > > > jQuery.fn.multiSelect = function(to, button) { > > return this.each(function() { > > var select = this; > > jQuery(this).dblclick(function() { > > moveOptions(select, to); > > }); > > > > if (typeof button != "undefined") { > > jQuery(button).click(function() { > > moveOptions(select, to); > > }); > > } > > }); > > > > function moveOptions(from, to) { > > jQuery(from).children("option:selected").each(function() { > > jQuery(this) > > .attr("selected", false) > > .appendTo(to); > > }); > > } > > }; > > > > Then it can be called like this: > > > > $("#select_left").multiSelect("#select_right", "#options_right"); > > $("#select_right").multiSelect("#select_left", "#options_left"); > > > > Don't you think it is less restrictive? > > -- rodrigo > > > > > > -- > Rob Desbois > Eml: [EMAIL PROTECTED] > Tel: 07946 705987 > "There's a whale there's a whale there's a whale fish" he cried, and the > whale was in full view. > ...Then ooh welcome. Ahhh. Ooh mug welcome. -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] ANNOUNCE: v0.2 of jqMultiSelects released
Hi all, After a lengthy delay I have released v0.2 of the jqMultiSelects plugin: * jqMultiSelects* enables you to deal purely with the presentation of your elements, and then use the plugin to transfer options from one to another. - It now conforms with other plugins and accepts all element identifiers as jQuery selectors instead of requiring an element ID. - Callbacks have been added to enable cancelling the move or just hooking into it before and after. - elements can now be automatic submitted with parent form submission - Size is 4.4KB or 0.6KB packed Thanks to everyone who made suggestions and waited for so long. Further information and downloads are available from http://code.google.com/p/jqmultiselects/ --rob -- Rob Desbois
[jQuery] Re: jqMultiSelects suggestion
Hey Rodrigo, Apologies for the massive time in replying, I am very busy these days. That is a great suggestion, and one which a few people have mentioned. I will modify the official plugin source as soon as possible, but for now your fix does just great :-) All the best --rob On 9/22/07, Rodrigo Moraes <[EMAIL PROTECTED]> wrote: > > > Hey Rob, > > Thanks for jqMultiSelects. Useful one. :) > > One suggestion: let the user decide the selectors that will be used > for the elements, instead of forcing an ID. I modified it to allow > this: > > jQuery.fn.multiSelect = function(to, button) { > return this.each(function() { > var select = this; > jQuery(this).dblclick(function() { > moveOptions(select, to); > }); > > if (typeof button != "undefined") { > jQuery(button).click(function() { > moveOptions(select, to); > }); > } > }); > > function moveOptions(from, to) { > jQuery(from).children("option:selected").each(function() { > jQuery(this) > .attr("selected", false) > .appendTo(to); > }); > } > }; > > Then it can be called like this: > > $("#select_left").multiSelect("#select_right", "#options_right"); > $("#select_right").multiSelect("#select_left", "#options_left"); > > Don't you think it is less restrictive? > -- rodrigo > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Determining the length of an object/array in IE
I know this should be simple, I know this should work, but it isn't and doesn't. so if you take a look-see at http://www.roberthenrylowe.com/lab/jQuery/codeconverter.html in Firefox, you'll see what I am trying to accomplish and in fact, it works there. Basically I take a block and make it a fancy formatted , except in IE, the jQuery code found at http://www.roberthenrylowe.com/lab/jQuery/codeconverter.js fails silently around line 20 and don't understand why. Can anyone help out? Thanks!
[jQuery] Re: I would like to return xhtml character entities
That's perfect! Thanks so much On Oct 11, 12:53 am, George <[EMAIL PROTECTED]> wrote: > I've not tried this but what if you use .text($codetext) instead of > append($codetext) ? > (Or is this not what you want?!) > > George
[jQuery] I would like to return xhtml character entities
I would like to grab a string that contains '<' and '>' and NOT have jQuery eval and force my browser to render it has html. It's difficult for me to convey what I want, but basically I am trying to send it latin or unicode entity references for the angle brackets and want to write those brackets as literal brackets, not rendered as html... I dunno if that makes sense so here is the code I am testing with: html -jQ - $(document).ready(function() { $codetext = $("div.test div").text(); $("div.test div").empty(); $("div.test div").append($codetext); });This is a sample paragraph.
This is another sample paragraph.
This is one last sample paragraph.
[jQuery] Dragging from droppable to droppable
So I have two distinct TD tags, and each one is designated droppable. Inside one of the TDs I have a DIV tag that is draggable. Both droppables will accept that draggable. The dragging and dropping works, but *both* droppables call their "drop()" methods when I drag the DIV from one TD to the other. The ui object of first (erroneous) drop() reports that the DIV was dropped into the TD from which it came. The ui of the second drop() says that DIV was dropped into the other TD (which is accurate). Why is this happening (is drop() only bound to the mouseup event) ? Is there a way that I can determine what is being dragged and dropped where? Best, Rob
[jQuery] Repost: Dragging from droppable to droppable
This didn't quite work before: So I have two distinct TD tags, and each one is designated droppable. Inside one of the TDs I have a DIV tag that is draggable. Both droppables will accept that draggable. The dragging and dropping works, but *both* droppables call their "drop()" methods when I drag the DIV from one TD to the other. The ui object of first (erroneous) drop() reports that the DIV was dropped into the TD from which it came. The ui of the second drop() says that DIV was dropped into the other TD (which is accurate). Why is this happening (is drop() only bound to the mouseup event) ? Is there a way that I can determine what is being dragged and dropped where? Best, Rob
[jQuery] Re: editease - my first plugin endeavor
Hi Stephen, Awesome, I like the look of this a lot! I can't wait to find some time to muck about with this in the very near future. Good Luck with your project. Rob [EMAIL PROTECTED] wrote: Well I have been playing with jQuery for a few months, and wanted to test a few basic concepts. Mostly to do with injecting content into the DOM on the fly in a usable way, to give some older client sites of mine, CMS capabilities without having to do a full conversion of the site to a database driven CMS. In other words I was looking for the quickest short cut, and install script, possible so that I didn't need to spend hours converting sites to suit a full CMS. What came out of this idea is a little plugin I have called "editEase" for want of a better name (and naming things is not my forte) that allows for edit in place of content by writing to the include file instead of using a database. Knowing one of my clients (and their lack of technical skills), a WYSIWYG editor had to be an option, along side a plain text area, and TinyMCE seemed a good choice given it works in nearly all browsers (including Opera). Anyways, I have created a little project file here: http://code.google.com/p/editease/ which has links to a short video http://screencast.com/t/Ayk7at3C (only a 1 minute investment of your time, instead of having to read through a lot of stuff to work out what I am on about), a live demo, and the download files. There are 2 dependencies on other jQuery plugins, being Thickbox and Dimensions, although figured most would use them a lot already. Would appreciate any feedback on this idea. Cheers Stephen
[jQuery] Re: multiple ajax selects; dynamic selects don't support onchange?
Hi Karl, Thanks for your feedback, I will certainly make that modification you have suggested. Ya know you really do lean something new everyday ;) Kind regards Rob Karl Rudd wrote: Very nice. I know it's only a demo but you could reduce size of the JSON responses by about 60% (or more) if you used smaller key strings, something like "v" and "t" instead of "optionValue" and "optionDisplay". For the 2500+ records for NSW it makes a huge difference. Like I said, very nice work. I do so love how jQuery allows you remove all the fluff and you can just get things done. Karl Rudd On 9/27/07, Rob D <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: Hi all, i'm creating a search interface based on select dropdown methods.. the user selects the option from the first menu and the second is created dynamically using ajax. their is a third option which will be populated based on their selection of the second dropdown. however this does not work... seems the onchange method isn't workin? any ideas guys? here's a snippet of my code $("#jumpMenu").change(function() { var x = $(this).val(); $.ajax({ type: "GET", url: "/bookstore/includes/israel_mod/ajax.php", data: "type=division&catId=" + x, dataType: "html", success: function(html){ $("#department_select").html(html); }, error: function(msg){ alert( "An Error: " + msg ); } }); }); $("#jumpMenu2").change(function() { var z = $(this).val(); alert(z); }); NOTE: #jumpMenu2 is the second dropdown that doesn't seem to be taking the change event (i put a test alert, but it doesn't work), this is also the dynamically generated select .. would it be .. because it is appended into the html? any ideas thanks a lot, this has me wtih a massive migraine, can't figure out why it wouldn't accept the onchange funchtion Israel Hi Israel Check out my recently announced plugin called LinkedSelects. http://www.msxhost.com/jquery/linked-selects/json/ It might be of assistance to you! Cheers Rob
[jQuery] Re: multiple ajax selects; dynamic selects don't support onchange?
[EMAIL PROTECTED] wrote: Hi all, i'm creating a search interface based on select dropdown methods.. the user selects the option from the first menu and the second is created dynamically using ajax. their is a third option which will be populated based on their selection of the second dropdown. however this does not work... seems the onchange method isn't workin? any ideas guys? here's a snippet of my code $("#jumpMenu").change(function() { var x = $(this).val(); $.ajax({ type: "GET", url: "/bookstore/includes/israel_mod/ajax.php", data: "type=division&catId=" + x, dataType: "html", success: function(html){ $("#department_select").html(html); }, error: function(msg){ alert( "An Error: " + msg ); } }); }); $("#jumpMenu2").change(function() { var z = $(this).val(); alert(z); }); NOTE: #jumpMenu2 is the second dropdown that doesn't seem to be taking the change event (i put a test alert, but it doesn't work), this is also the dynamically generated select .. would it be .. because it is appended into the html? any ideas thanks a lot, this has me wtih a massive migraine, can't figure out why it wouldn't accept the onchange funchtion Israel Hi Israel Check out my recently announced plugin called LinkedSelects. http://www.msxhost.com/jquery/linked-selects/json/ It might be of assistance to you! Cheers Rob
[jQuery] Validate plugin and attribute selector values with [square brackets]
Hi all, I thought I'd give you all (and Joern also) a heads-up on a problem I've been having. I use the validate() plugin on forms whose tags have names like 'user[email]'. The 'rules' option to validate() has no problem with this, but I've now started passing an array of server-side errors to showErrors() which then fails. The reason is that on line #538 of jquery.validate.js v1.1, the selector resolves to jQuery("[EMAIL PROTECTED]") - I presume that the first closing square bracket is interpreted by jQuery to be closing the selector instead of part of the attribute. The fix I have discovered is to amend line #538 to put single quotes around the value, like so: > element: jQuery("[EMAIL PROTECTED]'" + name + "']:first", this.currentForm)[0] > I'm not sure how advisable that fix is - if anyone can advise on that I'd be very grateful. As an aside - Joern this is the first time I've used validate, all I'll say is thank you, it's a fantastic plugin very well thought-out. --rob -- Rob Desbois
[jQuery] Re: Interacting with the MultiFile Plugin
On Sep 17, 9:17 am, Rob Wilkerson <[EMAIL PROTECTED]> wrote: > I have a form that is using both the ajaxFileUpload and the MultiFile > plugins. When a user selects a file for upload, the change event > uploads the file via ajax for validation. If an error occurs, I need > to remove the file from the MultiFile "queue". I can (and have) > manually removed the elements, but that doesn't decrement the maxfile > counter, of course. > > The easy way to do all of this is to trigger the MultiFile function > that is called when the user deletes the file from the UI, but I can't > figure out how to do that or, for that matter, if it's even possible. > > Here is a snippet from within my $.ajaxFileUpload() where I'm manually > removing the UI components: > > success: function ( data, status ) { > try { > var index = /\d+$/.test ( input.name ) ? input.name.replace ( > /^.+ > (\d)+$/, '$1' ) : 0; > /** > * If there's an error in the upload process, remove the > relevant > * UI elements. > */ > if ( data['error'].length > 0 ) { > $('#multi_0_' + index ).remove(); > $('a[href^="#multimulti_"]:last').parent().remove(); > /** TODO: have to decrement the counter within the > MultiFile > object...how? */ > > throw ( data['error'] ); > } > else { > // Debug > // alert ( data['files'] ); > $('form').prepend ( > ' 'id="uploaded' + index + '" ' + > 'name="uploaded' + index + '" ' + > 'value="' + encodeURI ( data['files'] ) + '" > ' + > '/>' > ); > } > } > catch ( e ) { > alert ( 'Error: ' + e.message ); > } > > }, > Oh, to see the forest through the trees. It seems to work if I manually trigger the click event of the link. $('a[href^="#multimulti_"]:last').trigger ( 'click' );
[jQuery] Re: Interacting with the MultiFile Plugin
On Sep 17, 9:17 am, Rob Wilkerson <[EMAIL PROTECTED]> wrote: > I have a form that is using both the ajaxFileUpload and the MultiFile > plugins. When a user selects a file for upload, the change event > uploads the file via ajax for validation. If an error occurs, I need > to remove the file from the MultiFile "queue". I can (and have) > manually removed the elements, but that doesn't decrement the maxfile > counter, of course. > > The easy way to do all of this is to trigger the MultiFile function > that is called when the user deletes the file from the UI, but I can't > figure out how to do that or, for that matter, if it's even possible. > > Here is a snippet from within my $.ajaxFileUpload() where I'm manually > removing the UI components: > > success: function ( data, status ) { > try { > var index = /\d+$/.test ( input.name ) ? input.name.replace ( > /^.+ > (\d)+$/, '$1' ) : 0; > /** > * If there's an error in the upload process, remove the > relevant > * UI elements. > */ > if ( data['error'].length > 0 ) { > $('#multi_0_' + index ).remove(); > $('a[href^="#multimulti_"]:last').parent().remove(); > /** TODO: have to decrement the counter within the > MultiFile > object...how? */ > > throw ( data['error'] ); > } > else { > // Debug > // alert ( data['files'] ); > $('form').prepend ( > ' 'id="uploaded' + index + '" ' + > 'name="uploaded' + index + '" ' + > 'value="' + encodeURI ( data['files'] ) + '" > ' + > '/>' > ); > } > } > catch ( e ) { > alert ( 'Error: ' + e.message ); > } > > }, > Oh, to see the forest through the trees. It seems to work if I manually trigger the click event of the link. $('a[href^="#multimulti_"]:last').trigger ( 'click' );
[jQuery] postbacks, $(document).ready(), and asp.net
I'm having an interesting problem that happens in both IE6 and Firefox. My menu script runs fine when the page first loads. It sets the style of certain table elements when the $() ready function fires, all is good. But on postbacks (button clicks), the script runs fine, the style is updated, but the page doesn't show the updated styles. Any ideas on what to track down? I've checked that the style is indeed changed with Firebug on postbacks, so I have no idea why the browser doesn't display the updated styles. Thanks Rob
[jQuery] Interacting with the MultiFile Plugin
I have a form that is using both the ajaxFileUpload and the MultiFile plugins. When a user selects a file for upload, the change event uploads the file via ajax for validation. If an error occurs, I need to remove the file from the MultiFile "queue". I can (and have) manually removed the elements, but that doesn't decrement the maxfile counter, of course. The easy way to do all of this is to trigger the MultiFile function that is called when the user deletes the file from the UI, but I can't figure out how to do that or, for that matter, if it's even possible. Here is a snippet from within my $.ajaxFileUpload() where I'm manually removing the UI components: success: function ( data, status ) { try { var index = /\d+$/.test ( input.name ) ? input.name.replace ( /^.+ (\d)+$/, '$1' ) : 0; /** * If there's an error in the upload process, remove the relevant * UI elements. */ if ( data['error'].length > 0 ) { $('#multi_0_' + index ).remove(); $('a[href^="#multimulti_"]:last').parent().remove(); /** TODO: have to decrement the counter within the MultiFile object...how? */ throw ( data['error'] ); } else { // Debug // alert ( data['files'] ); $('form').prepend ( '' ); } } catch ( e ) { alert ( 'Error: ' + e.message ); } }, Any help would be much appreciated. Thanks. Rob Wilkerson
[jQuery] Re: New plugin - Linked Selects
Hi, Thank you to everyone for the positive feedback, its much appreciated. @ David "Is it possible to remove the value of children selects?" Great suggestion, I will look into this when time permits. "Please put in arhive full code(database)" I have updated the archive to include the database abstraction I use, plus added an alternative select.php file that uses php's mysql functions directly. I have also made available a dump of the database tables used in the demo. http://www.msxhost.com/jquery/linked-selects/json/ @Web Specialist "Only one susggestion: including a cache option in call function." Do you mean like caching the DB queries? Kind regards Rob
[jQuery] New plugin - Linked Selects
Hi, Sometime ago I built my first plugin called linkedSelects and I would finally like to announce it to the list. You can see it in action and download the code here: http://www.msxhost.com/jquery/linked-selects/json/ I have only been able to test it in the latest versions of Firefox and IE. I would like to thank Remy Sharp for the initial idea, Joel Birch for some pointers on building plugins and especially my good friend Shelane Enos for the collaboration. I would appreciate any feedback in the way of suggestions and improvements. Have a great weekend everyone... Rob
[jQuery] Re: .ready(), Rhino and HttpUnit
Thanks for the replies - it's not just .ready() though, it seems to be all events. Without the ability to use one of addEventListener and attachEvent jQuery can't bind events to anything, which makes it all a bit less useful :-( On 9/12/07, Brandon Aaron <[EMAIL PROTECTED]> wrote: > > I think you might be able to use John's modified version of Rhino that > acts like a browser. Where it is I'm not sure but it wasn't that long ago > that he wrote it. > > -- > Brandon Aaron > > On 9/12/07, Sean Catchpole <[EMAIL PROTECTED]> wrote: > > > > Hi Rob, > > > > .ready() won't work in Rhino since there is no page to wait if it's > > ready. > > Everything else should work just fine. > > > > ~Sean > > > > On 9/12/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > > > > > > Ok I've enlightened myself a little: I tried it with jQuery 1.2 and > > > discovered that the line number changed - it's not a line number in > > > httpUnit > > > as I thought (understandably I think!) but in jQuery. > > > > > > In jQuery 1.2 it's line 1613 (but is reported as 1612), which is the > > > else statement in this part of jQuery.event["add"]: > > > > > > // And bind the global event handler to the element > > > > if (element.addEventListener ) > > > >element.addEventListener(type, handle, false); > > > > else > > > >element.attachEvent("on" + type, handle); > > > > > > > > > > So neither addEventListener nor attachEvent are defined (I change the > > > else to an else if to check attachEvent - it's undefined). > > > Seeing as there's been a fair bit of mention of jQuery in Rhino on the > > > list, I find it hard to believe jQuery won't work with it - so has anyone > > > who's used Rhino with jQuery seen this, and can anyone help? > > > > > > thanks, > > > --rob > > > > > > On 9/12/07, Rob Desbois < [EMAIL PROTECTED]> wrote: > > > > > > > > Hi all, > > > > > > > > I'm creating a Web app which uses jQuery, and am unit testing it > > > > with HttpUnit which uses Rhino (the Mozilla JavaScript implementation). > > > > > > > > I'm having trouble with $(document).ready(...) causing the tests to > > > > crash with this message: > > > > > > > > >alert("hi"); > > > > > });' failed: TypeError: undefined is not a function. (httpunit; > > > > > line 1456)) > > > > > > > > > > > > The whole statement is this: > > > > > > > > > $(document).ready(function() { > > > > >alert("hi"); > > > > > }); > > > > > > > > > > > > > Other basic checks are ok, e.g. $("#foo").focus() works perfectly. > > > > Even if I only try to use .ready() after checking that is is > > > > defined, I still get the same result: > > > > > > > > > if (typeof $(document).ready === 'function') > > > > > > > > > > > > > I know this is likely to be a Rhino/HttpUnit problem but as I know > > > > several people on this list are familiar with Rhino I wanted to know if > > > > anyone's seen this or has any ideas? > > > > I'm on: > > > > jQuery 1.1.4 > > > > HttpUnit 1.6.2 > > > > > > > > TIA, > > > > --rob > > > > > > > > -- > > > > Rob Desbois > > > > <[EMAIL PROTECTED]> > > > > > > > > > > > > -- > > > Rob Desbois > > > > > > > -- Rob Desbois
[jQuery] Re: .ready(), Rhino and HttpUnit
Ok I've enlightened myself a little: I tried it with jQuery 1.2 and discovered that the line number changed - it's not a line number in httpUnit as I thought (understandably I think!) but in jQuery. In jQuery 1.2 it's line 1613 (but is reported as 1612), which is the else statement in this part of jQuery.event["add"]: // And bind the global event handler to the element > if (element.addEventListener) >element.addEventListener(type, handle, false); > else >element.attachEvent("on" + type, handle); > So neither addEventListener nor attachEvent are defined (I change the else to an else if to check attachEvent - it's undefined). Seeing as there's been a fair bit of mention of jQuery in Rhino on the list, I find it hard to believe jQuery won't work with it - so has anyone who's used Rhino with jQuery seen this, and can anyone help? thanks, --rob On 9/12/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm creating a Web app which uses jQuery, and am unit testing it with > HttpUnit which uses Rhino (the Mozilla JavaScript implementation). > > I'm having trouble with $(document).ready(...) causing the tests to crash > with this message: > > >alert("hi"); > > });' failed: TypeError: undefined is not a function. (httpunit; line > > 1456)) > > > The whole statement is this: > > > $(document).ready(function() { > >alert("hi"); > > }); > > > > Other basic checks are ok, e.g. $("#foo").focus() works perfectly. > Even if I only try to use .ready() after checking that is is defined, I > still get the same result: > > > if (typeof $(document).ready === 'function') > > > > I know this is likely to be a Rhino/HttpUnit problem but as I know several > people on this list are familiar with Rhino I wanted to know if anyone's > seen this or has any ideas? > I'm on: > jQuery 1.1.4 > HttpUnit 1.6.2 > > TIA, > --rob > > -- > Rob Desbois > <[EMAIL PROTECTED]> -- Rob Desbois
[jQuery] .ready(), Rhino and HttpUnit
Hi all, I'm creating a Web app which uses jQuery, and am unit testing it with HttpUnit which uses Rhino (the Mozilla JavaScript implementation). I'm having trouble with $(document).ready(...) causing the tests to crash with this message: >alert("hi"); > });' failed: TypeError: undefined is not a function. (httpunit; line > 1456)) The whole statement is this: > $(document).ready(function() { >alert("hi"); > }); > Other basic checks are ok, e.g. $("#foo").focus() works perfectly. Even if I only try to use .ready() after checking that is is defined, I still get the same result: > if (typeof $(document).ready === 'function') > I know this is likely to be a Rhino/HttpUnit problem but as I know several people on this list are familiar with Rhino I wanted to know if anyone's seen this or has any ideas? I'm on: jQuery 1.1.4 HttpUnit 1.6.2 TIA, --rob -- Rob Desbois Eml: [EMAIL PROTECTED]
[jQuery] Re: Need tips on how i can optimize the scripts on this page...
Hi Trinodia, I'm afraid you're unlikely to get any responses from that - there're always people on this list who will help you with debugging, but you have to help us. Posting a link and asking people to play around and find the problems themselves will rarely result in what you want. I did just visit, but a minute of clicking things yielded no error for me, so I have given up. What are the errors you're receiving? Have you tried debugging? --rob On 8/22/07, Trinodia <[EMAIL PROTECTED]> wrote: > > > Hi all! > > Just have gotten my head into the jQuery stuff and while updating the > companys website this summer i have now run into some problems. > > The scripts on the page causes an error message to pop up from time to > time (mostly on IE6 but also in IE7 and in Firefox). Any tips on how i > can get these errors to, if not disapear completly atleast lower in > amount of times... > > The website is located at http://www.restaurangguiden.com ... the > content is in Swedish so to try it out, click on any of the graphic > buttons to the right, "Välj ort" on the left or "A till Ö" on the > left. The english version does not have large enough pages to cause > the error from what i can tell. > > Thanks in advance! > > //Trinodia > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: ORing selectors
Does anyone know offhand how much overhead using .add() instead of the comma incurs? Is it just the additional function call? I've always used comma in selectors but using .add() instead is much clearer as it separates the selectors in an obvious manner. --rob On 8/15/07, Matt Stith <[EMAIL PROTECTED]> wrote: > > I would do something like > > $("#X").add(".Y"); > > On 8/15/07, rickdog <[EMAIL PROTECTED] > wrote: > > > > > > What is the cleanest way for ORing select results, e.g. returning all > > DIVs with id="X" or class="Y"? > > > > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: .each "this" inside class
Eridius, I believe (but could be wrong) that even if you are in a class, from within the .each() function parameter, you're no longer within that context but within the context of iterating through the DOM nodes so 'this' should still be the DOM node: function some_class_function() { >// in the class context, 'this' is the class object >$(...).each(function() { > // no longer in a class context but in .each() context - 'this' is a > DOM element >}); > } > I'm almost certain of that. It's why when you create a closure if you want to access a 'this' variable you have to store it in something else: > function some_class_function() { >var self = this; // store for closure > >$(...).each(function() { > // 'this' is a DOM element > // 'self' is the class object >}); > } > I hope that helps...if I'm wrong can you give a URL or some example code? --rob On 8/12/07, Eridius <[EMAIL PROTECTED]> wrote: > > > > now when i use the .each function, inside that function "this" points to > the > element however i am using .each inside a class and "this" point to the > class. Is thier another way to access the element of the /each function > without using "this"? > -- > View this message in context: > http://www.nabble.com/.each-%22this%22-inside-class-tf4257886s15494.html#a12117256 > Sent from the JQuery mailing list archive at Nabble.com. > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: min max in array
Your trusty friend 'Google' is usually the best way for this! A quick search on javascript array max yields a useful result from none other than John: http://ejohn.org/blog/fast-javascript-maxmin/ --rob On 8/10/07, Simpel <[EMAIL PROTECTED]> wrote: > > > Hi there! not really a jquery question this maybe but hopefully > someone will answer it anyway... > > I've got an array with different productprices. I'd like to get the > highest and lowest price out of this array. What's the best way to do > this? > > /J > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Excluding an element part of a selection
I'm not sure how to do this as it stands - I've never been particularly au fait with text nodes and how to work with them. However, a possible solution is to put the text next to the checkbox in a and then attach the click event to that. --rob On 8/9/07, David Garcia Ortega <[EMAIL PROTECTED]> wrote: > > > Hi JQueriers, > >I have a question about selectors. First of all, I have the > following html: > > > type="checkbox" name="option1" > value="Novedad1"> Novedad 1: HOla holaaa > > > > >As you can see, I have a div an inside it a link which has a > checkbox an text. > > > Well, what I would like to do is to associate a click event when the > user clicks on the link, but with an exception: This event should > raise when the user clicks anywhere on the link excepts on the > checkbox that it is inside the link. > > > To be honest I don't know how to do it. I've been googling and > JQuering but I've not foud anything useful. I've read about "not" but > I think that it is not useful in this case. > > >What I have in .js file is: > > $('#content a').click( function () > { > //code > } > ); > > >I would like this click event to raise when the user clicks > anywhere on the link excepts on the checkbox. > > > Any ideas? Thank in advance!! > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Nested Tables Question
Hi Mike, If you use $("table table") that will select all tables which are inside another table in the document. --rob On 8/7/07, Mike Miller <[EMAIL PROTECTED]> wrote: > > > Hi, > > I need to find a quick way to determine whether or not table elements > on the page have any children table elements...as I want to change the > style class of the innermost table. > > Any ideas on how best to do this? > > M > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Toggle visibility on an entire table column?
Andy, For future reference in case you need it on a different column - the :nth-child(n) selector will do a similar thing for the nth column (n is 1-based, not 0-based though). --rob On 8/7/07, Andy Matthews <[EMAIL PROTECTED]> wrote: > > Right on! That's exactly what I want to do. Thanks Glenn! > > -- > *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Glen Lipka > *Sent:* Tuesday, August 07, 2007 9:45 AM > *To:* jquery-en@googlegroups.com > *Subject:* [jQuery] Re: Toggle visibility on an entire table column? > > I had an existing demo that was really close to that. I modified it here. > http://www.commadot.com/jquery/selectors/lastTD.htm > The answer I have is td:last in an each. > > Glen > > > On 8/7/07, Andy Matthews <[EMAIL PROTECTED]> wrote: > > > > I haven't tried this yet but is it as simple as assigning some sort of > > selector and show'hide -ing the resulting query object? > > > > It will be the LAST td in each row, is there a "last child" selector or > > would it be best to just assign a class to each td? > > > > I just want to be able to toggle visibility on one entire column. > > > > * > > > > Andy Matthews > > *Senior ColdFusion Developer > > > > Office: 877.707.5467 x747 > > Direct: 615.627.9747 > > Fax: 615.467.6249 > > [EMAIL PROTECTED] > > www.dealerskins.com > > > > > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. <>
[jQuery] Re: Looking for correct Jquery AJAX statement
Jack, The correct jQuery syntax is as follows: var chk1 = $("#city").val() + "*"; > var s = ' height=1500 src="s30.php?id=' + chk1 + '"><\/iframe>'; > The $.get() function [http://docs.jquery.com/Core#get.28.29] returns the matched elements as an array of DOM objects, so $("#feeds").get() will give you an array with a single DOM element - that with the ID 'feeds' (unless it doesn't exist, in which case you'll get an empty array). HTH, --rob On 8/7/07, Jack <[EMAIL PROTECTED]> wrote: > > > Hello everyone, > > I want to translate this > > var chk1 = document.getElementById('city').value + '*' ... > var string= ' width=980 height=1500 src="s30.php?id=' + chk1 + '"><\/iframe>'; > > into > > $("#feeds").get(chk1); or $("#feeds").get("s30.php?id=' + chk1 + '"); > or $("#feeds").get("s30.php", { id: chk1 }) > > Which jquery expression is correct? > > Than you for help > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: What does === equate to?
There's no overhead unless the types are different. From the ECMAScript specification: For the 'abstract equality comparison algorithm' (==) [11.9.3] 1. if Type(x) is different from Type(y), go to step 14. For the 'strict equality comparison algorithm' (===) [11.9.3] 1. if Type(x) is different from Type(y), return false. Steps 2-13 of both algorithms are exactly the same, so if the types match then there's no difference in the execution of each algorithm, and no overhead for the abstract algorithm. --rob On 8/2/07, Terry B <[EMAIL PROTECTED]> wrote: > > > known about this for awhile but since we are on the topic... there > has to be some over head of using == and != does anyone know for > sure the impact of the overhead... and does it matter of the type > > > On Aug 2, 6:21 am, "Ian Struble" <[EMAIL PROTECTED]> wrote: > > !== and === are identity operators. It is a good idea to use them > > instead of the equality operators (!= and ==) unless you know why you > > would want to use equality (and the possible type coercion) over > > identity. Probably the biggest gotcha with equality is with falsy > > values (false, 0, undefined, ""/empty string, null and NaN). The > > truthy / falsy issue is probably what bit you Rob. > > > > It may be worth reading a bit of Douglas Crockford's ideas about > > javascript if you are trying to figure out identity and equality > > operators: > > > >http://javascript.crockford.com/code.html > > > > And here is something about truthy and falsy: > > > > http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript#. > .. > > > > Ian > > > > On 8/2/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > > > > > I had a discussion on the use of the === and !== operators recently on > this > > > list, my opinion was, and still is, that unless you explicitly WANT to > allow > > > type conversion, you should be using these. Only use == and != if you > really > > > want type conversion. > > > > > It's bitten me once, although I can't for the life of me remember how, > but > > > it involved lots of in-depth debugging and head-scratching to find the > > > problem. I'm more wary now and think that these operators are the way > to go. > > > > > --rob > > > > > On 8/2/07, Sam Collett <[EMAIL PROTECTED]> wrote: > > > > > > I don't think many actually use !== (and when you would want to use > > > > it) and many sites that show usage of operators don't cover !== (but > > > > do have ===). > > > > > > 3 != '3' false > > > > 3 !== '3'true > > > > 3 == '3' true > > > > 3 === '3'false > > > > > > On Aug 1, 9:33 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote: > > > > > > I...cannot figure how what the heck === is. > > > > > > > I see that Jake answered your question, but just for next time... > > > > > > > You may have tried a Google search for "javascript ===" and been > > > > > disappointed to find it returned no useful results (because Google > seems > > > to > > > > > ignore the === in the search). > > > > > > > The key thing to know is that ===, like most special symbols in > > > JavaScript > > > > > such as + and -, is an operator. Now you can do a more productive > Google > > > > > search: > > > > > > >http://www.google.com/search?q=javascript+operators > > > > > > > This will help when you run into !== and wonder what the heck > *that* one > > > is. > > > > > :-) > > > > > > > -Mike > > > > > -- > > > Rob Desbois > > > Eml: [EMAIL PROTECTED] > > > Tel: 01452 760631 > > > Mob: 07946 705987 > > > "There's a whale there's a whale there's a whale fish" he cried, and > the > > > whale was in full view. > > > ...Then ooh welcome. Ahhh. Ooh mug welcome. > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: What does === equate to?
I had a discussion on the use of the === and !== operators recently on this list, my opinion was, and still is, that unless you explicitly WANT to allow type conversion, you should be using these. Only use == and != if you really want type conversion. It's bitten me once, although I can't for the life of me remember how, but it involved lots of in-depth debugging and head-scratching to find the problem. I'm more wary now and think that these operators are the way to go. --rob On 8/2/07, Sam Collett <[EMAIL PROTECTED]> wrote: > > > I don't think many actually use !== (and when you would want to use > it) and many sites that show usage of operators don't cover !== (but > do have ===). > > 3 != '3' false > 3 !== '3'true > 3 == '3' true > 3 === '3'false > > > On Aug 1, 9:33 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote: > > > I...cannot figure how what the heck === is. > > > > I see that Jake answered your question, but just for next time... > > > > You may have tried a Google search for "javascript ===" and been > > disappointed to find it returned no useful results (because Google seems > to > > ignore the === in the search). > > > > The key thing to know is that ===, like most special symbols in > JavaScript > > such as + and -, is an operator. Now you can do a more productive Google > > search: > > > > http://www.google.com/search?q=javascript+operators > > > > This will help when you run into !== and wonder what the heck *that* one > is. > > :-) > > > > -Mike > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Two words for Jquery
"My saviour" On 8/1/07, Tane Piper <[EMAIL PROTECTED]> wrote: > > > Bloody Brilliant! > > (I wonder how many other 2 word ways there are to describe jQuery) > > On 8/1/07, Richard D. Worth <[EMAIL PROTECTED]> wrote: > > Here here. > > > > - Richard > > > > > > On 8/1/07, kiwwwi <[EMAIL PROTECTED]> wrote: > > > > > > jQuery Rocks!! > > > > > > oh... possibly will add two more words; > > > > > > Thank you :) > > > > > > I'm not the best scripter and jquery has simply allowed me to > > > accomplish with my own personal site so much more than I would > > > have otherwise attempted. You people behind jquery are genious and > > > your work is great, thanks. > > > > > > Kiwwwi. > > > > > > > > > > > > > -- > Tane Piper > http://digitalspaghetti.tooum.net > > This email is: [ ] blogable [ x ] ask first [ ] private > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: It's all in the mind - the power of belief
That's ok - I believe that *I* have a real spiritual impact in my life, so I do! On 7/27/07, Gordon <[EMAIL PROTECTED]> wrote: > > > Sorry! I posted this into entirely the wrong group. Please ignore/ > delete. > > On Jul 27, 11:04 am, Gordon <[EMAIL PROTECTED]> wrote: > > Sources: > > > > > http://www.ehponline.org/members/2007/10286/10286.pdfhttp://news.bbc.co.uk/1/hi/health/6914492.stmhttp://www.theregister.co.uk/2007/07/25/mobile_sufferers_unaffected_b. > .. > > > > There are people who believe that signals from mobile phone masts are > > causing them ill health. Symptons include headaches, nausia, anxiety > > and lethargy. > > > > A double-blind study was undertaken to determine the validity of the > > claim that radio emissions from mobile phone masts can cause illness. > > Two groups of volenteers, some "mast sensitive" and a control group of > > "mast insensitive" individuals were exposed to mobile phone masts > > which were sometimes transmitting and sometimes turned off. Neither > > the mast-sensitives, the controls or the scientists observing the > > group knew when the mast was on and when it was off. > > > > The results show that the mast-sensitives consistantly reported > > significantly higher incidents of symptons than the control group when > > the mast was transmitting. However, they also reported more symptons > > than the control group when the mast was not transmitting and could > > therefore have no effect on them. > > > > While the symptons were quite real the mobile mast had to be ruled out > > as a cause because the symptons were reported whether or not the mast > > was active. > > > > "Belief is a very powerful thing," said Professor Elaine Fox, of the > > University of Essex, who led the three-year study. > > > > "If you really believe something is going to do you some harm, it > > will." > > > > The Placebo effect is already well documented. This research > > demonstrates teh reverse is also possible. If you believe something > > is harmful you will feel ill effects regardless of how much physical > > harm it is actually capable of causing. > > > > What does this have to do with religion? The answer is nothing > > directly, but it does demonstrate the power of belief. If you believe > > that mobile masts will make you ill you will feel ill. If you believe > > in God then God will have real spiritual impact in your life, > > regardless of whether or not he really exists. > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: " vs '
Sean, Attributes in (X)HTML don't need to be double-quoted, again single-quotes are equally valid there so '' and "" are effectively the same and both valid. I know you probably know, I just wanted to rephrase "It is easier to type an html string if you use single quotes:" in case :-) --rob On 7/26/07, Sean Catchpole <[EMAIL PROTECTED]> wrote: On 7/26/07, Mitchell Waite <[EMAIL PROTECTED]> wrote: > This going will make me sound really dumb but what is the difference between > using single quote versus double quotes in jQuery, e.g. Mitchell, the concept of single vs double quotes is more of a javascript question. The simple answer is that there's no difference really. It is easier to type an html string if you use single quotes: Single: var html = 'link'; Double: var html = "link'; But sometimes you might want to use double instead: Single: var str = 'I\'m in love'; Double: var str = "I'm in love"; So just use whichever you feel is better for the situation. Some people are used to single quotes representing characters, whereas others think html = double quotes, javascript = single quotes. ~Sean -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: datePicker plugin inline
Larry, Try the dynarch calendar at http://www.dynarch.com/projects/calendar/ It's not jQuery but does the job and can most likely be ported to jQuery if desired. --rob On 7/26/07, Larry Garfield <[EMAIL PROTECTED]> wrote: Thanks, Kelvin. (And sorry about misspelling your name. ) I was afraid you were going to say that. Unfortunately my timeframe allowed for this project is measured in hours, not weeks, so I doubt I'd even have time to try and figure out how to do it myself. Is there a method that you think would work that you haven't tested yet, or is it just a non-available feature? Is there some alternate plugin you can recommend? Or some possible alternate interface that's similar that could be accomplished with datePicker? Thanks. --Larry Garfield On Thu, 26 Jul 2007 14:12:14 +0100, Kelvin Luck <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm afraid that it is currently exactly as you describe. A date picker > calendar (with the paging etc) only exists as a popup and if you use > renderCalendar then you don't get paging or anything. > > The ability to use a date picker not in a popup is one of the two > additions I wanted to make before I stop calling the date picker v2 > "beta". Unfortunately I'm really busy at work at the moment and > realistically it will probably be a couple of weeks before I get a > chance to work on the date picker again. > > If you want to try and figure it out yourself then feel free and report > back on your progress, otherwise if you can wait I'll try and get it > done then, > > Cheers, > > Kelvin :) > > Larry Garfield wrote: >> Hello, jQuery. My apologies if this is a dupe; the first copy didn't > seem to >> go through. >> >> I'm working with Kevin Luck's datePicker plugin, v2[1], because it > seemed the >> least unsuited for what I was trying to do and I'm already using it >> elsewhere. What I'm trying to do is have an inline calendar grid rather > than >> a popup, and have that inline grid offer paging and multi-select >> abilities. Then on submit, grab all of the selected dates and serialize > them >> to a hidden field and submit. I'm replacing a YUI widget that did that, > but >> did so only on certain systems when it was in certain moods, making it > far >> too unreliable. >> >> According to the docs, I can get paging and multi-select in a popup >> easily[2]. I can also render an inline calendar instead[3]. What I > have >> found no documentation on and have been unable to do myself is get both > to >> happen at the same time. If I render my own calendar, it gets no > paging, no >> select ability at all; it's really just a static read-only display. > I've >> looked at the plugin's source, but haven't been able to find any > indication >> of what I'd need to copy out or reference directly in order to get >> the "picker" parts of datePicker. >> >> Any tips on how to have my picker and see it, too, would be most >> appreciated. Samples of working code would be even better. :-) Thanks. >> >> >> [1] http://kelvinluck.com/assets/jquery/datePicker/v2/demo >> [2] >> > http://kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiple.html >> [3] > http://kelvinluck.com/assets/jquery/datePicker/v2/demo/renderCalendar.html >> -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.