[jQuery] Re: Two search kriteria
Am 24.01.2010 21:45, schrieb John Arrowwood: console.log( $('#zip').val() ); Firebug shows: (An empty string) By the way, it was 'val' and not 'value', I was working from memory, and my memory was obviously a tad faulty. I usually don't use it, so... You don't use your memory? :-) > Anyway, if the console.log command outputs the correct value, check > to make sure that the back-end script is being called. If not, we > will need more details. What details do you need? jQuery 1.2.6 jQuery Autocomplete plugin 1.1 Firefox 3.5 on Debian Lenny Apache 2.2.3 on Debian Etch Best regards -- Frank Becker
[jQuery] Re: Two search kriteria
Give your Zip field an ID, then use $('#zip').value() instead of form.ZIP.value. Or maybe it's .value without parenthesis, I don't remember, and I'm not in the mood to go look it up for you. :) But bottom line, don't use 'form.ZIP'. That's the part that isn't working. Hi John, The input-field for the zip-code has the id zip already. Unfortunately this doesn't work. $("#street").autocomplete('search.php?what=street& add='+$('#zip').value(), { The script search.php isn't called. Nothing happens. The other possibility also doesn't work $("#street").autocomplete('search.php?what=street& add='+$('#zip').value, { In search.php the parameter "add" is undefined. You wrote, you are not in the mood to look for me. Where would you look? I can do it too. Best regards -- Frank Becker
[jQuery] Two search kriteria
Hi all, first of all I'm sorry if this posting is hard to read. English is not my mother tongue. I'm new to jQuery and jQuery-Autocomplete. I want to create an "intelligent" input form like Name: ZIP: ___ City: Street: _ If the ZIP-code is entered the city is filled automatically. That works. What I want is an autocompletion for street. In my database I have a list of all streets and the appropriate ZIP-codes e.g. 34128 / A-Road 34128 / B-Road 34128 / B-Street 34128 / C-Street If the ZIP-Code is 34128 and the first key pressed in the street-field is a "B", then only B-Road and B-Street should be shown in the autocomplete list. I have the following code fragment, taken from the demo (json.html) and adapted to fit my needs. $("#street").autocomplete('search.php?what=street&add='+$('#zip').val(), { ... search.php receives $_GET[q] the input of the user, in $_GET[what] what to search for (street, ZIP, ...) and in $_GET[add] is stored an additional parameter (ZIP in this case). The problem is, that I cannot send the value of the ZIP-code to search.php. I tried with the example above and with $("#street").autocomplete('search.php?what=street&add='+form.ZIP.value, { ... In this case, the additional parameter $add contains form.ZIP.value and not 34128. If I write $("#street").autocomplete('search.php?what=street&add=34128', { ... everything works fine. Thank you in advance for your help and hava a nice weekend. -- Frank Becker
[jQuery] Re: Go through XML nodes only 1 level deep
I just checked the headers and they seem to be outputting correctly. Date: Fri, 08 Jan 2010 13:47:32 GMT Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.6(2007-09-24) mod_ssl/2.2.8 OpenSSL/0.9.8g X-Powered-By: PHP/5.2.4-2ubuntu5.6 Content-Length: 454 Keep-Alive: timeout=15, max=98 Connection: Keep-Alive Content-Type: text/xml 200 OK
[jQuery] Re: Go through XML nodes only 1 level deep
Well the xml file is not on my server, but I'll try to shoot them an email and let them know, they should set the headers. On Jan 7, 4:44 pm, Jules wrote: > As suggested by Steven, set the ContentType to "text/xml". I don't > know how to do it in php, but here is the snipped from data source in > c# . > > StringBuilder sb = new StringBuilder(); > sb.Append(""); > sb.Append(""); > sb.Append("74.125.45.100"); > sb.Append("OK"); > sb.Append("US"); > sb.Append("United States"); > sb.Append("06"); > sb.Append("California"); > sb.Append("Mountain View"); > sb.Append("94043"); > sb.Append("37.4192"); > sb.Append("-122.057"); > sb.Append("-8"); > sb.Append("-8"); > sb.Append("-7"); > sb.Append(""); > > Response.Clear(); > Response.ContentType = "text/xml"; > Response.Write(sb.ToString()); > Response.End(); > > On Jan 8, 2:42 am, Frank Peterson wrote: > > > That works in IE8, but in FF 3.5.3 I get undefined in the alertbox. > > I've disabled adblock and flashblock, so its not those interfering. I > > dont get anything in the error console either. > > > The code I had posted earlier doesn't work in FF 3.53 either. I'm > > accessing it by running it on my desktop with this as the URL > > file:///c:/xampplite/htdocs/DEVELOPMENT/geolocate.htm > > but even when I access it via a decent URL I still get undefined in > > FFhttp://localhost/DEVELOPMENT/geolocate.htm > > > On Jan 6, 10:13 pm, Jules wrote: > > > > Ahah, too much stale eggnog. > > > > var option = { > > > error: function(request, status, error) { > > > alert(error); > > > }, > > > success: function(data, status) { > > > > var xml = $(data); > > > alert(xml.find('City').text()); > > > }, > > > dataType: "xml", > > > type: "GET", > > > url: "your url here" > > > }; > > > > $.ajax(option); > > > > This code works for me. > > > > On Jan 7, 2:50 pm, Steven Yang wrote: > > > > > just making sure > > > > > you are not able to parse the xml at all right? > > > > i believe for IE you have to make sure you server returns the correct > > > > content type like text/xml to client inorder for you to parse > > > > > hope this help > > > > > On Thu, Jan 7, 2010 at 9:30 AM, Jules wrote: > > > > > For some reason, it works on firefox (3.5.6) and doesn't work in ie > > > > > 6.0 and 8.0 > > > > > > On Jan 7, 6:39 am, Frank Peterson wrote: > > > > > > I'm grabbing an XML file with jQuery like this: > > > > > > > $(document).ready(function(){ > > > > > > $.ajax({ > > > > > > type: "GET", > > > > > > url: "http://ipinfodb.com/ip_query.php?ip=74.125.45.100";, > > > > > > dataType: "xml", > > > > > > success: function(xml) { > > > > > > //$(xml).find().each(function(){ > > > > > > var city = $(xml).find("City").text(); > > > > > > /* > > > > > > $('').html > > > > > > (''+title+'').appendTo('#page-wrap'); > > > > > > $(this).find('desc').each(function(){ > > > > > > var brief = $(this).find('brief').text(); > > > > > > var long = $(this).find('long').text(); > > > > > > $(' > > > > > class="brief">').html(brief).appendTo > > > > > > ('#link_'+id); > > > > > > $(' > > > > > class="long">').html(long).appendTo > > > > > > ('#link_'+id); > > > > > > }); > > > > > > */ > > > > > > alert(city) > > > > > > //}); > > > > > > } > > > > > > }); > > > > > > > }); > > > > > > > The XML file looks like this > > > > > > > > > > > > > > > > > > 74.125.45.100 > > > > > > OK > > > > > > US > > > > > > United States > > > > > > 06 > > > > > > California > > > > > > Mountain View > > > > > > 94043 > > > > > > 37.4192 > > > > > > -122.057 > > > > > > -8 > > > > > > -8 > > > > > > -7 > > > > > > > > > > > > > But I can't get it to pull the data out.
[jQuery] Re: Go through XML nodes only 1 level deep
That works in IE8, but in FF 3.5.3 I get undefined in the alertbox. I've disabled adblock and flashblock, so its not those interfering. I dont get anything in the error console either. The code I had posted earlier doesn't work in FF 3.53 either. I'm accessing it by running it on my desktop with this as the URL file:///c:/xampplite/htdocs/DEVELOPMENT/geolocate.htm but even when I access it via a decent URL I still get undefined in FF http://localhost/DEVELOPMENT/geolocate.htm On Jan 6, 10:13 pm, Jules wrote: > Ahah, too much stale eggnog. > > var option = { > error: function(request, status, error) { > alert(error); > }, > success: function(data, status) { > > var xml = $(data); > alert(xml.find('City').text()); > }, > dataType: "xml", > type: "GET", > url: "your url here" > }; > > $.ajax(option); > > This code works for me. > > On Jan 7, 2:50 pm, Steven Yang wrote: > > > just making sure > > > you are not able to parse the xml at all right? > > i believe for IE you have to make sure you server returns the correct > > content type like text/xml to client inorder for you to parse > > > hope this help > > > On Thu, Jan 7, 2010 at 9:30 AM, Jules wrote: > > > For some reason, it works on firefox (3.5.6) and doesn't work in ie > > > 6.0 and 8.0 > > > > On Jan 7, 6:39 am, Frank Peterson wrote: > > > > I'm grabbing an XML file with jQuery like this: > > > > > $(document).ready(function(){ > > > > $.ajax({ > > > > type: "GET", > > > > url: "http://ipinfodb.com/ip_query.php?ip=74.125.45.100";, > > > > dataType: "xml", > > > > success: function(xml) { > > > > //$(xml).find().each(function(){ > > > > var city = $(xml).find("City").text(); > > > > /* > > > > $('').html > > > > (''+title+'').appendTo('#page-wrap'); > > > > $(this).find('desc').each(function(){ > > > > var brief = $(this).find('brief').text(); > > > > var long = $(this).find('long').text(); > > > > $('').html(brief).appendTo > > > > ('#link_'+id); > > > > $('').html(long).appendTo > > > > ('#link_'+id); > > > > }); > > > > */ > > > > alert(city) > > > > //}); > > > > } > > > > }); > > > > > }); > > > > > The XML file looks like this > > > > > > > > > > > > 74.125.45.100 > > > > OK > > > > US > > > > United States > > > > 06 > > > > California > > > > Mountain View > > > > 94043 > > > > 37.4192 > > > > -122.057 > > > > -8 > > > > -8 > > > > -7 > > > > > > > > > But I can't get it to pull the data out.
[jQuery] Go through XML nodes only 1 level deep
I'm grabbing an XML file with jQuery like this: $(document).ready(function(){ $.ajax({ type: "GET", url: "http://ipinfodb.com/ip_query.php?ip=74.125.45.100";, dataType: "xml", success: function(xml) { //$(xml).find().each(function(){ var city = $(xml).find("City").text(); /* $('').html (''+title+'').appendTo('#page-wrap'); $(this).find('desc').each(function(){ var brief = $(this).find('brief').text(); var long = $(this).find('long').text(); $('').html(brief).appendTo ('#link_'+id); $('').html(long).appendTo ('#link_'+id); }); */ alert(city) //}); } }); }); The XML file looks like this 74.125.45.100 OK US United States 06 California Mountain View 94043 37.4192 -122.057 -8 -8 -7 But I can't get it to pull the data out.
[jQuery] Re: find the row nuber clicked of the item list
Thanks a lot! This is what I was looking for On Oct 23, 12:14 am, MorningZ wrote: > Check out ".index()": > > http://docs.jquery.com/Core/index > > the example is just like what you want, except they are 's > > On Oct 22, 4:21 pm, frank wrote: > > > Hello I'm just a starter and I'm looking for a function I can't find. > > > What I want: > > I want the row number of the row i clicked of the item list. > > > For instance I click on third row then I want that var i returns 2. > > > My code: > > > > > > > > > > > $(document).ready(function(){ > > $("ls").click(function () { > > var i = $( what must i type to get the clicked row > > number here??); > > console.log(i); > > }); > > }); > > > > > > > > > > First > > Second > > Third > > Forth > > > > > > > > > Best Regards > > Frank Pauw
[jQuery] find the row nuber clicked of the item list
Hello I'm just a starter and I'm looking for a function I can't find. What I want: I want the row number of the row i clicked of the item list. For instance I click on third row then I want that var i returns 2. My code: $(document).ready(function(){ $("ls").click(function () { var i = $( what must i type to get the clicked row number here??); console.log(i); }); }); First Second Third Forth Best Regards Frank Pauw
[jQuery] [autocomplete] having issues matching when there are single quotes or apostrophes
Hi, This is only happening in the JSON+emails example form the demos. If I insert john'doe into the array and I start typing doe, autocomplete will find john'doe. However if I start deleting characters (from back to front, starting from letter e) autocomplete will not show any matches until I've deleted past the apostrophe/single quote. On the other hand, in the birds example, if my match was Cetti's Warbler and I start deleting characters, autocomplete will continue to find matches as I keep removing characters. This bird example is similar to the emails example except it does not use JSON. So is the issue related to JSON? TIA
[jQuery] [autocomplete] can't get json demo to work
Hi I'm trying to set up the json example that comes in the demo zip file (json.html + emails.php). When I test it locally every thing works great however when I move emails.php to my site (hosted by godaddy) it stops working; i.e. nothing gets pulled in when I start typing in the textbox. godaddy is running php 5.2.8 with json module 1.2.1 enabled. TIA
[jQuery] [autocomplete] auto complete based on additional input value
I'm using one of the examples from the demo files as a template. Basically I'd like to auto suggest hospitals based on the zip code that's entered from another input. Can someone recommend how do accomplish this? TIA This is the local data set: var hospitals = [ { name: "hospital 1", zip: "1"}, { name: "hospital 2", zip: "2"}, { name: "hospital 3", zip: "3"}, { name: "hospital 4", zip: "4"}, { name: "hospital 5",zip: "5"}, ... and here's the autocompleter: $(document).ready(function(){ $("#example").autocomplete(hospitals, { matchContains: "word", max: 8, width: 500, scrollHeight: 300, extraParams: { return "1"; }, formatItem: function(row, i, max) { return row.name + " (zip code: " + row.zip + ")"; }, formatMatch: function(row, i, max) { return row.name; }, formatResult: function(row) { return row.name; } }); });
[jQuery] Event Load() ??
Hello, I'm with a doubt in jquery, I am using the function load () to call another page, but after I loaded this page, I can not use the id of another page. because the function $('#btnCadastrarCliente').click does not work? [index.php] $(document).ready(function(){ $('#btnCadastrarCliente').click(function() { alert("ok"); }); $('#novoCliente').click(function() { mostrarCarregando(); $('#conteudo').load("cadastroCliente.php"); }); }); Cliente Novo Cliente [cadastroCliente.php]
[jQuery] Event Load() ??
Hello, I'm with a doubt in jquery, I am using the function load () to call another page, but after I loaded this page, I can not use the id of another page. because the function $('#btnCadastrarCliente').click does not work? [index.php] $(document).ready(function(){ $('#btnCadastrarCliente').click(function() { alert("ok"); }); $('#novoCliente').click(function() { mostrarCarregando(); $('#conteudo').load("cadastroCliente.php"); }); }); Cliente Novo Cliente [cadastroCliente.php]
[jQuery] jquery parse xml can't run ie7?
hello function ParseXml(xml){ var xml=''; xml+=''; xml+=' '; alert(xml); $(xml).find("result").each(function() { var id=$(this).children("company"); alert(id.text()); }); } above code in chrome, firefox run normally, ie7 cant' alert(id.text ()) why?'; xml+=' 33 '; xml+=' 222
[jQuery] Re: Optimizing Easiest Tooltip
Hi Karl, I got it working in the end. I'm not sure why but $('table').simpletip ('a') just wouldn't work, whereas $('.adminTable').simpletip('a') did ("adminTable" being the class applied to my giant table). It's unclear why the latter would work and not the former, but at least it's all fine now. Again, thanks for your help! Frank. On Dec 7, 4:09 am, Karl Swedberg <[EMAIL PROTECTED]> wrote: > Hi Frank, > > Let me know how it goes with your testing. > > In the meantime, I converted the script to a plugin, so after you > include it, you can just do this: > > $('table').simpletip('a'); This will display a tooltip for every link > within the table element, using event delegation. > > It also has some options, so you could do something like this: > > $('table').simpletip('a.tooltip', {opacity: 0.6, contentAttrs: > ['title', 'href']}); > > This will display a tooltip for every link with class="tooltip" within > a table and set the opacity to 60% and show the link's title and href > in the tooltip. > > Here is a demo:http://plugins.learningjquery.com/simpletip/demo/ > > And here is the plugin > code:http://plugins.learningjquery.com/simpletip/simpletip.js > > Glad you like the website! > > --Karl > > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Dec 6, 2008, at 3:31 PM, Frank wrote: > > > > > Hm, how very odd indeed. There must something else on my page > > conflicting with it then. I'll strip it to the barebones and work my > > way back up. Thanks for all the help so far! > > > May I also say that your website (learningjquery.com) has been an > > invaluable font of knowledge for jQuery, as well as both of your > > books. > > > Frank. > > > On Dec 5, 8:08 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > >> Ok, I dropped your table into my page, and it seems to work fine. > > >>http://test.learningjquery.com/very-simple-tooltip.html > > >> --Karl > > >> > >> Karl Swedbergwww.englishrules.comwww.learningjquery.com > > >> On Dec 5, 2008, at 11:45 AM, Frank wrote: > > >>> Also, I just realised that putting "title"s on TDs is a silly idea, > >>> and completely invalid. But I tried it with a direct copy of your > >>> script after putting actual links in, but still only get empty > >>> tooltips. Here is an example row: > > >>> > >>> >>> class='tooltip'>Abridged Title > >>> - > >>> - > >>> - > >>> - > > >>> - > >>> - > >>> - > >>> - > >>> - > >>> - > >>> - > >>> Y > >>> > > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> 2 > >>> 06:01, 05:55 > >>> Y > > >>> - > >>> >>> class='tooltip'>Lorem ipsum dolor sit... > >>> > >>> > > >>> On Dec 5, 4:29 pm, Frank <[EMAIL PROTECTED]> wrote: > >>>> Simply exchanging "A" for "TD" in your script didn't work (that > >>>> would > >>>> have been too easy :), it only pops up empty tooltips. I'll > >>>> continue > >>>> to play with it.
[jQuery] Re: Optimizing Easiest Tooltip
Hm, how very odd indeed. There must something else on my page conflicting with it then. I'll strip it to the barebones and work my way back up. Thanks for all the help so far! May I also say that your website (learningjquery.com) has been an invaluable font of knowledge for jQuery, as well as both of your books. Frank. On Dec 5, 8:08 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > Ok, I dropped your table into my page, and it seems to work fine. > > http://test.learningjquery.com/very-simple-tooltip.html > > --Karl > > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Dec 5, 2008, at 11:45 AM, Frank wrote: > > > > > Also, I just realised that putting "title"s on TDs is a silly idea, > > and completely invalid. But I tried it with a direct copy of your > > script after putting actual links in, but still only get empty > > tooltips. Here is an example row: > > > > > > class='tooltip'>Abridged Title > > - > > - > > - > > - > > > - > > - > > - > > - > > - > > - > > - > > Y > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 2 > > 06:01, 05:55 > > Y > > > - > > > class='tooltip'>Lorem ipsum dolor sit... > > > > > > > On Dec 5, 4:29 pm, Frank <[EMAIL PROTECTED]> wrote: > >> Simply exchanging "A" for "TD" in your script didn't work (that would > >> have been too easy :), it only pops up empty tooltips. I'll continue > >> to play with it.
[jQuery] Re: Optimizing Easiest Tooltip
Also, I just realised that putting "title"s on TDs is a silly idea, and completely invalid. But I tried it with a direct copy of your script after putting actual links in, but still only get empty tooltips. Here is an example row: Abridged Title - - - - - - - - - - - Y 2 06:01, 05:55 Y - Lorem ipsum dolor sit... On Dec 5, 4:29 pm, Frank <[EMAIL PROTECTED]> wrote: > Simply exchanging "A" for "TD" in your script didn't work (that would > have been too easy :), it only pops up empty tooltips. I'll continue > to play with it.
[jQuery] Re: Optimizing Easiest Tooltip
Simply exchanging "A" for "TD" in your script didn't work (that would have been too easy :), it only pops up empty tooltips. I'll continue to play with it.
[jQuery] Re: Optimizing Easiest Tooltip
Hi Karl, Thanks for your comprehensive reply! I'll give that a go as soon as I can. I need the tooltip for TDs rather than links but that shouldn't be hard to modify I hope. Here was my attempt at modifying the original script by the way, which gave very, very strange results. :) $(document).ready(function(){ xOffset = 10; yOffset = 20; var t; $(".adminTable").hover(function(e){ var $tgt = $(e.target); if($tgt.hasClass("tooltip")) { t = $tgt.attr("title"); $tgt.attr("title", ""); $("body").append(""+ t +""); $("#tooltip") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px") .fadeIn("fast"); } }, function(e){ var $tgt = $(e.target); $tgt.attr("title", t); $("#tooltip").remove(); }); }); Frank. On Dec 5, 2:58 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > Hi Frank, > > Just for kicks, I cranked out my own very simple tooltip script. It > isn't a plugin. Yet. But it gets the job done. > > Basically, it binds the event listeners to a table (since that's what > you said you had) and uses event delegation to look for any links > within the table. The tooltip content comes from the title attribute. > It assumes that you don't have elements nested more than one deep > within a link, so it would work for yes > but not for no. > > Hopefully it'll make sense to you, but if it doesn't, let me know and > I'll try to explain whatever you're having problems with. > > Here is a link to a demo page: > > http://test.learningjquery.com/very-simple-tooltip.html > > And here is the code: > > $(document).ready(function() { > var $vsTip = $('').css('opacity', > '0.6').hide().appendTo('body'); > > var tgt, > vsTip = { > link: function(e) { > var t = e.target.nodeName === 'A' ? > e.target : > e.target.parentNode.nodeName === 'A' && e.target.parentNode; > return t || false; > }, > xOffset: 10, > yOffset: 20, > contents: '' > }; > $('table').mouseover(function(event) { > if (vsTip.link(event)) { > tgt = vsTip.link(event); > vsTip.contents = tgt.title; > tgt.title = ''; > $vsTip.css({ > left: event.pageX + vsTip.xOffset, > top: event.pageY + vsTip.yOffset > }).html(vsTip.contents).show(); > } > }).mouseout(function(event) { > if (vsTip.link(event)) { > tgt = vsTip.link(event); > tgt.title = vsTip.contents; > $vsTip.hide(); > } > }).mousemove(function(event) { > if (vsTip.link(event)) { > $vsTip.css({ > left: event.pageX + vsTip.xOffset, > top: event.pageY + vsTip.yOffset > }); > > } > }); > > }); > > --Karl > > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Dec 5, 2008, at 5:36 AM, Frank wrote: > > > > > Hi there, > > > I've got a page with a very big table (unfortunately breaking it up > > isn't an option), and I wanted to use the handy tooltip script here: > > >http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using... > > > This results in just over 2,000 cells with tooltips, and such over > > 2,000 listeners. When I refresh the page, I get an "Unresponsive > > Script" error in Firefox, which isn't suprising. > > > Could someone suggest a way I could modify the above script to use > > fewer listeners? Maybe through event delegation? I'm still quite new > > to jQuery, so any advice is welcome! > > > Frank.
[jQuery] Optimizing Easiest Tooltip
Hi there, I've got a page with a very big table (unfortunately breaking it up isn't an option), and I wanted to use the handy tooltip script here: http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery This results in just over 2,000 cells with tooltips, and such over 2,000 listeners. When I refresh the page, I get an "Unresponsive Script" error in Firefox, which isn't suprising. Could someone suggest a way I could modify the above script to use fewer listeners? Maybe through event delegation? I'm still quite new to jQuery, so any advice is welcome! Frank.
[jQuery] Re: Load a div from external website (domain) and stick it on my page
Ok, thank you. I feel more comfortable doing the parsing in Python than in JavaScript anyway. I'll leave JavaScript off this job completely. On Nov 13, 12:59 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 13, 2008 at 7:34 AM, Frank Malina @ vizualbod.com < > > [EMAIL PROTECTED]> wrote: > > > Hi all, > > I'd want to grab a div from external domain and stick in a div on my > > site. > > > Is it doable? Won't there be any cross domain issues? > > There will indeed. You'll have to use a proxy script on your domain to fetch > the page from an external domain. > > - Richard
[jQuery] Load a div from external website (domain) and stick it on my page
Hi all, I'd want to grab a div from external domain and stick in a div on my site. Is it doable? Won't there be any cross domain issues?
[jQuery] Re: Accordion
Hi Olaf, The accordion is closed when the page loads as I had wanted. The following is what is in the head section to do that. I appreciate your response as that is what got me on the right path. active: true, alwaysOpen: false, animated: 'easeslide', autoheight: false Thanks again, Frank On Nov 2, 2008, at 10:16 PM, Frank J Ryan wrote: Hi Olaf, I'll try that. Thanks, Frank On Nov 2, 2008, at 5:48 PM, Olaf Bosch wrote: Frankjr schrieb: Hi all, I am a js idiot, but I did manage to get a page up and working. My problem is that I want all accordions closed initially and can't seem to find the solution. (The first one is always extended.) I thought 'all closed' was the default but apparently not. Here is the test url: <http://www.pagesetter.com/Rad/faq.html> try active: false, in the options -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de/ http://ohorn.info/ http://www.akitafreund.de/ ---
[jQuery] Re: Accordion
Hi Olaf, I'll try that. Thanks, Frank On Nov 2, 2008, at 5:48 PM, Olaf Bosch wrote: Frankjr schrieb: Hi all, I am a js idiot, but I did manage to get a page up and working. My problem is that I want all accordions closed initially and can't seem to find the solution. (The first one is always extended.) I thought 'all closed' was the default but apparently not. Here is the test url: <http://www.pagesetter.com/Rad/faq.html> try active: false, in the options -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de/ http://ohorn.info/ http://www.akitafreund.de/ ---
[jQuery] Re: superfish shadow width problem
I had to nudge some other style to get everything working. Try this ul.sf-menu li li.sfHover ul { left: 12em; /* match ul width */ } ul.sf-menu li li li.sfHover ul { left: 12em; /* match ul width */ } and I also had to do this to get the shadow placed back in the right spot for IE6 .sf-shadow ul { background:transparent url('../images/shadow.png') no-repeat bottom right; padding: 0 12px 9px 0; p\adding:0; } Play with those style classes until you get something that works. On Jul 22, 12:58 pm, seezee <[EMAIL PROTECTED]> wrote: > i'm using the latest version of superfish (1.4.7). i have both > horizontal and vertical menus on the same page. i've adjusted the > parameters on the vertical-superfish.css for a wider menu (12em > instead of the default 10em) and i've got everything working except > the drop shadow, which stubbornly remains at a 10em width in firefox 3 > & ie7 (curiously, the non-transparent shadow displays "correctly" in > ie6) . anybody out there have any ideas? > > let me know if you want any documentation; in the meantime, the page > is athttp://smbwebmarketing.com/okgba > > thanks in advance, > > --cz
[jQuery] Re: superfish shadow width problem
I had a similar issue. Try adjusting these styles. ul.sf-menu li li.sfHover ul { left:12em; /* match ul width */ } ul.sf-menu li li li.sfHover ul { left:12em; /* match ul width */ } And I also had to add this css hack to get the shadow back in the right place for IE6 .sf-shadow ul { background:transparent url('../images/shadow.png') no-repeat bottom right; padding: 0 12px 9px 0; p\adding:0; }
[jQuery] Superfish feature request - disabled items and menus
I'd like to see an option or method where I can disable a menu, sub menu, and menu items. $("ul.sf-menu").superfishDisabled(); Also, I added these lines to the return this.each function to give me more control over li hovers in IE var $li = $('li', this); $li.each(function(){ $(this).hover(function(){$ (this).addClass(o.hoverClass)},function(){$ (this).removeClass(o.hoverClass)}) });
[jQuery] Question about accordion.
Hi, I’ve a question about accordion. I have checked the Doc and some Demo but I don’t see how I can do this. Some of my section of my accordion have a realy big content and sometimes when a user click on a section with this amount of content, he loses the beginning of the text because the section header will join the other sections in the move. Example (Made with tutorial by Steve Krueger) : http://www.francoismartel.net/test/AccordionJQ/test.htm Is there a way to automatically move the navigation bar (of the Browser) so that the user is always positioned at the beginning of the text when he open a section with big content? Thanks.
[jQuery] Re: AJAX get method problem
I should have read the official FAQ first, though I wasn't expecting it to be answered in FAQ section... http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F problem solves, hope this helps others.
[jQuery] AJAX get method problem
I intend to have a poll page which user can switch between poll and result, triggered by clicking on a centain link, which is returned by GET method. now I am stuck because both function works on the first click, but when user try to click on the returned link, corresponding click event is not triggered, ie. poll -> result -> poll is broken on second step, and gives no javascript error. data returned is correct, so it should be something wrong with my code. $('#view_poll').click(function() {poll_id = $(this).attr("name"); poll_result(poll_id); return false;}); $('#goto_poll').click(function() {poll_id = $(this).attr("name"); poll_booth(poll_id); return false;}); function poll_result(poll_id) { if(!is_being_voted) { is_being_voted = true; $('#polls-' + poll_id + '-loading').fadeIn("slow"); $('#polls-' + poll_id + '-ans').fadeOut("normal",function () { datapassed = 'pollresult=' + poll_id; $.ajax( { url : polls_ajax_url, type : "GET", data : datapassed, dataType : "html", cache : false, error : function() { $('#polls-' + poll_id).append('Unexpected Error: Please reload this page and try again.'); }, success : function(d1) { $('#polls-' + poll_id + '-loading').fadeOut("slow"); $('#polls-' + poll_id + '- ans').empty().append(d1).fadeIn("normal"); is_being_voted = false; } } ); }); } else { alert(polls_text_wait); } }; function poll_booth(poll_id) { if(!is_being_voted) { is_being_voted = true; $('#polls-' + poll_id + '-loading').fadeIn("slow"); $('#polls-' + poll_id + '-ans').fadeOut("normal",function () { datapassed = 'pollbooth=' + poll_id; $.ajax( { url : polls_ajax_url, type : "GET", data : datapassed, dataType : "html", cache : false, error : function() { $('#polls-' + poll_id).append('Unexpected Error: Please reload this page and try again.'); }, success : function(d1) { $('#polls-' + poll_id + '-loading').fadeOut("slow"); $('#polls-' + poll_id + '- ans').empty().append(d1).fadeIn("normal"); is_being_voted = false; } } ); }); } else { alert(polls_text_wait); } };
[jQuery] SimpleModal Question
When I try to click a button with the SimpleModal Plugin it gives me the following error $('#basicModalContent').modal is not a function instead of showing the hidden div. http://www.w3.org/1999/xhtml";> $(document).ready(function () { $('#basic').click(function (e) { e.preventDefault(); $('#basicModalContent').modal( { overlay: "75", close: false }); }); }); You should see this text
[jQuery] Re: jquery code snippit improvement request
Jesus Christ?! Thanks for all the variations...AND explanations! Frank On 10/18/07, Michael Geary <[EMAIL PROTECTED]> wrote: > > > First, combine duplicate code into a single function: > > $(document).ready(function() { > zebra(); > $('th').click( zebra ); > }); > > function zebra() { > $('tbody.bevker tr:odd').removeClass(); > $('tbody.bevker tr:even').removeClass(); > $('tbody.bevker tr:odd').addClass('row0 odd'); > $('tbody.bevker tr:even').addClass('row1 even'); > return false; > } > > I also took the liberty of changing the indentation style slightly - > you're > using two levels of indentation where one would do (by giving the braces > their own separate indentation). Naturally you can do this any way you > want, > but I didn't see any benefit to the extra indents, so bear with me. :-) In > addition, I used spaces for indents instead of tabs. I actually do prefer > tabs, but in an email message the spaces sometimes work better. > > Next, use chaining to remove the duplicate $() selectors: > > function zebra() { > $('tbody.bevker tr:odd').removeClass().addClass('row0 odd'); > $('tbody.bevker tr:even').removeClass().addClass('row1 even'); > return false; > } > > Also, since you are completely replacing the class, it would be faster to > do > it in one call: > > function zebra() { > $('tbody.bevker tr:odd').attr( 'class', 'row0 odd' ); > $('tbody.bevker tr:even').attr( 'class', 'row1 even' ); > return false; > } > > Then, if there is only a single table you're working with, you can speed > up > the code a little by pulling out the common part of the selector: > > function zebra() { > var tbody = $('tbody.bevker')[0]; > $('tr:odd',tbody).attr( 'class', 'row0 odd' ); > $('tr:even',tbody).attr( 'class', 'row1 even' ); > return false; > } > > This would not work if you have multiple tables, but it looks like the > code > is already assuming a single table. > > You could also set both the even and odd row classes in a single pass. > This > would probably be even faster: > > function zebra() { > $('tbody.bevker tr').each( function( i ) { > $(this).attr( 'class', i % 2 ? 'row1 even' : 'row0 odd' ); > }); > return false; > } > > Or better yet, speed up that inner loop by using the DOM directly instead > of > .attr(): > > function zebra() { > $('tbody.bevker tr').each( function( i ) { > this.className = i % 2 ? 'row1 even' : 'row0 odd'; > }); > return false; > } > > I may have the even and odd reversed on the last two examples, but that's > easy to fix. > > -Mike > > > From: FrankTudor > > > > Here is a bit of code that on page load sets the alternating > > color of a table. > > > > Then there is a table sort tool that loads as well. The th > > (header) clicks cause the nice alternating line colors to > > sort as well. So I created this, which works perfect, but it > > looks clunky/repetitive.. > > > > I was thinking about wrapping an if statement in here > > somewhere, or maybe there is something else other people can think of. > > > > > > $(document).ready(function() > > { > > $('tbody.bevker tr:odd').removeClass(); > > $('tbody.bevker tr:even').removeClass(); > > $('tbody.bevker tr:odd').addClass('row0 odd'); > > $('tbody.bevker tr:even').addClass('row1 even'); > > > > $('th').click(function() > > { > > $('tbody.bevker tr:odd').removeClass(); > > $('tbody.bevker tr:even').removeClass(); > > $('tbody.bevker tr:odd').addClass('row0 odd'); > > $('tbody.bevker tr:even').addClass('row1 even'); > > return false; > > } > > ); > > } > > ); > > > >
[jQuery] Re: jquery code snippit improvement request
P.S. Here is what my final script looks like. After the below function example, I started to get lost in obscurity. $(document).ready(function() { zebra(); $('th').click( zebra ); function zebra() { $('tbody.bevker tr:odd').removeClass().addClass('row0 odd'); $('tbody.bevker tr:even').removeClass().addClass('row1 even'); return false; } } );
[jQuery] Re: Is this valid JSON?
Thanks, I was wondering about those square brackets [ ] at the start and end, I had never seen JSON start with those before
[jQuery] Is this valid JSON?
[ { "ads": true, "content_slug": "just-some-title" } ]
[jQuery] Re: simple browser check (need help)
Works like a charm! Thanks Wizzud :) Frank On 10/1/07, Wizzud <[EMAIL PROTECTED]> wrote: > > > > if(!$.browser.msie){ > .//bug out > } > > > FrankTudor wrote: > > > > > > I have a tool that only operates under IE > > > > So all other browser users get an alert here is my code...but it > > doesn't work... > > > > Can someone get me straightened out? > > > > > > $(document).ready(function() > > { > > if($.browser.[safari, opera, mozilla]) > > { > > $( function() { alert("You must use Internet > Explorer to view the > > links at this time!"); > > } > > ); > > } > > ); > > > > > > > > > > -- > View this message in context: > http://www.nabble.com/simple-browser-check-%28need-help%29-tf4551358s27240.html#a12988940 > Sent from the jQuery General Discussion mailing list archive at Nabble.com > . > >
[jQuery] Re: need a simple jquery alert or prompt example with ok or cancel choices
I got it figured out...thanks for the reply On 10/1/07, Benjamin Sterling <[EMAIL PROTECTED]> wrote: > > Frank, are you using http://trentrichardson.com/Impromptu/? > > Or are using using the basic prompt command? > > If you are using the plugin, you need to set up a call back that will > handle you true, false. > > If you are using the prompt command, I would suggest you use the confirm > instead (http://www.tizag.com/javascriptT/javascriptconfirm.php) > > On 10/1/07, FrankTudor <[EMAIL PROTECTED]> wrote: > > > > > > I have a jquery script that gives the user a prompt and a choice to > > make sure they want to delete a value from a datasource. > > > > Here is my code... > > > > It prompts funny...and it goes ahead and processes anyways even if you > > select cancel.. > > > > Can someone fix me up here? > > > > > > $(document).ready(function() > > { > > $("a").click(function() > > { > > prompt("Are you sure you want to > > delete?",{buttons: > > {Ok:true,Cancel:false}}); > > } > > ); > > } > > ); > > > > > > Thanks, > > Frank > > > > > > > -- > Benjamin Sterling > http://www.KenzoMedia.com > http://www.KenzoHosting.com > http://www.benjaminsterling.com
[jQuery] Re: ANNOUNCEMENT: Chili 1.9 much faster
Thanks Ben... That would be awesome! On 9/27/07, Benjamin Sterling <[EMAIL PROTECTED]> wrote: > > Franks, > I put something for Dreamweaver a while ago, I think we were on 1.1.1 at > that time, let me see if I can find those files and will hit you up off list > if I find them. > > On 9/27/07, Frank Tudor <[EMAIL PROTECTED]> wrote: > > > > I like this idea, and pardon me if this has been asked before, but is > > there a code higlighter for jQuery that can be used in dreamweaver? > > > > Code anticipation would score bonus points. > > > > Frank > > > > On 9/27/07, Steve Blades <[EMAIL PROTECTED]> wrote: > > > > > > Looks outstanding. Now, if it only had a syntax highlight library for > > > ColdFusion;). > > > > > > On 9/27/07, Andrea Ercolino < [EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > Very simple. Look at the new example posted in > > > > http://noteslog.com/post/chili-19-released-today/ : It's what you're > > > > looking > > > > for. > > > > > > > > But Chili 1.9 is very fast, it colorize 3000 lines in less than 1 > > > > second !! > > > > Maybe there is no need for the extra button... > > > > > > > > > > > > Guy Fraser-2 wrote: > > > > > > > > > > > > > > > Andrea Ercolino wrote: > > > > >> Chili is now much faster than before. Try it! > > > > >> > > > > > > > > > > Is it possible to configure Chili so that if a script is bigger > > > > than a > > > > > certain length, instead of automatically highlighting it a link is > > > > > displayed above it to manually trigger the highlighting? > > > > > > > > > > > > > > > > > > -- > > > > View this message in context: > > > > http://www.nabble.com/ANNOUNCEMENT%3A-Chili-1.9-much-faster-tf4524829s15494.html#a12922338 > > > > Sent from the JQuery mailing list archive at Nabble.com. > > > > > > > > > > > > > > > > > -- > > > Steve "Cutter" Blades > > > Adobe Certified Professional > > > Advanced Macromedia ColdFusion MX 7 Developer > > > _ > > > http://blog.cutterscrossing.com > > > --- > > > The Past is a Memory > > > The Future a Dream > > > But Today is a Gift > > > That's why they call it > > > The Present > > > > > > > > > -- > Benjamin Sterling > http://www.KenzoMedia.com > http://www.KenzoHosting.com > http://www.benjaminsterling.com
[jQuery] Re: ANNOUNCEMENT: Chili 1.9 much faster
I like this idea, and pardon me if this has been asked before, but is there a code higlighter for jQuery that can be used in dreamweaver? Code anticipation would score bonus points. Frank On 9/27/07, Steve Blades <[EMAIL PROTECTED]> wrote: > > Looks outstanding. Now, if it only had a syntax highlight library for > ColdFusion;). > > On 9/27/07, Andrea Ercolino < [EMAIL PROTECTED]> wrote: > > > > > > > > Very simple. Look at the new example posted in > > http://noteslog.com/post/chili-19-released-today/ : It's what you're > > looking > > for. > > > > But Chili 1.9 is very fast, it colorize 3000 lines in less than 1 second > > !! > > Maybe there is no need for the extra button... > > > > > > Guy Fraser-2 wrote: > > > > > > > > > Andrea Ercolino wrote: > > >> Chili is now much faster than before. Try it! > > >> > > > > > > Is it possible to configure Chili so that if a script is bigger than a > > > > > certain length, instead of automatically highlighting it a link is > > > displayed above it to manually trigger the highlighting? > > > > > > > > > > -- > > View this message in context: > > http://www.nabble.com/ANNOUNCEMENT%3A-Chili-1.9-much-faster-tf4524829s15494.html#a12922338 > > Sent from the JQuery mailing list archive at Nabble.com. > > > > > > > -- > Steve "Cutter" Blades > Adobe Certified Professional > Advanced Macromedia ColdFusion MX 7 Developer > _ > http://blog.cutterscrossing.com > --- > The Past is a Memory > The Future a Dream > But Today is a Gift > That's why they call it > The Present
[jQuery] Re: input type text toUpperCase() jquery question
ok thanks for everyone clearing this up for me. On 9/26/07, Joan Piedra <[EMAIL PROTECTED]> wrote: > > Just use the text-transform rule, and then process your string and convert > it to uppercase via server-side. Or you could also transform it before you > send the data with the onsubmit event. > > On 9/26/07, Karl Swedberg <[EMAIL PROTECTED]> wrote: > > > > It's CSS 2. But it should be this: > > input { > > text-transform: uppercase; > > } > > > > However, that will only change the way the text is displayed, not the > > actual case of the text itself. > > > > --Karl > > _ > > Karl Swedberg > > www.englishrules.com > > www.learningjquery.com > > > > > > > > On Sep 26, 2007, at 9:32 AM, Danjojo wrote: > > > > > > omgosh.. I did not even know CSS could do that! > > > > Is that CSS-2? or -3? > > > > > > On Sep 26, 9:18 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > > > > Why would you even want to use Javascript for this? Just use CSS: > > > > input { > > text-decoration: uppercase; > > > > } > > > > _ > > > > From: jquery-en@googlegroups.com > > [mailto:jquery-en@googlegroups.com] > > On > > Behalf Of Frank Tudor > > Sent: Tuesday, September 25, 2007 12:30 PM > > To: jQuery (English) > > Subject: [jQuery] Re: input type text toUpperCase() jquery question > > > > Anybody? > > > > On 9/25/07, FrankTudor < [EMAIL PROTECTED]> wrote: > > > > As a user types in content to this this text field I would like tho > > force the text to uppercase to as keys are pressed. > > > > How would this be done? > > > > and is toUpperCase a real jquery function? if not wbhat would be a > > simple way to hndle this with either CSS or someother method... > > > > Here is what I have and obviously I am stuck... > > > > > > $(document).ready(function() > > { > > $('.highball').keypress( function() > > { > > $('.highball').toUpperCase() > > } > > ); > > } > > ); > > > > > > > autocomplete="off" id="CityLocal" value="" type="text"> > > > > Frank > > > > > > > > > > > > > > > -- > Joan Piedra || Frontend web developer > http://www.justaquit.com/ || http://www.joanpiedra.com/
[jQuery] Re: input type text toUpperCase() jquery question
Anybody? On 9/25/07, FrankTudor <[EMAIL PROTECTED]> wrote: > > As a user types in content to this this text field I would like tho > force the text to uppercase to as keys are pressed. > > How would this be done? > > and is toUpperCase a real jquery function? if not wbhat would be a > simple way to hndle this with either CSS or someother method... > > > Here is what I have and obviously I am stuck... > > > $(document).ready(function() > { > $('.highball').keypress( function() > { > $('.highball').toUpperCase() > } > ); > } > ); > > > > autocomplete="off" id="CityLocal" value="" type="text"> > > > Frank > >
[jQuery] jQuery UI - How do I get the X and Y of the DROP div
I'm using the example at: http://docs.jquery.com/UI/Droppables and I have the BLOCK dragging and able to drop it, but I want the BLOCK to take the X and Y position of the DROP div, I'm not sure how to find that out Also what are the ev, ui in the drop: function? Will UI give me the actual DROP div incase i have more than 1?
[jQuery] jQuery UI
Draggable for the UI has options, like GRID but there are no examples on how to use these options. Anyone know how?
[jQuery] Re: New jQuery Docs require more work to use
ok, thanks, i wasnt aware of what was planned, sounds cool. :) Until then I'll just use the history for the older version.
[jQuery] New jQuery Docs require more work to use
I noticed the docs changed, but now require more clicking than necessary. I liked the old docs which everything was on the page and it was faster to find things. Now I have to click on the area, then the function, then on CODE, HTML, RESULTS back and forth to get all the information.
[jQuery] Re: How to add content "here"?
It was on ajaxian awhile back, i cant find it but go through every article in the last 2 months and u should find it, please post it if you find it, i shoudl of bookmarked it :p http://ajaxian.com/
[jQuery] Re: How do you test if an object exists?
I'm not test for an ID or a HTML element but a variable. video_ajax_timer_id = setTimeout('prevnext(1, '+next_image_num+')', 5000); Basically I need to know if I need to call that setTimeout or not.
[jQuery] How do you test if an object exists?
I'm getting weird bugs when using setTimeouts and/or setIntervals after I hit the back button in Firefox to come back to the page. I need to do a check at the top of any setTimeout to make sure that the object I need still exists. But I dont know how :(
[jQuery] Re: Using back button causes C.easing[e.easing || (C.easing.swing ? "swing" : "linear")] is not a function
I'm using 1.1.4 before I was using 1.1.3.1 and I got this error: jQuery.easing[e.easing] is not a function But upgrading to the newest jQuery didnt fix the error instead it just changed what the error was Even though I still get errors but the script works, I just need to prevent Firefox from outputing those errors
[jQuery] Using back button causes C.easing[e.easing || (C.easing.swing ? "swing" : "linear")] is not a function
I am doing some ajax and calling a function every 5 seconds and it works perfect except when I press the back button and then gives this error on the next ajax load C.easing[e.easing || (C.easing.swing ? "swing" : "linear")] is not a function HERE IS MY CODE $(document).ready(function() { timer_set = 0; prevnext(); }); function prevnext() { //optional arguments, create the extra query string var next_param = (arguments[0]) ? '&next=' + arguments[0] : '&next=1'; var numsent_param = (arguments[1]) ? '&numsent=' + arguments[1] : ''; var extraparameters = next_param + numsent_param; $.ajaxSetup({timeout: 5000}); $.ajax({ type: 'POST', url: 'http://example.com/request.php', data: 'url=' + encodeURI('http://example.com/data.xml') + '&maxlength=' + encodeURI('3') + extraparameters, beforeSend: function() { if (timer_set) clearTimeout(video_ajax_timer_id); $('#video_ajax_gallery').empty(); $('#video_ajax_gallery').append('loading'); }, error: function(){ $('#video_ajax_gallery').append('Error loading data.'); }, success: function(msg){ $('#video_ajax_gallery').append(''); $('#video_gallery_container').append(msg); $('#video_gallery_container').fadeOut(1,function(){ $('#ajax_loading').hide(); }); $('#video_gallery_container').fadeIn('slow', function(){ video_ajax_timer_id = setTimeout("prevnext(1, next_video_num)", 5000);//next_video_num is set in response timer_set = 1; }); } }); }
[jQuery] Re: Problem keeping swap image from mouseout
Hi Benjamin, Thank you for your reply. I need to keep image2 when clicked. In this way, the user knows what navigation link they are on. Then if the user clicks on another link, the previous link returns to image1. I have done the following: //preloaded the images fastImage = new Image; fast_secondImage = new Image; fastImage.src = "guru_images/fast_reliable.jpg"; fast_secondImage.src = "guru_images/fast_reliable_over.jpg"; then create mouseover, mouseout functions from the elements id //function linkOver(n){ if(n == "fast"){ document.fast.src = fast_secondImage.src } } function linkOut(n){ if(n == "fast"){ document.fast.src = fastImage.src } } I am new with javascript and jquery but I tried this jquery to control the mouseover, mouseout and click. However I do not have the "if" statement correct but this is where I am having trouble. $(function() { $("#fast").click(function(){ linkOver('fast'); view("hid1"); }).mouseover(function(){linkOver('fast')}).mouseout(function(){ if($(this)=="fast"){ linkOver('fast'); }else{ linkOut('fast'); }); }); }); Thanks for having a look Benjamin. Frank. On Aug 10, 10:33 am, "Benjamin Sterling" <[EMAIL PROTECTED]> wrote: > Frank, > Can you elaborate a little bit or post what you have? > > Sounds like what you need to do, assuming once the user clicks on the image2 > that the rollover disappears, is something like: > > $('#myimg').hover(function(){ > $(this).attr('src','image2');}, > > function(){ > $(this).attr('src','image1');}) > > .click(function(){ > $(this).unbind('hover'); // not sure if this one is correct; > > }); > > On 8/10/07, Frank <[EMAIL PROTECTED]> wrote: > > > > > I am not sure if anyone can solve this problem, however, I am trying > > to keep the rollover image2 if the user clicks on image2. However on > > mouseout, it reverts back to image1. I have tried different coding and > > I am tripped up everytime. > > > Frank > > -- > Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com
[jQuery] Problem keeping swap image from mouseout
I am not sure if anyone can solve this problem, however, I am trying to keep the rollover image2 if the user clicks on image2. However on mouseout, it reverts back to image1. I have tried different coding and I am tripped up everytime. Frank
[jQuery] Re: Swapping img src in IE shows blank
One suggestion, if it is not already done, is to preload the images. On Aug 7, 11:35 am, gecko68 <[EMAIL PROTECTED]> wrote: > I am trying to swap an image src using jquery, and in FF it works > great, in IE6, its sometimes shows the image, and other times shows > nothing. > > $('#arrow').attr("src","arrow_blue_right.gif"); > > Any ideas?
[jQuery] Re: can jquery handle onclick with mouseover
Hi Michael, Thank you very much for your reply. Please forgive my sloppy code work. I am a novice with Javascript and now jquery so there will be errors in my code. So again I thank you for your help, patience and understanding. -- The closing brace is missing from my code. I assume I need to add one. -- I tried $(this) == "click" to keep image2 in place after clicking. My goal is to have the side navigation show image2 if clicked and not if no click. And revert to image1if another image link on the same side navigation is clicked. see my test site www.solawebb.com/computer_guru_home.php Only the top two images are setup on the page for now. Hopefully I explained this properly? cheers, Marshall On Aug 3, 6:30 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote: > Frank, is the missing close brace a typo in the post, or is it missing in > your code too? > > (Thanks to Komodo [1] for marking the syntax error with a squiggly red > underline.) > > Also, what is $(this) == "click" supposed to do? That creates a jQuery > object and compares it with a string, which will always compare false. > > -Mike > > [1]http://www.activestate.com/Products/komodo_edit/ > > > From: Frank > > > Can jquery handle mouseover, mouseout and onclick in one function. I > > need a mouseover to change the image. I need to keep the image if the > > image is clicked, and not, if the image is not clicked. I need to > > clear the function if another image is clicked. > > > I have tried this code structure but no success. Any help would be > > appreicated. > > >$(function() { > > > $("#fast").click(function(){linkOver('fast');view("hid1"); > > > }).mouseover(function(){linkOver('fast')}).mouseout(function(){ > >if($(this)=="click"){ > > linkOver('fast'); > >}else{ > > linkOut('fast'); > >}); > > }); > > > Frank
[jQuery] can jquery handle onclick with mouseover
Can jquery handle mouseover, mouseout and onclick in one function. I need a mouseover to change the image. I need to keep the image if the image is clicked, and not, if the image is not clicked. I need to clear the function if another image is clicked. I have tried this code structure but no success. Any help would be appreicated. $(function() { $("#fast").click(function(){linkOver('fast');view("hid1"); }).mouseover(function(){linkOver('fast')}).mouseout(function(){ if($(this)=="click"){ linkOver('fast'); }else{ linkOut('fast'); }); }); Frank
[jQuery] Re: IS condition true like an if statement?
Was I misinformed or is the is(); used only with CSS? If not, is("click"); should evaluate when click() is clicked. Frank On Aug 3, 2:12 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Pete wrote: > > I guess I'm still not getting "else" out of this. I thought I had it > > figured out > > > I think what's confusing to me as a n00b is that "if" does not seem to > > be closed. How would I accomplish an else condition? > > I highly recommend to make yourself familiar with JavaScript control > structures. jQuery can do a lot for you but you still need to know the > basics of > JavaScript...http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Condit... > > What do mean by "not closed"? > > You can use anifstatement without curly bracesifthere's only one > statement to be executed: > > if(condition) alert('yes'); > > or > > if(condition) > alert('yes'); > > Together with else: > > if(condition) alert('yes'); > else alert('no'); > > I tend to always use curly braces, that makes it easier to add another > line to the conditional blocks and to me it's easier to read, but that's > just a personal taste I guess. You'll need them anyway to group multiple > statements in a block: > > if(condition) { > alert('yes'); > alert('I said yes');} else { > > alert('no'); > alert('I said no'); > > } > > Back to your example: > > $("a.saveConfig").click(function() { > if($('div.detail').is(':visible')) { > alert('Hey this works'); > } else { > alert('Hey this doesn't work'); > } > > }); > > HTH > > --Klaus
[jQuery] Re: Two words for Jquery
Bravo jquery!! Frank On Aug 2, 2:10 am, David Duymelinck <[EMAIL PROTECTED]> wrote: > js ez > > -- David > > Geoffrey Knutzen schreef: > > > > > Remember, the two words must be less than a total of 20 characters > > (compressed) > > :) > > > -Original Message- > > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of David Duymelinck > > Sent: Wednesday, August 01, 2007 6:41 AM > > To: jquery-en@googlegroups.com > > Subject: [jQuery] Re: Two words for Jquery > > > Javascript Effordless (in most cases) > > > -- David > > > Tane Piper schreef: > > >> 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. > > -- > David Duymelinck > > [EMAIL PROTECTED]
[jQuery] Image Rollover
Hi fellow members, I have to accomplish the following for same page side navigation: pseudo code: nav 1 - mouseout image1, mouseover image2 click image, fn(view div) css display:block shows text on same page if "click" show image 2 - if !click show image1 nav(n) the same as above If click nav2 - nav(n) revert back to image1 I am not sure how to accomplish this. here is my code. $(function() { $("#fast").click(function(){view('hid1')}).mouseover(function() {linkOver('fast')}) .mouseout(function(){ linkOut('fast') }); }); linkOut(), linkOver() javascript to control the images that is it, hope you can help, Frank