[jQuery] Re: Bug in hover()?
stupid me ;) thanks a lot ricardo. greetz ezod On 15 Jan., 18:19, Ricardo Tomasi ricardob...@gmail.com wrote: you have to unbind('mouseenter').unbind('mouseleave') - ricardo On Jan 15, 1:15 pm, ezod pured...@gmail.com wrote: Hi all, I tried the following: // bind hover (works!) $(foobar).hover( function () { //do something }, function () { //do something else } ); // unbind hover (works!) $(foobar).unbind(mouseover).unbind(mouseleave); // rebind hober (works not!) $(foobar).hover( function () { //do something }, function () { //do something else } ); So after unbinding the event I can´t bind the hover function again
[jQuery] Re: New Plugin: jQuery Finder (Mac-style 'Treeview' with Columns)
@ Adam, Unfortunately no, I haven't done any testing on IE = no fixing. I imagine that it's not a lot of work to be done, mostly setting height: 1% to most of the elements and perhaps adding some width properties. I'm on a mac so testing on IE is not easy for me. Nicolas On Jan 16, 3:18 am, gobagoo atist...@gmail.com wrote: Great plugin. Have you made any progress on getting IE working. I would be happy to help as this is a feature that I would love to get working on my site. Thanks, Adam On Dec 8 2008, 6:25 am, Nicolas R ruda...@googlemail.com wrote: Greetings! I've put together a plugin that creates a mac-style finder out of a list. The plugin is still in development (ALPHA) and it needs some testing, especially on IE. The purpose of this plugin is to provide an alternative to treeview navigation. Making it look just like the Finder on a Mac is not my goal, I am after its core functionality. Having said this, I think that implementing useful features that exist on Mac's Finder (search, toolback w/ options, etc) is time well spent. You can find the plugin ( demo) here:http://www.nicolas.rudas.info/jQuery/Finder/ I'm posting this here as I'm after feedback, contributions (especially), and testers, so if anyone's interested please post here. I hope the source code is readable and self-explanatory, I did comment a lot on some things so it should make some sense. As this is an alpha release, I've just included a link to the script in the demo page, and a link to a zip file that contains the demo page along with css images used. The zip file is what you are probably after, as the css file is essential. Cheers
[jQuery] Re: How do I use the JSON api to enter a value in a p tag?
The concept is basically the same. You would add something like: $('#my_target_element').append('p' + item.title + '/p') On Jan 16, 1:01 am, desbest afanintheho...@gmail.com wrote: How do I use the JSON api to enter a value in a p tag? Code is herehttp://codedumper.com/flickr-api-using-jquery-json Example is herehttp://sampleswap.uk.to/json/test.html Yeah the code I've got is fine for images. But what if I want to create a p and fill it with data from the api.
[jQuery] jQuery.support query
The utilities jQuery.browser and jQuery.version has been deprecated in jQuery 1.3 version and the documentation says to use jQuery.support for the same. But I do not find any options for browser and version in jQuery.support. Although they have been included in 1.3 release too, but are deprecated. How can we then check the browser name and version..?
[jQuery] Re: issue with pathClass: current on nav style menu
Just wondering if there was any update on this?, if anyone could help as it is quite a frustrating problem Regards Chris On Jan 15, 4:28 pm, cajchris cajch...@gmail.com wrote: Anyone got any ideas? On Jan 15, 4:08 pm, cajchris cajch...@gmail.com wrote: Also notice that the jQuery is adding lots of information into my HTML tags such as jQuery1232031575583=... in the anchor tags and list item tags. it also adds span class=sf-sub-indicator jQuery1232031575583=null»/span inside the anchor tags, I presume to get the arrows. I noticed in the source of the example given by superfish that this does not appear in their tags On Jan 15, 4:00 pm, cajchris cajch...@gmail.com wrote: Hi, I have been using superfish for the navigation for a site I am working on and have ran into problems regarding the current class that is applied to each li tag which is in the current path. Whenever I hover over the top level, the 2nd level is displayed and the links are are all there, with the current one highlighted. However once I move the mouse away from the menu altogether, the 2nd level does not remain displayed with the links in it as before, instead they disappear after a delay, and I am left with a blank blue strip where the links should be. In the source of my page I have: script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery-1.2.6.min.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.tabs.pack.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.history.pack.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/topnavigation.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/supersubs.js type=text/javascript/script link href=/Relatis1/Skin/P/topnavigation.css type=text/css rel=stylesheet link href=/Relatis1/Skin/P/topnav-horizontal.css type=text/css rel=stylesheet script type=text/javascript$(document).ready(function(){$ ('#horizontal-menu').superfish({pathClass: 'current'}); });/script This is the same as the superfish example except that I have downloaded the css files and the 2 superfish javascript files onto my local machine and renamed them. The only change being in the topnav- horizontal.css file whereby I changed: .sf-navbar li ul { width: 44em; /*IE6 soils itself without this*/ } TO .sf-navbar li ul { width: 150em; /*IE6 soils itself without this*/ } As I needed the 2nd level strip to be wider as it contains more links than the example given. A snippt of my HTML source for the menu is: UL class=sf-menu sf-navbar sf-js-enabled sf-shadow id=horizontal-menu serial=0 sfTimer=1313775 jQuery1232031575583=451 LI class=current jQuery1232031575583=3 A class=sf-with-ul id=11386_Tab onclick= href=# jQuery1232031575583=55HomeSPAN class=sf-sub-indicator jQuery1232031575583=null»/SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=452 LI class= jQuery1232031575583=4 A class=sf-with-ul id=m11387 title=Complaint Search onclick= href=# jQuery1232031575583=56Complaint SearchSPAN class=sf-sub-indicator jQuery1232031575583=null»/ SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=453 LI class= jQuery1232031575583=57 A class= id=m11388 title=Open onclick= href=# jQuery1232031575583=58Open/A /LI LI class= jQuery1232031575583=59 A id=m11389 title=Pending onclick= href=# jQuery1232031575583=60Pending/A /LI LI class= jQuery1232031575583=61 A id=m11390 title=Closed onclick= href=# jQuery1232031575583=62Closed/A /LI LI class= jQuery1232031575583=63 A id=m15012 title=fdgdfgdg onclick= href=# jQuery1232031575583=64fdgdfgdg/A /LI /UL /LI LI class=current jQuery1232031575583=65 A id=m11440 title=Customer Search onclick= href=# jQuery1232031575583=66Customer Search/A /LI LI class= jQuery1232031575583=67 A id=m11391 title=Quote / Policy Search onclick= href=# jQuery1232031575583=68Quote / Policy Search/A /LI LI class= jQuery1232031575583=69 A id=m12064 title=Renewal Search onclick= href=#
[jQuery] Wrapping non empty text node with span
Hi all, I'm looking for a way to wrap text node with span. HTML: ul id=target liItem 1/li liItem 5 ul liItem 5-1/li liItem 5-2/li liItem 5-3 ul liItem 5-3-1/li /ul /li /ul /li liItem 6/li /ul Expected Outcome: ul id=target lispanItem 1/span/li lispanItem 5/span ul lispanItem 5-1/span/li lispanItem 5-2/span/li lispanItem 5-3/span ul lispanItem 5-3-1/span/li /ul /li /ul /li lispanItem 6/span/li /ul Currently I do it by: $(#target li).find(li).each(function(){ if(this.childNodes[0] this.childNodes[0].nodeType == 3){ var data = $.trim(this.childNodes[0].data); if(data){ this.childNodes[0].data = data; $(this.childNodes[0]).wrap(span/span); } } }); I wonder if there is any simpler way to do this? -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net
[jQuery] Re: How do i generify this action to happen for every radio button with id=other
Sure, but I was hoping for a generic kind of answer like if input=other than ... Form code is generated by the drupal Form API [code] div class=form-item div class=form-radios div class=form-item id=edit-sample-garden-wrapper label class=optioninput type=radio id=edit-sample-garden name=samplte value=garden class=form-radio / a. Garden/ label /div div class=form-item id=edit-sample-parkland-wrapper label class=optioninput type=radio id=edit-sample-parkland name=sample_site value=parkland class=form-radio / b. Parkland/label /div div class=form-item id=edit-sample-other-wrapper label class=optioninput type=radio id=edit-sample-other name=sample value=other class=form-radio / j. Other/label /div /div div class=descriptionChoose one of the above./div /div div id=sample_otherlabelj. Other input id=sample_other_text name=sample_other_text type=text value=//label/divdiv class=form-item [/code] On Jan 16, 12:02 am, Dave Methvin dave.meth...@gmail.com wrote: Can you post the markup for one of the groups? You can probably use that to your advantage.
[jQuery] Re: namespacing events
But I'm not trying to trigger my.event, I trigger my.event.a. With a bind(my.event.a) I would expect to catch my.event.a events only, and not my.event.xxx. While for a bind(my.event) I would expect to catch all my.event, my.event.a, my.event.xxx, ... events. Stephan
[jQuery] Re: namespacing events
Thanks for the clarification. But there is still some point I'm confused of. If the dot is not a namespace separator I would expect it to be a logical and, or or operator. But my experiments show that you cannot interpret it as logical operator either, or at least I don't get it. So what's best practise to name private events without polluting the event namespace? Stephan
[jQuery] Re: How do i generify this action to happen for every radio button with id=other
http://docs.jquery.com/Selectors/attributeContains#attributevalue $(input[id*='other']).bind(evt, function(){ alert('This should get called when you click on any radio if it's id contains other') if ($(this).attr('checked') == 'checked' $(this).val() == 'other') { // not sure how the rest of your forms look like, this probably needs adapting $(#sample_other).show(); $(#edit-sample-other-wrapper).hide(); $(this).parents('div:eq(2)').find('.description').hide(); } else { // not sure how the rest of your forms look like, this probably needs adapting $(#sample_other).hide(); $(#edit-sample-other-wrapper).show(); $(this).parents('div:eq(3)').find('.description').show(); } }); On Jan 16, 11:00 am, kat...@googlemail.com k.bou...@nhm.ac.uk wrote: Sure, but I was hoping for a generic kind of answer like if input=other than ... Form code is generated by the drupal Form API [code] div class=form-item div class=form-radios div class=form-item id=edit-sample-garden-wrapper label class=optioninput type=radio id=edit-sample-garden name=samplte value=garden class=form-radio / a. Garden/ label /div div class=form-item id=edit-sample-parkland-wrapper label class=optioninput type=radio id=edit-sample-parkland name=sample_site value=parkland class=form-radio / b. Parkland/label /div div class=form-item id=edit-sample-other-wrapper label class=optioninput type=radio id=edit-sample-other name=sample value=other class=form-radio / j. Other/label /div /div div class=descriptionChoose one of the above./div /div div id=sample_otherlabelj. Other input id=sample_other_text name=sample_other_text type=text value=//label/divdiv class=form-item [/code] On Jan 16, 12:02 am, Dave Methvin dave.meth...@gmail.com wrote: Can you post the markup for one of the groups? You can probably use that to your advantage.
[jQuery] JSON with ajaxComplete
Hello, I have a generic ajaxComplete event that does soe generic stuff to my screen once ajax calls complete. All calls will return a JSON object with at least a success property. The thing is the ajaxComplete arguments don't have my response in JSON (regardless of specifying type in the call). It does obviously contain the responseText but my question is do I just call an eval on this or os there a cleaner jQuery way to do this? Regards, James. This e-mail is intended solely for the addressee and is strictly confidential; if you are not the addressee please destroy the message and all copies. Any opinion or information contained in this email or its attachments that does not relate to the business of Kainos is personal to the sender and is not given by or endorsed by Kainos. Kainos is the trading name of Kainos Software Limited, registered in Northern Ireland under company number: NI19370, having its registered offices at: Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland. Registered in the UK for VAT under number: 454598802 and registered in Ireland for VAT under number: 9950340E. This email has been scanned for all known viruses by MessageLabs but is not guaranteed to be virus free; further terms and conditions may be found on our website - www.kainos.com
[jQuery] Re: Wrapping non empty text node with span
I don't think you need .find(li), just $(#target li).each(function(){ Other than that, looks pretty simple already On Jan 16, 10:50 am, Jacky jacky...@gmail.com wrote: Hi all, I'm looking for a way to wrap text node with span. HTML: ul id=target liItem 1/li liItem 5 ul liItem 5-1/li liItem 5-2/li liItem 5-3 ul liItem 5-3-1/li /ul /li /ul /li liItem 6/li /ul Expected Outcome: ul id=target lispanItem 1/span/li lispanItem 5/span ul lispanItem 5-1/span/li lispanItem 5-2/span/li lispanItem 5-3/span ul lispanItem 5-3-1/span/li /ul /li /ul /li lispanItem 6/span/li /ul Currently I do it by: $(#target li).find(li).each(function(){ if(this.childNodes[0] this.childNodes[0].nodeType == 3){ var data = $.trim(this.childNodes[0].data); if(data){ this.childNodes[0].data = data; $(this.childNodes[0]).wrap(span/span); } } }); I wonder if there is any simpler way to do this? -- Best Regards, Jacky 網絡暴民http://jacky.seezone.net
[jQuery] Re: Wrapping non empty text node with span
Actually, you'll need $(#target).find(li).each(function(){ to process each li from target ul. On Jan 16, 12:22 pm, Beres Botond boton...@gmail.com wrote: I don't think you need .find(li), just $(#target li).each(function(){ Other than that, looks pretty simple already On Jan 16, 10:50 am, Jacky jacky...@gmail.com wrote: Hi all, I'm looking for a way to wrap text node with span. HTML: ul id=target liItem 1/li liItem 5 ul liItem 5-1/li liItem 5-2/li liItem 5-3 ul liItem 5-3-1/li /ul /li /ul /li liItem 6/li /ul Expected Outcome: ul id=target lispanItem 1/span/li lispanItem 5/span ul lispanItem 5-1/span/li lispanItem 5-2/span/li lispanItem 5-3/span ul lispanItem 5-3-1/span/li /ul /li /ul /li lispanItem 6/span/li /ul Currently I do it by: $(#target li).find(li).each(function(){ if(this.childNodes[0] this.childNodes[0].nodeType == 3){ var data = $.trim(this.childNodes[0].data); if(data){ this.childNodes[0].data = data; $(this.childNodes[0]).wrap(span/span); } } }); I wonder if there is any simpler way to do this? -- Best Regards, Jacky 網絡暴民http://jacky.seezone.net
[jQuery] Superfish: changing state by script
Hi I have made a small script that loads content via ajax. The site in question uses superfish for a menu, and I would like to update the state of the menu, when I load new content to the content area. The menu is a 2 layer menu, and the second level will show the items for the current level 1, (if any), unless another level 1 item is hovered, then it will show the sub-items to that level. I have the level 1 fixed, just by altering a class, but I can' get level 2 to work. I have tried just .show() on the submenu, but that doesn't work. Does Superfish have any APIs for changing the current state of active items? Or, if not, what classes/styles/events, do I need to change to accomplish it? Hope it makes sense, the site is http://ajust.mocsystems.com
[jQuery] Re: issue with pathClass: current on nav style menu
help please lol!!! On Jan 16, 8:46 am, cajchris cajch...@gmail.com wrote: Just wondering if there was any update on this?, if anyone could help as it is quite a frustrating problem Regards Chris On Jan 15, 4:28 pm, cajchris cajch...@gmail.com wrote: Anyone got any ideas? On Jan 15, 4:08 pm, cajchris cajch...@gmail.com wrote: Also notice that the jQuery is adding lots of information into my HTML tags such as jQuery1232031575583=... in the anchor tags and list item tags. it also adds span class=sf-sub-indicator jQuery1232031575583=null»/span inside the anchor tags, I presume to get the arrows. I noticed in the source of the example given by superfish that this does not appear in their tags On Jan 15, 4:00 pm, cajchris cajch...@gmail.com wrote: Hi, I have been using superfish for the navigation for a site I am working on and have ran into problems regarding the current class that is applied to each li tag which is in the current path. Whenever I hover over the top level, the 2nd level is displayed and the links are are all there, with the current one highlighted. However once I move the mouse away from the menu altogether, the 2nd level does not remain displayed with the links in it as before, instead they disappear after a delay, and I am left with a blank blue strip where the links should be. In the source of my page I have: script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery-1.2.6.min.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.tabs.pack.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.history.pack.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/topnavigation.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/supersubs.js type=text/javascript/script link href=/Relatis1/Skin/P/topnavigation.css type=text/css rel=stylesheet link href=/Relatis1/Skin/P/topnav-horizontal.css type=text/css rel=stylesheet script type=text/javascript$(document).ready(function(){$ ('#horizontal-menu').superfish({pathClass: 'current'}); });/script This is the same as the superfish example except that I have downloaded the css files and the 2 superfish javascript files onto my local machine and renamed them. The only change being in the topnav- horizontal.css file whereby I changed: .sf-navbar li ul { width: 44em; /*IE6 soils itself without this*/ } TO .sf-navbar li ul { width: 150em; /*IE6 soils itself without this*/ } As I needed the 2nd level strip to be wider as it contains more links than the example given. A snippt of my HTML source for the menu is: UL class=sf-menu sf-navbar sf-js-enabled sf-shadow id=horizontal-menu serial=0 sfTimer=1313775 jQuery1232031575583=451 LI class=current jQuery1232031575583=3 A class=sf-with-ul id=11386_Tab onclick= href=# jQuery1232031575583=55HomeSPAN class=sf-sub-indicator jQuery1232031575583=null»/SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=452 LI class= jQuery1232031575583=4 A class=sf-with-ul id=m11387 title=Complaint Search onclick= href=# jQuery1232031575583=56Complaint SearchSPAN class=sf-sub-indicator jQuery1232031575583=null»/ SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=453 LI class= jQuery1232031575583=57 A class= id=m11388 title=Open onclick= href=# jQuery1232031575583=58Open/A /LI LI class= jQuery1232031575583=59 A id=m11389 title=Pending onclick= href=# jQuery1232031575583=60Pending/A /LI LI class= jQuery1232031575583=61 A id=m11390 title=Closed onclick= href=# jQuery1232031575583=62Closed/A /LI LI class= jQuery1232031575583=63 A id=m15012 title=fdgdfgdg onclick= href=# jQuery1232031575583=64fdgdfgdg/A /LI /UL /LI LI class=current jQuery1232031575583=65 A id=m11440 title=Customer Search onclick= href=# jQuery1232031575583=66Customer Search/A /LI LI class= jQuery1232031575583=67 A id=m11391 title=Quote / Policy Search onclick= href=#
[jQuery] Re: What is wrong ?
Fixed. :) The problem was with the way on how i build the unordered list (i'm using jinja2 templates) and some issues with css. Ty. On 15 jan, 20:09, Giuliani Sanches giulianisanc...@gmail.com wrote: I have the jquery working fine ( $(a).click to show an alert messages do the job) but i can't get the treeview plugin to work. My html code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html head title/title link rel=stylesheet type=text/css href=/static/css/style.css script type=text/javascript src=/static/js/jquery.js/script script type=text/javascript src=/static/js/jquery.treeview.js/script script type=text/javascript $(document).ready(function(){ $('#treemenu').treeview(); }); /script /head body div class=body h1Bem vindo ao controle de frota/h1 div id=mainmenu a href=/Home/a /div div id=appmenu ul id=treemenu li Cadastros /liul lia href=/localidades/listar/estado Estados/a/li lia href=/localidades/listar/cidade Cidades/a/li/ul /ul /div p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec orci nulla, mollis sed, ultricies non, viverra nec, risus. Nam luctus, pede in aliquam ultrices, massa mauris pretium nunc, tincidunt lacinia mauris augue dictum eros. Aenean eleifend. Donec eget nulla eu nulla rutrum viverra. Morbi pulvinar sollicitudin justo. Sed condimentum. Vestibulum consectetur neque. Pellentesque odio. Curabitur ut pede. Nam fermentum mi eget lacus. /p /div /body /html Ty.
[jQuery] Re: How get data objects from a php file called via ajax
If you want to have events on html elements loaded/added dynamically, you need to bind the event after the element has been inserted into the page. $(#myresult).html(html); // define your click event here Or with jquery 1.3 you can use .live() http://docs.jquery.com/Events/live On Jan 15, 5:41 pm, Mikael mhedeng...@gmail.com wrote: Thanks Milos. When I fixed this coding error I get a button but I still can not get any click event for this button. This is how I try to get this click event: $('.test_select').bind(click, function() { var thisName = $(this).attr('name'); $('#test_list').html(thisName + clicked); return false; }); On 15 Jan, 15:22, Miloš Rašić milos.ra...@gmail.com wrote: Try fixing your html in the php code like this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; You forgot to close that class property in the input. On Thu, Jan 15, 2009 at 12:12 PM, Mikael mhedeng...@gmail.com wrote: I am new to javascript and jQuery programming so my problem might be very simple to explain but please bare with me. I want to make a selection in a list created by a php-file that is called from another php-file using jQuery and ajax but it fails. My example is very limited but shows the main problem. The first php-file has abutton defined like this: input class=mini_browse type=button value=Browse test / I also have a div to show the result: div id=myresultShow the result here/div The jQuery entry looks like this: jQuery(document).ready(function($) { $('.mini_browse').bind(click, function() { $.ajax({ type: get, url: test-ajax.php, data: { action: 'test' }, error: function() {$(#myresult).html(Ajax error);}, success: function(html){ //so, if data is retrieved, store it in html $(#myresult).html(html); } }); //close jQuery.ajax return false; }); }); When I click the button I get a call to test-ajax.php as expected and the output is displayed in the myresult div but not as expected. The test-ajax.php executes this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; The button is not displayed as a button but like an input text with the text Select in it and I can not get a click event from it. I can not see the output from test-ajax.php when I view the page source so I guess that I have to get it included in the document somehow but how? Can anybody point me in the right direction to solve this? Thanks!
[jQuery] Re: .animate() custom animation callback?
You have to click on Options. On Thu, Jan 15, 2009 at 8:30 PM, Ricardo Tomasi ricardob...@gmail.com wrote: http://docs.jquery.com/Effects/animate#paramsdurationeasingcallback http://docs.jquery.com/Effects/animate#paramsoptions This is what the links on the main page point to. Where did you get that link? I thought those were innocent hashes :D On Jan 15, 6:45 pm, Ariel Flesler afles...@gmail.com wrote: How come it isn't on the docs ? http://docs.jquery.com/Effects/animate#toptions On Thu, Jan 15, 2009 at 6:43 PM, Ricardo Tomasi ricardob...@gmail.com wrote: It's not in the docs, but you have to pass the callback as the 'complete' option: $(this).animate({marginTop:'500px'}, {queue: false, complete: function (){ ... } }); On Jan 14, 4:10 pm, lhwpa...@googlemail.com lhwpa...@googlemail.com wrote: hi, im using .animate() to create a custom animation. is there any way to handle a callback function? normal . animation() has a parameter for a callback function but not the one for own animations? -- Ariel Fleslerhttp://flesler.blogspot.com -- Ariel Flesler http://flesler.blogspot.com
[jQuery] [Plugin Release] Endless Scroll
Hi guys, Just thought I'd post this here in case anyone finds it useful. I have released a plugin for endless scrolling. If you don’t already know, endless scroll (or infinite scrolling) is a popular technique among web 2.0 sites such as Google Reader and Live Image Search, where instead of paging through items using the traditional pagination technique, the page just keeps loading with new items attached to the end. For more information including features, usages and a demo, check out: http://www.beyondcoding.com/2009/01/15/release-jquery-plugin-endless-scroll/ Hopefully you'll find it useful, and please feel free to provide feedback. :) Cheers, Fred
[jQuery] How get data objects from a php file called via ajax updated?
Hi all, I want to make a selection in a list created by a php-file that is called from another php-file using jQuery and ajax but I can not get any events to the newly created html elements. My example is very limited but shows the main problem. The first php-file has abutton defined like this: input class=mini_browse name=mini_browse_btn id=mini_browse_btn type=button value=Browse test / I also have a div to show the result: div id=myresultShow the result here/div The jQuery entry looks like this: jQuery(document).ready(function($) { $('.mini_browse').bind(click, function() { $.ajax({ type: get, url: test-ajax.php, data: { action: 'test' }, error: function() {$(#myresult).html(Ajax error);}, success: function(html){ //so, if data is retrieved, store it in html $(#myresult).html(html); } }); //close jQuery.ajax return false; }); }); When I click the button I get a call to test-ajax.php as expected and the output is displayed in the myresult div. The test-ajax.php executes this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; Firebug console reports this response: input class=test_select type=button name=test_select_1 id=test_select_1 value=Select / The updated div shows this result (according to Firebug): div id=myresult input id=test_select_1 class=test_select type=button value=Select name=test_select_1/ /div I can not get any events from the newly created button and when I execute var x=document.getElementsByName(test_select_1); x.length returns zero so the element seems not to exist. Do I have to do anything to get the newly created element into the documents DOM or what can I do to make this work? Thanks!
[jQuery] Re: Code simplification?
Hi Ricardo, Thanks for that, quite clear and I follow what you wrote. My issue is that the hoverintent function runs on the menu tabs, not on the submenu panels. So, the mouse hovers over one of the menu tabs, i.e. .nav_company, and that should then trigger the display of the content panel below it (.nav_sub_company in this case). I'm not entirely sure how to modify the code you supplied to achieve this? If you can help, that would be great! Cheers, Rob Ricardo Tomasi wrote: This way you'll have to repeat it for each element anyway. The important thing is to have access to all of them at once, doesn't matter if by a common class or doing it manually: var $submenus = $ ('.nav_sub_default, .nav_sub_products, .nav_sub_markets, .nav_sub_tools_support, .nav_sub_news_events, .nav_sub_company'); $submenus.hoverIntent(function(){ $submenus.removeClass('onscreen').addClass('offscreen'); $(this).removeClass('offscreen').addClass('onscreen'); }, function(){ return false }); And that's it. If you create a common class you can shorten the first line. Note that it's generally faster to redundantly add and remove a class than to filter the current element to save that operation. - ricardo On Jan 13, 7:06�pm, Kean shenan...@gmail.com wrote: Try this if you can't change your html (function($) { � $.fn.replaceClass = function(class1, class2){ � � � � � � � � $(this).removeClass(class1).addClass(class2); � } })(jQuery); $('.nav_company').hoverIntent(function() { � � // toggle display of company sub menu content panel � � $ ('.nav_sub_default, .nav_sub_products, .nav_sub_markets, .nav_sub_tools_support, .nav_sub_news_events').replaceClass ('onscreen', 'offscreen'); � � $('.nav_sub_company').replaceClass('offscreen', 'onscreen'); � }, � function(){ � � return false; � } ); On Jan 13, 8:36�am, r...@lighthouseuk.net r...@50-tuning.com wrote: Hi, I'm new to jQuery and liking what I've seen so far. I'm curious as to whether I can reduce my code, using chaining perhaps? Example... $('.nav_company').hoverIntent(function() { // toggle display of company sub menu content panel � � � � $('.nav_sub_default').removeClass('onscreen').addClass ('offscreen'); � � � � $('.nav_sub_company').removeClass('offscreen').addClass ('onscreen'); � � � � $('.nav_sub_products').removeClass('onscreen').addClass ('offscreen'); � � � � $('.nav_sub_markets').removeClass('onscreen').addClass ('offscreen'); � � � � $('.nav_sub_tools_support').removeClass('onscreen').addClass ('offscreen'); � � � � $('.nav_sub_news_events').removeClass('onscreen').addClass ('offscreen'); � � � },function(){ � � � � return false; }); Based on the fact that there are 6 menu items (nav_sub_x) - I currently have the above code entered 6 times to add and remove the necessary classes from each of the relevant DIVs on the page. Is there a cleaner way to do this? Many thanks in advance. Cheers, Rob
[jQuery] Re: [Plugin Release] Endless Scroll
Look great! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Canglan Sent: Friday, January 16, 2009 6:48 AM To: jQuery (English) Subject: [jQuery] [Plugin Release] Endless Scroll Hi guys, Just thought I'd post this here in case anyone finds it useful. I have released a plugin for endless scrolling. If you don't already know, endless scroll (or infinite scrolling) is a popular technique among web 2.0 sites such as Google Reader and Live Image Search, where instead of paging through items using the traditional pagination technique, the page just keeps loading with new items attached to the end. For more information including features, usages and a demo, check out: http://www.beyondcoding.com/2009/01/15/release-jquery-plugin-endless-scroll/ Hopefully you'll find it useful, and please feel free to provide feedback. :) Cheers, Fred
[jQuery] Re: browser window position when ajax updating
Try adding return false; to your click code to prevent normal click response. hth, Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Alexey Sent: Thursday, January 15, 2009 9:37 PM To: jQuery (English) Subject: [jQuery] browser window position when ajax updating Hello If I ajax update an element which is in the lower part of the window the browser moves the window in the starting position. How can I stay above the updated element after update? thanks Alex jquery is great!
[jQuery] Re: How get data objects from a php file called via ajax updated?
Why don't you check your old thread for responses instead of posting the same thing twice? http://groups.google.com/group/jquery-en/browse_thread/thread/c94d4da1f304e2d/0b7b2b0e9c9ea11e?hl=enlnk=gstq=ajax#0b7b2b0e9c9ea11e Do what I said there, and also make sure that your PHP script is working correctly. You need to add the events after the button has been inserted into the page. (or use .live(), in jquery 1.3, but 1st option might be easier at first) Just load up your test-ajax.php in the browser with params, and see if it outputs the html it should. And where exactly in the code did you execute var x=document.getElementsByName(test_select_1);? If it's not inside the 'success' function, it probably won't work. On Jan 16, 1:53 pm, Mikael mhedeng...@gmail.com wrote: Hi all, I want to make a selection in a list created by a php-file that is called from another php-file using jQuery and ajax but I can not get any events to the newly created html elements. My example is very limited but shows the main problem. The first php-file has abutton defined like this: input class=mini_browse name=mini_browse_btn id=mini_browse_btn type=button value=Browse test / I also have a div to show the result: div id=myresultShow the result here/div The jQuery entry looks like this: jQuery(document).ready(function($) { $('.mini_browse').bind(click, function() { $.ajax({ type: get, url: test-ajax.php, data: { action: 'test' }, error: function() {$(#myresult).html(Ajax error);}, success: function(html){ //so, if data is retrieved, store it in html $(#myresult).html(html); } }); //close jQuery.ajax return false; }); }); When I click the button I get a call to test-ajax.php as expected and the output is displayed in the myresult div. The test-ajax.php executes this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; Firebug console reports this response: input class=test_select type=button name=test_select_1 id=test_select_1 value=Select / The updated div shows this result (according to Firebug): div id=myresult input id=test_select_1 class=test_select type=button value=Select name=test_select_1/ /div I can not get any events from the newly created button and when I execute var x=document.getElementsByName(test_select_1); x.length returns zero so the element seems not to exist. Do I have to do anything to get the newly created element into the documents DOM or what can I do to make this work? Thanks!
[jQuery] Re: New Plugin: jQuery Finder (Mac-style 'Treeview' with Columns)
A really nice plugin! The only thing missing in my view is a small bread cump as in the mac! ;) On Fri, Jan 16, 2009 at 5:20 AM, Nicolas R ruda...@googlemail.com wrote: @ Adam, Unfortunately no, I haven't done any testing on IE = no fixing. I imagine that it's not a lot of work to be done, mostly setting height: 1% to most of the elements and perhaps adding some width properties. I'm on a mac so testing on IE is not easy for me. Nicolas On Jan 16, 3:18 am, gobagoo atist...@gmail.com wrote: Great plugin. Have you made any progress on getting IE working. I would be happy to help as this is a feature that I would love to get working on my site. Thanks, Adam On Dec 8 2008, 6:25 am, Nicolas R ruda...@googlemail.com wrote: Greetings! I've put together a plugin that creates a mac-style finder out of a list. The plugin is still in development (ALPHA) and it needs some testing, especially on IE. The purpose of this plugin is to provide an alternative to treeview navigation. Making it look just like the Finder on a Mac is not my goal, I am after its core functionality. Having said this, I think that implementing useful features that exist on Mac's Finder (search, toolback w/ options, etc) is time well spent. You can find the plugin ( demo) here: http://www.nicolas.rudas.info/jQuery/Finder/ I'm posting this here as I'm after feedback, contributions (especially), and testers, so if anyone's interested please post here. I hope the source code is readable and self-explanatory, I did comment a lot on some things so it should make some sense. As this is an alpha release, I've just included a link to the script in the demo page, and a link to a zip file that contains the demo page along with css images used. The zip file is what you are probably after, as the css file is essential. Cheers -- Atenciosamente, Felipe Paiva Mobile: +55 81 9692-2631 Home: +55 81 3432-4109 Work:+55 81 3224-3010 R:28 Msn / Google Talk / Skype felipe.pa...@gmail.com
[jQuery] jQuery (1.2.6) and IE7 problem
Hi all, I have problem with these pages, check menu Rules and then submenu for rules. Under FF3 it works OK, but under IE7 it lost data from cache or what. Deos can somobody help me. Thx in advance. jQuery codes Menu: $(function(){ $(ul#menu li a:first).addClass('active'); $(ul#menu li a).click(function(){ $(ul#menu li a:only-child).removeClass('active'); $(this).addClass('active'); var href = $(this).attr('href'); $('#obsah*').remove(); $.ajax({ url: href, success: function(html){ $('#obsah').append(html); } }); return false; }); }); Submenu: $(function(){ $('#menu2 li a:first').addClass('active2'); $('#rkontys*').css('display','none'); $('#rGeneral').css('display',''); $('#menu2 li a').click(function(){ var href1=$(this).attr('href'); //$('#obsah*').remove(); $('#menu2 li a:only-child').removeClass('active2'); $(this).addClass('active2'); $('#rkontys*').css('display','none'); $('#'+href1).css('display', ''); if (href1=='complete'){ $('#rkontys*').css('display', '')}; return false; }); });
[jQuery] [accordion] Accordion overflow problems in IE6 (maybe also 7)
Hi all, the accordion won't work properly in ie6 (works perfectly in ff 3). the structure: div class=container div id=test-accordion class=accordion div class=accordion-item div class=accordion-toggle/div div class=accordion-content/div /div div class=accordion-item div class=accordion-toggle/div div class=accordion-content/div /div ... /div /div Jquery ver 1.3, ui 1.64c . I trigger the accordion in this way: jQuery(document).ready(function () { jQuery(#test-accordion).accordion({ header: div.accordion-toggle, clearStyle: false, fillSpace: true }); The problems: - once clicked in the toggle, the content will show over the other accordion items - happens mainly if the content is made by images or mixed text + images. -overflow will not keeps the contents inside the accordion container proberly, they will flow out the container. - when contents are bigger then the container, and the container size is fixed, the overflow won't work properly. I got a big image, ff shows scrollbars perfectly, ie just shows the whole image screwing the whole accordion. Here what I had to do to kinda fix it, in a .css file visible only by ie: div.container{ float:left; width:580px; background:#f0f0f0; height:450px; color:#33; overflow:hidden; /*needed for accordion */ position:relative;/* needed for accordion */ } div.accordion-item{ position:relative; /*needed for accordion */ overflow:auto; /*needed for accordion */ } div.accordion-toggle{ width:100%; } div.accordion-content{ overflow:auto; /*needed for accordion */ } Now it works almost like ie, except when the accordion-content contains a big images (ie crops it while ff shows the scrollbars). Sample page: www.alu.com/entest/index_test.php (still working on it).
[jQuery] forms validation problem
dear all, I'm new with Jquery and now I want to use it for validate forms. I build site with django. The problem is the error message cannot show up. my code as following below: $(document).ready(function(){ $('#updateForm').validate({ rules:{ email:{ required: true, email: true } } message:{ email: e-mail field is required } }).addClass(error); }); kindly advice and thank you for your kind help best regards, -mila-
[jQuery] Superfish: Error: jQuery(ul.sf-menu).superfish is not a function
Hi, I'm running a Joomla site with the superfish menu (http:// www.sdspaintball.nl) Menu works fine except when I go to the forum section. It displays the menu, but without the downarrow indicator. Also the slide effect is not working as it is on the rest of the site. Error I'm getting is: Error: jQuery(ul.sf-menu).superfish is not a function Source File: http://www.sdspaintball.nl/index.php?option=com_fireboardItemid=11func=latest Line: 29 Line 29 contains: jQuery(document).ready(function(){ jQuery(ul.sf-menu).superfish ({hoverClass:'sfHover', pathLevels:1, delay:800, animation: {opacity:'show', height:'show', width:'show'}, speed:'def', autoArrows: 1, dropShadows:1}) }); Any thoughts?
[jQuery] how to enable drag drop using this plugin
I am using thise plugin. http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/ Using thise plugin, how to drag only row within class='dro'. I not want to drop all rows, only row within class='dro' Thnks.
[jQuery] forms validation problem
dear all, I'm new with jquery and I have problem with my code for forms validation. the error message cannot show up. I build the web site using django. my code as per following below: {% extends 'base_site.html' %} {% load i18n %} {% block breadcrumbs %}div class=breadcrumbsa href=/{% trans 'Home' %}/ a rsaquo; {% trans 'Update Profile' %}/div{% endblock %} {% block head %} {% block title %}{% trans Update Profile %}{% endblock %} link rel=stylesheet type=text/css href=/site_media/error.css / script type=text/javascript src=/site_media/jquery-1.2.6.min.js / /script script type=text/javascript src=/site_media/ jquery.validate.pack.js //script script type=text/javascript $(document).ready(function(){ $('.update').validate({ rules:{ email:{ required: true, email: true } } message:{ email: e-mail field is required } }).addClass(error); }); /script {% endblock %} {% block content %} h1 Update My Profile /h1 br form class=update id=updateForm method=post actions=./ table tr thlabel for=id_emaile-mail:/label/th tdinput type=text name=email id=id_email / /tr /table input type =submit value=update / /form {% endblock %} kindly advice and really appreciate for your help best regards, -Vierda-
[jQuery] Autocomplete - Minimum Size of Possible Matches
Has anyone else run in to an issue with autocomplete not returning matches of less than five characters? I have it searching for matches starting at 2 characters, but for some reason it sits at the 'Loading' message if the only match is only 4 characters long? (For example, I'm typing in 'Ko' and it won't find the name 'Koch' in the list.) I've replicated this with a few possible matches that are 4 characters long, consistently fails. However, if I increase that name to 5 characters it works fine. Any suggestions? Thanks, Joel
[jQuery] window height for footer
I'm using the code below to position a footer div in a flexible layout with this css #footer { position: absolute; /* Needed for Safari */ padding: 1px; background-color: #e3e3e3; text-align:center; height: 20px; left:230px; right:30px; } I'm using jQuery for other things, and from what I'm seeing, the code below could probably be replaced with a few lines right? could anyone help with this? Thanks! // footer position code !-- function getWindowHeight() { var windowHeight = 0; if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; } else { if (document.documentElement document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else { if (document.body document.body.clientHeight) { windowHeight = document.body.clientHeight; } } } return windowHeight; } function setFooter() { if (document.getElementById) { var windowHeight = getWindowHeight(); if (windowHeight 0) { var contentHeight = document.getElementById ('content').offsetHeight; var footerElement = document.getElementById('footer'); var footerHeight = footerElement.offsetHeight; if (windowHeight - (contentHeight + footerHeight) = 0) { footerElement.style.position = 'absolute'; footerElement.style.top = (windowHeight - footerHeight) + 'px'; } else { footerElement.style.position = 'static'; } } } } window.onload = function() { setFooter(); } window.onresize = function() { setFooter(); } //--
[jQuery] Selector *= not works in Safari 3.2.1 and Chrome 1.0.154.43
Hi all, Here is my situation. HTML Page DTD Type is declared as following !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/ TR/xhtml11/DTD/xhtml11.dtd Javascript Code as following $(#fp option[text*='+subject+']).remove(); Where #fp is a select.../select object Works fine in IE7 and FireFox 3.0.5 How can I fix this line or is a bug? Thanks in advance!
[jQuery] jQuery (1.2.6) $.ajax and IE7 problem
Hi all, I have probelm with these pages http://83.240.47.84/skyrace2 under FF3 menu rules and submenu works fine, but under IE7 it is loosing data. What is wrong there? scripts: Menu: $(function(){ $(ul#menu li a:first).addClass('active'); $(ul#menu li a).click(function(){ $(ul#menu li a:only-child).removeClass('active'); $(this).addClass('active'); var href = $(this).attr('href'); $('#obsah*').remove(); $.ajax({ url: href, success: function(html){ $('#obsah').append(html); } }); return false; }); }); Submneu: $(function(){ $('#menu2 li a:first').addClass('active2'); $('#rkontys*').css('display','none'); $('#rGeneral').css('display',''); $('#menu2 li a').click(function(){ var href1=$(this).attr('href'); //$('#obsah*').remove(); $('#menu2 li a:only-child').removeClass('active2'); $(this).addClass('active2'); $('#rkontys*').css('display','none'); $('#'+href1).css('display', ''); if (href1=='complete'){ $('#rkontys*').css('display', '')}; return false; }); });
[jQuery] jQuery in a Firefox Extension...
It seems like this has been asked a million times, but nothing seems to answer my question. I include it in my .xul above my other scripts- (I checked the location and it's correct). It's the first time I've used jQuery in an extension, so I'm trying to run some commands on load just to see if it works. The following below throws no exceptions: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); } catch(e) { alert(e); } } Below I'll list a bunch of things I tried with their respective errors to maybe help give a glimpse into whats going on... What's going on here? I'm sure it's something obvious, or simple... The following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); alert(jQuery(body)); } catch(e) { alert(e); } } Throws: TypeError: n.find is not a function The Following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { $.getJSON(http://www.google.com/;, function(data) { alert(data); }); } catch(e) { alert(e); } } Throws: TypeError: $.getJSON is not a function The Following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); jQuery.getJSON(http://www.google.com/;, function(data) { alert(data); }); } catch(e) { alert(e); } } Throws: TypeError: jQuery.getJSON is not a function Thanks, guys!
[jQuery] Re: JSON with ajaxComplete
I have a generic ajaxComplete event that does soe generic stuff to my screen once ajax calls complete. All calls will return a JSON object with at least a success property. The thing is the ajaxComplete arguments don't have my response in JSON (regardless of specifying type in the call). It does obviously contain the responseText but my question is do I just call an eval on this or os there a cleaner jQuery way to do this? How are you requesting the data? Are you using $.getJSON() ?
[jQuery] Re: Weirdest thing on Firefox 3 on MacOSX
If you are still in need of the error messages send me the link. I can't give you tons of times, but can give you screenshots of the errors or something. Aaron On Jan 14, 10:23 pm, yellow1912 yellow1...@gmail.com wrote: I still desperately need help for this, since I dont have Mac to test and debug it. If you can help please let me know, I will pay for your time or donate the amount to jquery, whichever method you wants. Thanks so much for your help Regards Raine On Jan 13, 6:01 pm, yellow1912 yellow1...@gmail.com wrote: I encounter a rather weird problem where my plugin would run on all platforms except Firefox 3 on MacOSX, and since I don't have Mac I can not debug it. (this plugin uses jquery 1.2.6 and jq form, jq validation and livequery plugins.) This is still under development I can not post the link directly here, but if you can email me at yellow1...@gmail.com I will send you a link along with the steps to reproduce the problem right away I desperately need help here, I suspect this is somewhat a small glide, if you have firebug and can catch the error message on it then it would be easy to work it out. If you can just check the problem and send me the bugs reported that would help greatly as well. I understand that this will cost your time and effort, and I'm willing to pay for your help. Thank you all! Love Jquery (\/) Regards Raine
[jQuery] Re: implemented css class not in html but is in generated html, failed to find
$('li.tabs-selected') also shows undefined.. i m unable to find li with the help of class 'tabs-selected'.. On Jan 16, 1:28 am, Balazs Endresz balazs.endr...@gmail.com wrote: Now that's another one: $('li').hasClass('.tabs-selected') and $('li').is('.tabs-selected') only tell you if li has that class or not, if you want to select by class do this: $('li.tabs-selected') On Jan 15, 9:11 pm, CreativeMind aftab.pu...@gmail.com wrote: hi, here is the html source of a list. li class=xsnazzy a href=#frMap style=text-decoration:none;text-indent:5px;b class='xtop' b class='xb1 '/bb class='xb2 color_a'/bb class='xb3 '/b b class='xb4 color_a'/b/bspan class=xboxcontent h1Map/h1/span/a/li -- here is the generated html source of a list. li class=xsnazzy top-left tabs-selected a href=#frMap style=text-decoration: none; text-indent: 5px; b class=xtopb class=xb1/bb class=xb2 color_a/b b class=xb3/bb class=xb4 color_a/b/b span class=xboxcontenth1Map/h1/span/a/li --- the problem is when i try to find $('li').hasClass('.tabs-selected'), or $('li').is('.tabs-selected') it returns me undefined... but it exists in the generated html..how can i find that class.
[jQuery] Re: Selector *= not works in Safari 3.2.1 and Chrome 1.0.154.43
What version of jQuery are you using? --John On Fri, Jan 16, 2009 at 2:35 AM, floyd floyd...@gmail.com wrote: Hi all, Here is my situation. HTML Page DTD Type is declared as following !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/ TR/xhtml11/DTD/xhtml11.dtd Javascript Code as following $(#fp option[text*='+subject+']).remove(); Where #fp is a select.../select object Works fine in IE7 and FireFox 3.0.5 How can I fix this line or is a bug? Thanks in advance!
[jQuery] NS_ERROR_XPC_JS_THREW_STRING with jquery 1.3
This error seems to be rearing its ugly head in FF3 using jquery 1.3. When I was using the latest 1.2.6 for jquery I would get a little warning in firebug that said... Empty string passed to getElementById(). This wouldn't cause anything bad to happen and things would move on just fine. IE7 didn't do anything strange. But with the new 1.3 it stops both browers dead in its tracks with a real error. Here is a simplified version that replicates the error... html head script type=text/javascript src=jquery-1.3.min.js/script script type=text/javascript $(function(){ $(':text').keyup(function(){ var inputArray = $('input'); for(i=0;i=inputArray.length;i++) { $('#'+$(inputArray[i]).attr('name')).removeClass(error); } $('#submit').attr('disabled',false); }); }); /script /head body form id=form1 method=post action=SetSearch Customer Number input type=text class=numeric id=number name=number maxlength=6 tabindex=2 size=6 / input type=submit tabindex=6 value=Search id=submit / /form /body /html Any help would be greatly appreciated. Bryce
[jQuery] Re: jQuery in a Firefox Extension...
I'm pretty sure the problem is that jQuery is defining itself in it's header section as something like window.jQuery = jQuery = $ or some such referential transitive equation strand. I'm not an expert at FF plugins, but I have gone through the motions of building one that modified current pages only. And to get to that page, you had to invoke a special call to get access to the current tabs current page html. I'd look into that, and get to the point where you can alert the innerHTML of a page element. That's how I first started to learn it. I just wish I hadn't already forgotten. :P On Jan 15, 11:37 pm, Nic nic.luci...@gmail.com wrote: It seems like this has been asked a million times, but nothing seems to answer my question. I include it in my .xul above my other scripts- (I checked the location and it's correct). It's the first time I've used jQuery in an extension, so I'm trying to run some commands on load just to see if it works. The following below throws no exceptions: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); } catch(e) { alert(e); } } Below I'll list a bunch of things I tried with their respective errors to maybe help give a glimpse into whats going on... What's going on here? I'm sure it's something obvious, or simple... The following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); alert(jQuery(body)); } catch(e) { alert(e); } } Throws: TypeError: n.find is not a function The Following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { $.getJSON(http://www.google.com/;, function(data) { alert(data); }); } catch(e) { alert(e); } } Throws: TypeError: $.getJSON is not a function The Following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); jQuery.getJSON(http://www.google.com/;, function(data) { alert(data); }); } catch(e) { alert(e); }} Throws: TypeError: jQuery.getJSON is not a function Thanks, guys!
[jQuery] Re: NS_ERROR_XPC_JS_THREW_STRING with jquery 1.3
I didn't know you could cal var x = $('selector'); x[0] and have it work. Try changing this line to: $('#'+inputArray.eq(0).attr('name')).removeClass(error); Also, I can't see the rest of the code, but why are you re-selecting the current element like you are? The name and ID are the same, so taking the element you already have and fetching it again through a different means seems wasteful and unnecessary? On Jan 16, 9:23 am, bryce4president brycekmar...@gmail.com wrote: This error seems to be rearing its ugly head in FF3 using jquery 1.3. When I was using the latest 1.2.6 for jquery I would get a little warning in firebug that said... Empty string passed to getElementById(). This wouldn't cause anything bad to happen and things would move on just fine. IE7 didn't do anything strange. But with the new 1.3 it stops both browers dead in its tracks with a real error. Here is a simplified version that replicates the error... html head script type=text/javascript src=jquery-1.3.min.js/script script type=text/javascript $(function(){ $(':text').keyup(function(){ var inputArray = $('input'); for(i=0;i=inputArray.length;i++) { $('#'+$(inputArray[i]).attr('name')).removeClass(error); } $('#submit').attr('disabled',false); });}); /script /head body form id=form1 method=post action=SetSearch Customer Number input type=text class=numeric id=number name=number maxlength=6 tabindex=2 size=6 / input type=submit tabindex=6 value=Search id=submit / /form /body /html Any help would be greatly appreciated. Bryce
[jQuery] jQuery UI 1.6rc5
When is this planned on coming out? Anyone know?
[jQuery] Re: jQuery UI 1.6rc5
The jquery-ui list would be a better place for this question. http://groups.google.com/group/jquery-ui --John On Fri, Jan 16, 2009 at 9:34 AM, Eric Garside gars...@gmail.com wrote: When is this planned on coming out? Anyone know?
[jQuery] Re: implemented css class not in html but is in generated html, failed to find
This should definitely work, with a live test page it would be much easier to say anything about it. What version of jQuery are you using and on which browser does it occur? On Jan 16, 2:48 pm, CreativeMind aftab.pu...@gmail.com wrote: $('li.tabs-selected') also shows undefined.. i m unable to find li with the help of class 'tabs-selected'.. On Jan 16, 1:28 am, Balazs Endresz balazs.endr...@gmail.com wrote: Now that's another one: $('li').hasClass('.tabs-selected') and $('li').is('.tabs-selected') only tell you if li has that class or not, if you want to select by class do this: $('li.tabs-selected') On Jan 15, 9:11 pm, CreativeMind aftab.pu...@gmail.com wrote: hi, here is the html source of a list. li class=xsnazzy a href=#frMap style=text-decoration:none;text-indent:5px;b class='xtop' b class='xb1 '/bb class='xb2 color_a'/bb class='xb3 '/b b class='xb4 color_a'/b/bspan class=xboxcontent h1Map/h1/span/a/li -- here is the generated html source of a list. li class=xsnazzy top-left tabs-selected a href=#frMap style=text-decoration: none; text-indent: 5px; b class=xtopb class=xb1/bb class=xb2 color_a/b b class=xb3/bb class=xb4 color_a/b/b span class=xboxcontenth1Map/h1/span/a/li --- the problem is when i try to find $('li').hasClass('.tabs-selected'), or $('li').is('.tabs-selected') it returns me undefined... but it exists in the generated html..how can i find that class.
[jQuery] Re: 1.3 live doesn't seem to work with UI?
Thanks everyone. Am looking forward to this. :) On Jan 15, 11:25 pm, Richard D. Worth rdwo...@gmail.com wrote: It was just released. See http://ui.jquery.com/ for jQuery UI 1.6rc5. There will be a blog post in the morning. - Richard On Thu, Jan 15, 2009 at 11:54 PM, MorningZ morni...@gmail.com wrote: its been mentioned in multiple topics today that they are working hard on a new version of UI that is compatible.. (i think they said tomorrow) either wait for it, or continue to use 1.2.6 On Jan 15, 11:34 pm, Clumsy Hamster clumsyhams...@gmail.com wrote: I have this bit of test code: $('input').live('click',function(){ $(this).datePicker(); }); But every time I run it, it always gives the message of Object doesn't support this method. I've tried putting it onto a class (.input), an ID (#input) and just a plain input with all the same results. Followed the instructions on the pagehttp:// docs.jquery.com/Events/live#typefn. So, it is looking like either I'm doing something incorrectly or it doesn't work with the JQuery UI. Anyone see or know what may be wrong? thanks ^.^- Hide quoted text - - Show quoted text -
[jQuery] Re: forms validation problem
Please take a look at this section: http://docs.jquery.com/Discussion#Support_Questions What you provided so far isn't enough to help you debug the issue.. Jörn On Fri, Jan 16, 2009 at 9:27 AM, vierda m...@pensil.com wrote: dear all, I'm new with jquery and I have problem with my code for forms validation. the error message cannot show up. I build the web site using django. my code as per following below: {% extends 'base_site.html' %} {% load i18n %} {% block breadcrumbs %}div class=breadcrumbsa href=/{% trans 'Home' %}/ a rsaquo; {% trans 'Update Profile' %}/div{% endblock %} {% block head %} {% block title %}{% trans Update Profile %}{% endblock %} link rel=stylesheet type=text/css href=/site_media/error.css / script type=text/javascript src=/site_media/jquery-1.2.6.min.js / /script script type=text/javascript src=/site_media/ jquery.validate.pack.js //script script type=text/javascript $(document).ready(function(){ $('.update').validate({ rules:{ email:{ required: true, email: true } } message:{ email: e-mail field is required } }).addClass(error); }); /script {% endblock %} {% block content %} h1 Update My Profile /h1 br form class=update id=updateForm method=post actions=./ table tr thlabel for=id_emaile-mail:/label/th tdinput type=text name=email id=id_email / /tr /table input type =submit value=update / /form {% endblock %} kindly advice and really appreciate for your help best regards, -Vierda-
[jQuery] Re: implemented css class not in html but is in generated html, failed to find
jQuery1.2.4 and browsers are IE and ff..the html source view of both browsers shows single class implemented that is 'xsnazzy' but the generated source of both browsers shows three classes implemented (xsnazzy top-left tabs-selected).. On Jan 16, 7:41 pm, Balazs Endresz balazs.endr...@gmail.com wrote: This should definitely work, with a live test page it would be much easier to say anything about it. What version of jQuery are you using and on which browser does it occur? On Jan 16, 2:48 pm, CreativeMind aftab.pu...@gmail.com wrote: $('li.tabs-selected') also shows undefined.. i m unable to find li with the help of class 'tabs-selected'.. On Jan 16, 1:28 am, Balazs Endresz balazs.endr...@gmail.com wrote: Now that's another one: $('li').hasClass('.tabs-selected') and $('li').is('.tabs-selected') only tell you if li has that class or not, if you want to select by class do this: $('li.tabs-selected') On Jan 15, 9:11 pm, CreativeMind aftab.pu...@gmail.com wrote: hi, here is the html source of a list. li class=xsnazzy a href=#frMap style=text-decoration:none;text-indent:5px;b class='xtop' b class='xb1 '/bb class='xb2 color_a'/bb class='xb3 '/b b class='xb4 color_a'/b/bspan class=xboxcontent h1Map/h1/span/a/li -- here is the generated html source of a list. li class=xsnazzy top-left tabs-selected a href=#frMap style=text-decoration: none; text-indent: 5px; b class=xtopb class=xb1/bb class=xb2 color_a/b b class=xb3/bb class=xb4 color_a/b/b span class=xboxcontenth1Map/h1/span/a/li --- the problem is when i try to find $('li').hasClass('.tabs-selected'), or $('li').is('.tabs-selected') it returns me undefined... but it exists in the generated html..how can i find that class.
[jQuery] Re: implemented css class not in html but is in generated html, failed to find
Try 1.2.6 or 1.3! There was some problem with 1.2.4 and 1.2.5, it was very quickly updated to 1.2.6. On Jan 16, 3:54 pm, CreativeMind aftab.pu...@gmail.com wrote: jQuery1.2.4 and browsers are IE and ff..the html source view of both browsers shows single class implemented that is 'xsnazzy' but the generated source of both browsers shows three classes implemented (xsnazzy top-left tabs-selected).. On Jan 16, 7:41 pm, Balazs Endresz balazs.endr...@gmail.com wrote: This should definitely work, with a live test page it would be much easier to say anything about it. What version of jQuery are you using and on which browser does it occur? On Jan 16, 2:48 pm, CreativeMind aftab.pu...@gmail.com wrote: $('li.tabs-selected') also shows undefined.. i m unable to find li with the help of class 'tabs-selected'.. On Jan 16, 1:28 am, Balazs Endresz balazs.endr...@gmail.com wrote: Now that's another one: $('li').hasClass('.tabs-selected') and $('li').is('.tabs-selected') only tell you if li has that class or not, if you want to select by class do this: $('li.tabs-selected') On Jan 15, 9:11 pm, CreativeMind aftab.pu...@gmail.com wrote: hi, here is the html source of a list. li class=xsnazzy a href=#frMap style=text-decoration:none;text-indent:5px;b class='xtop' b class='xb1 '/bb class='xb2 color_a'/bb class='xb3 '/b b class='xb4 color_a'/b/bspan class=xboxcontent h1Map/h1/span/a/li -- here is the generated html source of a list. li class=xsnazzy top-left tabs-selected a href=#frMap style=text-decoration: none; text-indent: 5px; b class=xtopb class=xb1/bb class=xb2 color_a/b b class=xb3/bb class=xb4 color_a/b/b span class=xboxcontenth1Map/h1/span/a/li --- the problem is when i try to find $('li').hasClass('.tabs-selected'), or $('li').is('.tabs-selected') it returns me undefined... but it exists in the generated html..how can i find that class.
[jQuery] Re: NS_ERROR_XPC_JS_THREW_STRING with jquery 1.3
I boiled this example down to its simplest form. In my actual page I have 6 text boxes, 2 radio buttons, and a submit button. If the form criteria is not met on keyup then I highlight the inputs in error by changing their background colors to red and on their next keyup if it satisfies the criteria I remove the class error which is the trigger to my CSS to change the background colors. So I'm removing that. That is why I run through the loop of input elements and remove the class from them. The problem is when I do the $('#'+inputArray[i].attr('name')).removeClass(error); on the submit button. I gave each of my inputs a special class and then instead of doing var inputArray = $('input'); I did this. var 'inputArray = $('.inputCheck'); And my code then looks like this... for(i=0;i=inputArray.length;i++) { $('#'+inputArray.eq(i).attr('name')).removeClass(error); } $('#submit').attr('disabled',false); I don't know what it is about that statement that doesn't mesh with the Submit button though... Bryce On Jan 16, 9:33 am, Eric Garside gars...@gmail.com wrote: I didn't know you could cal var x = $('selector'); x[0] and have it work. Try changing this line to: $('#'+inputArray.eq(0).attr('name')).removeClass(error); Also, I can't see the rest of the code, but why are you re-selecting the current element like you are? The name and ID are the same, so taking the element you already have and fetching it again through a different means seems wasteful and unnecessary? On Jan 16, 9:23 am, bryce4president brycekmar...@gmail.com wrote: This error seems to be rearing its ugly head in FF3 using jquery 1.3. When I was using the latest 1.2.6 for jquery I would get a little warning in firebug that said... Empty string passed to getElementById(). This wouldn't cause anything bad to happen and things would move on just fine. IE7 didn't do anything strange. But with the new 1.3 it stops both browers dead in its tracks with a real error. Here is a simplified version that replicates the error... html head script type=text/javascript src=jquery-1.3.min.js/script script type=text/javascript $(function(){ $(':text').keyup(function(){ var inputArray = $('input'); for(i=0;i=inputArray.length;i++) { $('#'+$(inputArray[i]).attr('name')).removeClass(error); } $('#submit').attr('disabled',false); });}); /script /head body form id=form1 method=post action=SetSearch Customer Number input type=text class=numeric id=number name=number maxlength=6 tabindex=2 size=6 / input type=submit tabindex=6 value=Search id=submit / /form /body /html Any help would be greatly appreciated. Bryce
[jQuery] Re: .animate() custom animation callback?
Oh. Didn't notice the tabs. I better give a break from this group for a while, I'm getting confused all the time. Thanks for pointing out the page. cheers, - ricardo On Jan 16, 9:28 am, Ariel Flesler afles...@gmail.com wrote: You have to click on Options. On Thu, Jan 15, 2009 at 8:30 PM, Ricardo Tomasi ricardob...@gmail.com wrote: http://docs.jquery.com/Effects/animate#paramsdurationeasingcallback http://docs.jquery.com/Effects/animate#paramsoptions This is what the links on the main page point to. Where did you get that link? I thought those were innocent hashes :D On Jan 15, 6:45 pm, Ariel Flesler afles...@gmail.com wrote: How come it isn't on the docs ? http://docs.jquery.com/Effects/animate#toptions On Thu, Jan 15, 2009 at 6:43 PM, Ricardo Tomasi ricardob...@gmail.com wrote: It's not in the docs, but you have to pass the callback as the 'complete' option: $(this).animate({marginTop:'500px'}, {queue: false, complete: function (){ ... } }); On Jan 14, 4:10 pm, lhwpa...@googlemail.com lhwpa...@googlemail.com wrote: hi, im using .animate() to create a custom animation. is there any way to handle a callback function? normal . animation() has a parameter for a callback function but not the one for own animations? -- Ariel Fleslerhttp://flesler.blogspot.com -- Ariel Fleslerhttp://flesler.blogspot.com
[jQuery] weird issue with ready event
Hello, I'm trying to set the html content of a DIV (id='list') which sits in a page opened with window.open : var pop = window.open(PrintList.aspx); $(pop.document).ready(function() { $(#list, pop.document).html(hello); }); As you can see, the string 'hello' should be written to the DIV once the page is loaded. Yet the first time I execute this script the string is never written. If I close the new window and I execute the script again, it will work. It's only the first time I execute it how weird.. Does anyone know why ? Thanks
[jQuery] Re: issue with pathClass: current on nav style menu
Anybody with any ideas? On Jan 16, 10:39 am, cajchris cajch...@gmail.com wrote: help please lol!!! On Jan 16, 8:46 am, cajchris cajch...@gmail.com wrote: Just wondering if there was any update on this?, if anyone could help as it is quite a frustrating problem Regards Chris On Jan 15, 4:28 pm, cajchris cajch...@gmail.com wrote: Anyone got any ideas? On Jan 15, 4:08 pm, cajchris cajch...@gmail.com wrote: Also notice that the jQuery is adding lots of information into my HTML tags such as jQuery1232031575583=... in the anchor tags and list item tags. it also adds span class=sf-sub-indicator jQuery1232031575583=null»/span inside the anchor tags, I presume to get the arrows. I noticed in the source of the example given by superfish that this does not appear in their tags On Jan 15, 4:00 pm, cajchris cajch...@gmail.com wrote: Hi, I have been using superfish for the navigation for a site I am working on and have ran into problems regarding the current class that is applied to each li tag which is in the current path. Whenever I hover over the top level, the 2nd level is displayed and the links are are all there, with the current one highlighted. However once I move the mouse away from the menu altogether, the 2nd level does not remain displayed with the links in it as before, instead they disappear after a delay, and I am left with a blank blue strip where the links should be. In the source of my page I have: script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery-1.2.6.min.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.tabs.pack.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.history.pack.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/topnavigation.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/supersubs.js type=text/javascript/script link href=/Relatis1/Skin/P/topnavigation.css type=text/css rel=stylesheet link href=/Relatis1/Skin/P/topnav-horizontal.css type=text/css rel=stylesheet script type=text/javascript$(document).ready(function(){$ ('#horizontal-menu').superfish({pathClass: 'current'}); });/script This is the same as the superfish example except that I have downloaded the css files and the 2 superfish javascript files onto my local machine and renamed them. The only change being in the topnav- horizontal.css file whereby I changed: .sf-navbar li ul { width: 44em; /*IE6 soils itself without this*/ } TO .sf-navbar li ul { width: 150em; /*IE6 soils itself without this*/ } As I needed the 2nd level strip to be wider as it contains more links than the example given. A snippt of my HTML source for the menu is: UL class=sf-menu sf-navbar sf-js-enabled sf-shadow id=horizontal-menu serial=0 sfTimer=1313775 jQuery1232031575583=451 LI class=current jQuery1232031575583=3 A class=sf-with-ul id=11386_Tab onclick= href=# jQuery1232031575583=55HomeSPAN class=sf-sub-indicator jQuery1232031575583=null»/SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=452 LI class= jQuery1232031575583=4 A class=sf-with-ul id=m11387 title=Complaint Search onclick= href=# jQuery1232031575583=56Complaint SearchSPAN class=sf-sub-indicator jQuery1232031575583=null»/ SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=453 LI class= jQuery1232031575583=57 A class= id=m11388 title=Open onclick= href=# jQuery1232031575583=58Open/A /LI LI class= jQuery1232031575583=59 A id=m11389 title=Pending onclick= href=# jQuery1232031575583=60Pending/A /LI LI class= jQuery1232031575583=61 A id=m11390 title=Closed onclick= href=# jQuery1232031575583=62Closed/A /LI LI class= jQuery1232031575583=63 A id=m15012 title=fdgdfgdg onclick= href=# jQuery1232031575583=64fdgdfgdg/A /LI /UL /LI LI class=current jQuery1232031575583=65 A id=m11440 title=Customer Search onclick= href=# jQuery1232031575583=66Customer
[jQuery] Re: NS_ERROR_XPC_JS_THREW_STRING with jquery 1.3
And just a little PS... I wrote this code back when 1.1.2 was the latest version. I was really new to jquery and the way things were done and learning some of these things about not having to make selections over again weren't learned or realized. I did what I had to do at the time with what I knew then to make it work, and it did. But thank your for pointing that out, it went right over my head. I switched it up to the way you suggested and my validation code is definitely a snappier. Thanks again Bryce On Jan 16, 10:04 am, bryce4president brycekmar...@gmail.com wrote: I boiled this example down to its simplest form. In my actual page I have 6 text boxes, 2 radio buttons, and a submit button. If the form criteria is not met on keyup then I highlight the inputs in error by changing their background colors to red and on their next keyup if it satisfies the criteria I remove the class error which is the trigger to my CSS to change the background colors. So I'm removing that. That is why I run through the loop of input elements and remove the class from them. The problem is when I do the $('#'+inputArray[i].attr('name')).removeClass(error); on the submit button. I gave each of my inputs a special class and then instead of doing var inputArray = $('input'); I did this. var 'inputArray = $('.inputCheck'); And my code then looks like this... for(i=0;i=inputArray.length;i++) { $('#'+inputArray.eq(i).attr('name')).removeClass(error);} $('#submit').attr('disabled',false); I don't know what it is about that statement that doesn't mesh with the Submit button though... Bryce On Jan 16, 9:33 am, Eric Garside gars...@gmail.com wrote: I didn't know you could cal var x = $('selector'); x[0] and have it work. Try changing this line to: $('#'+inputArray.eq(0).attr('name')).removeClass(error); Also, I can't see the rest of the code, but why are you re-selecting the current element like you are? The name and ID are the same, so taking the element you already have and fetching it again through a different means seems wasteful and unnecessary? On Jan 16, 9:23 am, bryce4president brycekmar...@gmail.com wrote: This error seems to be rearing its ugly head in FF3 using jquery 1.3. When I was using the latest 1.2.6 for jquery I would get a little warning in firebug that said... Empty string passed to getElementById(). This wouldn't cause anything bad to happen and things would move on just fine. IE7 didn't do anything strange. But with the new 1.3 it stops both browers dead in its tracks with a real error. Here is a simplified version that replicates the error... html head script type=text/javascript src=jquery-1.3.min.js/script script type=text/javascript $(function(){ $(':text').keyup(function(){ var inputArray = $('input'); for(i=0;i=inputArray.length;i++) { $('#'+$(inputArray[i]).attr('name')).removeClass(error); } $('#submit').attr('disabled',false); });}); /script /head body form id=form1 method=post action=SetSearch Customer Number input type=text class=numeric id=number name=number maxlength=6 tabindex=2 size=6 / input type=submit tabindex=6 value=Search id=submit / /form /body /html Any help would be greatly appreciated. Bryce
[jQuery] Re: Problems with the New API Browser
Well, i for one really love the new API interface _ such a much less noisy interface than the docs.jquery.com interface! clearer, snappier. it turns out i don't use the navigation menu much, i use the filter box mostly. that's probably why i'm not so annoyed by its limits. really liked the interfacing with jsbin, yet i would like to be able to contribute with a comments system (like the awesome php doc, where people conribute snippets related to the php function displayed on that page). congratz Remy, and let us designers know if u need help ! On Fri, Jan 16, 2009 at 12:40 AM, Remy Sharp r...@leftlogic.com wrote: I think the animation of menus is one for the options as well then. I understand what you mean, once you're familiar with it, you just want to get on with it. On Jan 15, 9:28 pm, Ricardo Tomasi ricardob...@gmail.com wrote: Two things bother me more: - James' #3 point, that other categories hide when you click one, an accordion would be a better fit for quick navigation. - the subcategories. I like to see the method's names directly, deciding between Hierarchy or Child filters is not an intuitive task. They should be in a kind of tree with the subcategories as separators. These two things would speed up navigation a lot. As it is, it's quite interesting the first time, but gets irritating after a while. Thanks for this Remy, and long live JSBin! :) cheers, - ricardo On Jan 15, 6:35 pm, Remy Sharp r...@leftlogic.com wrote: Hi James, Thank you for your detailed feedback - all good points. I want to push out another release when 1.3.1 goes live - so I'd like to get some, if not all, of the feedback addressed (including others). 1 + 2) almost the same thing - the first problem I see is the AIR browser, which obviously doesn't have a back browser button (which would be solved by your first point). This needs some UI input (which I'll come on to in a minute). 3) I've talked with Yehuda Katz, the original author of Visual jQuery, about navigation interfaces - there's two options (as alternatives to what I have now) that we talked about: tree nav and accordion. Generally speaking, the tree navigation didn't take as well as the Visual jQuery approach. An accordion (I think) would solve the issues you've specifically mentioned, but would also solve some similar feedback I've read, i.e. wanting to be able to scan a category whilst maintaining some hierarchy. (note that you can do this - but it doesn't quite solve the problem:http://api.jquery.com?category=attributes ). 4) Easy to solve - I didn't have access to a designer (I'm a coder through and through) but a few simple tweaks to the CSS (I suspect) should sort this out. 5) I've had the same feedback, but both as a pro *and* as a con (as you have) - so I was going to create an options area that would maintain some certain settings - the focus opacity being one of them. 6) This is common piece of feedback - and simply a technical block I ran in to and ran out of time. Permalinks are my to priority right now, I want people to link straight in to a specific function. I won't be able to have the URL change as the user browses - but the title of the function (and probably some other visual que, i.e. icon) will give the user a permalink to the function. I also want this to work for categories too, so: http://api.jquery.com/attr-would show a list of all the matched functions (alahttp://api.jquery.com/?attr) - but I'd like it if the category hierarchy would also show in left sidebar. In addition: http://api.jquery.com/Core-would land open the Core category - and so on through the subcategories. I'd be more than happy if you contact me offline to lend a hand with some of the UI changes required. @Pappy - there's more I want to do with landing pages, but it's a slightly more complicated job (given that, I think, 1.3.1 is supposed to be going out next week) - but some fast view on all the functions would be useful - I agree. If there's more feedback - I'd love to hear it - particular the issues people have. Many thanks, Remy. On Jan 15, 4:22 am, James Van Dyke jame...@gmail.com wrote: Does anyone else find the new API browser to be a bit cumbersome? My gripes: 1) No back link at top of vertical navigation list. You must click the category to cancel your choice and essentially go back. However, this isn't very intuitive and there aren't any affordances to this behavior save for a small 'x' in the highlighted category box that doesn't do anything on hover or even have a tooltip. 2) The browser's back button is broken. Kind of a big annoyance when you're not used to the application. 3) Recovering from a mistake is more punishing than it should be. Clicking on a category hide the other categories. Since the title of the category moved from under your mouse, you now have to scan to
[jQuery] Re: jQuery.support query
The point is you don't need to know which browser or version it is, as long as you know what features it supports. According to John R, $.browser and version will remain in the core indefinitely, despite being deprecated, as they are useful for CSS coding and not everyone is familiar with the feature detection concept, so you can just keep using that. On Jan 16, 6:46 am, JQueryProgrammer jain.ashis...@gmail.com wrote: The utilities jQuery.browser and jQuery.version has been deprecated in jQuery 1.3 version and the documentation says to use jQuery.support for the same. But I do not find any options for browser and version in jQuery.support. Although they have been included in 1.3 release too, but are deprecated. How can we then check the browser name and version..?
[jQuery] Re: tablesorter after a tr.remove()
Do you know the best way to reapply the zebra widget to the table once i remove rows? Ive seen posts on triggering the sorton again with the current sort, but this seems kind of yucky. Is it possible to use the addWidget() to readd the zebra? thanks On Jan 15, 5:22 pm, MorningZ morni...@gmail.com wrote: Excellent btw to note: i've noticed that the tablesorter is MUCH faster with the new 1.3 version of jQuery, i'd highly suggest using it if possible the new selector engine really makes this plugin fast (er) On Jan 15, 4:55 pm,dduck1934dduck1...@gmail.com wrote: Yeah that worked. had to refresh or update the tablesorter's data. That was much easier than i thought. Thanks MorningZ On Jan 15, 4:34 pm, MorningZ morni...@gmail.com wrote: The tr shouldn't be showing up again at all when i sort it, but it is. I'm not sure what you mean by shouldn't, but the tablesorter plugin is storing all the rows and data on the client and has to be told that the data was refreshed. you doing a tr.remove() removes it from the table, but it doesn't update the tablesorter's data store This example should be of helphttp://tablesorter.com/docs/example-ajax.html except that instead of append-ing data/rows, you run that code after removing On Jan 15, 3:44 pm,dduck1934dduck1...@gmail.com wrote: I have a table that im adding rows to dynamically with jquery of course, and every row has a click on it. when you click on it, it removes that row from the table. im using the remove() on that tr. Now when i apply the tablesorter plugin to that table, i delete a row like normal, then click the header of the table to resort it, and the deleted row pops back up, but i can no longer click on that row to delete it again. its like all the events on that are gone. The tr shouldnt be showing up again at all when i sort it, but it is. anyone have this problem, and does anyone know how to fix this or a work around? thanks, Matthew- Hide quoted text - - Show quoted text -
[jQuery] Re: How get data objects from a php file called via ajax updated?
Thanks a lot Beres, this solved my problem. My mistake for reposting, sorry about that. On 16 Jan, 14:05, Beres Botond boton...@gmail.com wrote: Why don't you check your old thread for responses instead of posting the same thing twice? http://groups.google.com/group/jquery-en/browse_thread/thread/c94d4da... Do what I said there, and also make sure that your PHP script is working correctly. You need to add the events after the button has been inserted into the page. (or use .live(), in jquery 1.3, but 1st option might be easier at first) Just load up your test-ajax.php in the browser with params, and see if it outputs the html it should. And where exactly in the code did you execute var x=document.getElementsByName(test_select_1);? If it's not inside the 'success' function, it probably won't work. On Jan 16, 1:53 pm, Mikael mhedeng...@gmail.com wrote: Hi all, I want to make a selection in a list created by a php-file that is called from another php-file using jQuery and ajax but I can not get any events to the newly created html elements. My example is very limited but shows the main problem. The first php-file has abutton defined like this: input class=mini_browse name=mini_browse_btn id=mini_browse_btn type=button value=Browse test / I also have a div to show the result: div id=myresultShow the result here/div The jQuery entry looks like this: jQuery(document).ready(function($) { $('.mini_browse').bind(click, function() { $.ajax({ type: get, url: test-ajax.php, data: { action: 'test' }, error: function() {$(#myresult).html(Ajax error);}, success: function(html){ //so, if data is retrieved, store it in html $(#myresult).html(html); } }); //close jQuery.ajax return false; }); }); When I click the button I get a call to test-ajax.php as expected and the output is displayed in the myresult div. The test-ajax.php executes this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; Firebug console reports this response: input class=test_select type=button name=test_select_1 id=test_select_1 value=Select / The updated div shows this result (according to Firebug): div id=myresult input id=test_select_1 class=test_select type=button value=Select name=test_select_1/ /div I can not get any events from the newly created button and when I execute var x=document.getElementsByName(test_select_1); x.length returns zero so the element seems not to exist. Do I have to do anything to get the newly created element into the documents DOM or what can I do to make this work? Thanks!
[jQuery] Re: How get data objects from a php file called via ajax
Thanks a lot Beres, this solved my problem! On Jan 16, 11:46 am, Beres Botond boton...@gmail.com wrote: If you want to have events on html elements loaded/added dynamically, you need to bind the event after the element has been inserted into the page. $(#myresult).html(html); // define your click event here Or with jquery 1.3 you can use .live()http://docs.jquery.com/Events/live On Jan 15, 5:41 pm, Mikael mhedeng...@gmail.com wrote: Thanks Milos. When I fixed this coding error I get a button but I still can not get any click event for this button. This is how I try to get this click event: $('.test_select').bind(click, function() { var thisName = $(this).attr('name'); $('#test_list').html(thisName + clicked); return false; }); On 15 Jan, 15:22, Miloš Rašić milos.ra...@gmail.com wrote: Try fixing your html in the php code like this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; You forgot to close that class property in the input. On Thu, Jan 15, 2009 at 12:12 PM, Mikael mhedeng...@gmail.com wrote: I am new to javascript and jQuery programming so my problem might be very simple to explain but please bare with me. I want to make a selection in a list created by a php-file that is called from another php-file using jQuery andajaxbut it fails. My example is very limited but shows the main problem. The first php-file has abutton defined like this: input class=mini_browse type=button value=Browse test / I also have a div to show the result: div id=myresultShow the result here/div The jQuery entry looks like this: jQuery(document).ready(function($) { $('.mini_browse').bind(click, function() { $.ajax({ type: get, url: test-ajax.php, data: { action: 'test' }, error: function() {$(#myresult).html(Ajax error);}, success: function(html){ //so, if data is retrieved, store it in html $(#myresult).html(html); } }); //close jQuery.ajax return false; }); }); When I click the button I get a call to test-ajax.php as expected and the output is displayed in the myresult div but not as expected. The test-ajax.php executes this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; The button is not displayed as a button but like an input text with the text Select in it and I can not get a click event from it. I can not see the output from test-ajax.php when I view the page source so I guess that I have to get it included in the document somehow but how? Can anybody point me in the right direction to solve this? Thanks!
[jQuery] jQuery Ajax, getting data returned from my PHP script
Hi All, I created a form and decided to add some AJAX. What I want to do is add a span class=required*/span next to my required label elements and change to span class=valid*/span when the AJAX blur event validates each of my fields. My problem, when I run the script I get no data returned from my ajax- validation.php script. Can anyone help?? many thanks gemmes // SELECTED JAVASCRIPT /* AJAX Form */ $('#submit').click(function() { // using click instead of blur while in development var name = $('input#name').val(); var email = $('input#email').val(); var message = $('textarea#message').val(); $.ajax({ type: 'POST', url: 'ajax-validation.php', data: 'name=' + name + 'email=' + email + 'message=' + message, success: function(results) { alert( Data Saved: + results ); // This alert has given me no feedback - always blank } }); // end ajax return false; }); // End .click() // SELECTED PHP ?php /* InputFields */ $ajax_validation_name = trim($_POST['name']); $ajax_validation_email = $_POST['email']; $ajax_validation_message = $_POST['message']; $ajax_validation_response = array(); // $name if (strlen($ajax_validation_name) 2) { $ajax_validation_response ['name'] = Please enter your name. 2; } // $email if (!preg_match('/^[a-z0-9\'\.\-_\...@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+ [a-z]{2}/is', $ajax_validation_email)) { $ajax_validation_response['email'] = Please enter a valid email address 2; } // $message if (strlen($ajax_validation_message) 1) { $ajax_validation_response ['message'] = Please leave a message. 2; } return $ajax_validation_response; ?
[jQuery] sorting a select list of option elements
I have a select list into which I place new option elements, and I want to show them in sorted order. I've searched around and tried some approaches, but not successful yet. Here is an example. It may not be the best use of jQuery, but at least I understand it. The select element has id ops-memb I get the current content, then add another option item. var members = $('#ops-memb').html() + option id='507'Another Item/ option; $'#ops-memb').html(members); This works. Now I try to sort $('#ops-memb option').sort(function(a,b) { return $(a).text() $(b).text() ? 1 : -1; }); I get an error message that $('#ops-memb').sort is not a function Could someone help me understand what I am doing wrong and how to get this to work correctly? Thanks.
[jQuery] Re: 1.3 live doesn't seem to work with UI?
That realease don't work very well in IE7 using UI Tabs with Facebox. Take look my post at: http://groups.google.com/group/jquery-ui/browse_thread/thread/009afe01bd3b2667 And I don't know to do. On 16 jan, 05:25, Richard D. Worth rdwo...@gmail.com wrote: It was just released. See http://ui.jquery.com/ for jQuery UI 1.6rc5. There will be a blog post in the morning. - Richard On Thu, Jan 15, 2009 at 11:54 PM, MorningZ morni...@gmail.com wrote: its been mentioned in multiple topics today that they are working hard on a new version of UI that is compatible.. (i think they said tomorrow) either wait for it, or continue to use 1.2.6 On Jan 15, 11:34 pm, Clumsy Hamster clumsyhams...@gmail.com wrote: I have this bit of test code: $('input').live('click',function(){ $(this).datePicker(); }); But every time I run it, it always gives the message of Object doesn't support this method. I've tried putting it onto a class (.input), an ID (#input) and just a plain input with all the same results. Followed the instructions on the pagehttp:// docs.jquery.com/Events/live#typefn. So, it is looking like either I'm doing something incorrectly or it doesn't work with the JQuery UI. Anyone see or know what may be wrong? thanks ^.^
[jQuery] Re: $(area) not working in IE (sorry if this is a repost)
I know... no Firebug in IE. Poo. maybe give firebug lite a go. it's a firebug library you can embed into a page and view through any browser you like. http://getfirebug.com/lite.html it's always useful for trying to hack out random IE bugs. On Jan 15, 5:00 am, James Van Dyke jame...@gmail.com wrote: Ok... that's a hard page to get away from with all those alert boxes. I know... no Firebug in IE. Poo. I believe that class is not what IE calls that attribute. For instance, element.class will return nothing. element.className is the correct property. Try that. Plus, you could shorten your code and make it a bit more readable: $(area).mouseover( function(){ $(# . $(this).attr(class)).addClass('selected');}.mouseout( function() { $(# . $(this).attr(class)).removeClass('selected'); }; Let me know how that works out. On Jan 14, 6:30 pm, Chrisw chris.p.wel...@gmail.com wrote: sorry if this is a repost but I didn't see it in the group and I didn't get a copy in my email. I am working with an image map and i am using the maphilight plugin and I want to add a border to an image below the image map when a user hovers over an area (based on the iamges ID and the area's class)(see code below) I got it to work in FF but I cannot get it to work in IE. Any help? URL:http://oregonstate.edu/admissions/firstyear/recruitmap/map/ Code: $(area).hover(function(){ var stateClass; stateClass = $(this).attr(class); var stateClassQuery; stateClassQuery = #+stateClass; alert(stateClassQuery);//for testing $(stateClassQuery).addClass('selected'); //mouse out }, function(){ var stateClass; stateClass = $(this).attr(class); var stateClassQuery; stateClassQuery = #+stateClass; $(stateClassQuery).removeClass('selected'); }
[jQuery] back load livequery
Hello, I use 'livequery' where Loading function data. There is a need for the possibility of back of the previous result and I do not know how to do this. For example, 3 loading and clicking back-loaded me return to a previous one, when I click again, back again, I revert to the previous result loading reply from the server. This is the form of a tree. Clicked and the data is loaded, click again load, etc. But in the last load I can return to the same start clicking, and gradually go back to the roots. Do you have any ideas? me code: $(function(){ var lastresult=''; var backlink='?module=kategorieaction=getcategory'; var link=''; $('#kategorie-button').click(function(){ $('#miejscowosci-wybierz').hide(); $.ajax({ type:get, url: ?module=kategorieaction=getcategory, success: function(response){ lastresult=response; $('#kategorie-wybierz-wyniki').html(response); } }) $('#kategorie-wybierz').show(); $('#zamknij-kategorie').click(function(){ $('#kategorie-wybierz').hide(); }); }); $('.category').livequery('click', function(){ $.ajax({ type: get, url: $(this).attr('href'), beforeSend: function(response){ $(#kategorie-wybierz-wyniki).html(bar_loading); }, success: function(response){ if (response == '') { response=lastresult; $('#kategorie-wybierz-wyniki').html(msg_brakpodkategori +response); }else{ lastresult=response; $('#kategorie-wybierz-wyniki').html(response); } } }); $('#kategorie-wstecz').html('a href='+backlink+'wstecz/a'); return false; }); $('#categoty-back a').livequery('click', function(){ $.ajax({ type: get, url: $(this).attr('href'), beforeSend: function(response){ $(#kategorie-wybierz-wyniki).html(bar_loading); }, success: function(response){ if (response == '') { response=lastresult; $('#kategorie-wybierz-wyniki').html(msg_brakpodkategori +response); }else{ lastresult=response; backlink=link; $('#kategorie-wybierz-wyniki').html(response); } } }); $('#kategorie-wstecz').html('a href='+backlink+'wstecz/a'); return false; }); })
[jQuery] Re: weird issue with ready event
I've seen this before, it seems the 'ready' doesn't fire on opened windows or frames, you have to use $(pop).load(fn) instead. On Jan 16, 1:11 pm, graphicsxp graphic...@googlemail.com wrote: Hello, I'm trying to set the html content of a DIV (id='list') which sits in a page opened with window.open : var pop = window.open(PrintList.aspx); $(pop.document).ready(function() { $(#list, pop.document).html(hello); }); As you can see, the string 'hello' should be written to the DIV once the page is loaded. Yet the first time I execute this script the string is never written. If I close the new window and I execute the script again, it will work. It's only the first time I execute it how weird.. Does anyone know why ? Thanks
[jQuery] Re: Display Loading Image While Ajax Content Loads
Whoops! I'm so used to getting email notifications for discussions...I just figured no one had replied! So sorry for not coming back. Thank you both for your replies. I was wondering if that might be the case JQuery Lover. Would there be a way to generalize the .load for only images with a certain class? I tried working with the .load before and was unsuccessful, perhaps you might be able to give me a few pointers. For example if I give an image a class of gallery as well as loader I can set the background image for the loader class to a load icon. And .load would fire when any image with the class of gallery loads (right?). I guess I could give gallery' display:none by default? and then when it loads I can remove that css and also remove the class loader. I'm pretty new to all this, so I'm probably way off in my logic! Any more help would be appreciatednow to try and find the setting where I get email notifications on reply! Thanks so much again, and sorry it took me so long to reply! On Jan 14, 8:48 am, jQuery Lover ilovejqu...@gmail.com wrote: Unfortunately it will not. jQuery will know that it is getting some data and that is all. It does not know that it's html, xml or plain text. Image loading is done by browser when you insert the markup into the DOM. So the workaround would be to load your content then add it to the DOM, bind count how many images you have and then add a .load() event to every image that calls some function which checks if it's the last image that loaded and then only remove the animation and show the content. Damn, it was a long sentence :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Wed, Jan 14, 2009 at 6:40 PM, Beres Botond boton...@gmail.com wrote: Maybe you'll have more luck with this. // display loading animation here $(#ajax_content).load('/sourcefiles/example.html', {}, function() { // hide loading animation here }); However I'm still not sure if it will actually wait till images are downloaded. On Jan 14, 7:14 am, jinscoe jackins...@gmail.com wrote: Hello - I'm sorry if this posts twiceits been about 30 minutes or so since I last attempted and I still haven't seen my discussion pop up. I would guess this is a fairly easy task and I'm just missing the boat, because you see loading images everywhere with ajax loading. Here is my situation. I have a webpage that is set up a lot like a basic slide show - forward and back controls at the bottom a header at the top and an ajax loading window in the middle. I am using this function to make the ajax call: $.get('/sourcefiles/example.html', function(innerHtml){ $('#ajax_content').html(innerHtml); }); So right now I'm just getting the html and popping it into my ajax_content div. I would like to make it so that it waits until the entire content of the html (images and all) loads before displaying anything. Currently it seems to wait for the just the html (text) to load and then continues to load the images on screen. I would like to just make a class called .loading or something, put a loading background image on it and strip that off once everything is loaded. Hopefully I have been clear enough. Let me know if anything needs more explaining and thanks in advance for any help!
[jQuery] Re: jQuery Ajax, getting data returned from my PHP script
try: echo$ajax_validation_response; instead of return $ajax_validation_response; in your PHP script
[jQuery] Re: jQuery Ajax, getting data returned from my PHP script
hhmmmpppf yep that helps, getting data returned now. many thanks On Jan 16, 5:24 pm, Stephan Veigl stephan.ve...@gmail.com wrote: try: echo$ajax_validation_response; instead of return $ajax_validation_response; in your PHP script
[jQuery] Re: Autocomplete - Minimum Size of Possible Matches
Are you using MySQL? You can change the default minimum word length. See this page: http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html Also, the stop-word list can be adjusted: http://dev.mysql.com/tech-resources/articles/full-text-revealed.html On Thu, Jan 15, 2009 at 11:25 PM, JP pheas...@sunlabmedia.com wrote: Has anyone else run in to an issue with autocomplete not returning matches of less than five characters? I have it searching for matches starting at 2 characters, but for some reason it sits at the 'Loading' message if the only match is only 4 characters long? (For example, I'm typing in 'Ko' and it won't find the name 'Koch' in the list.) I've replicated this with a few possible matches that are 4 characters long, consistently fails. However, if I increase that name to 5 characters it works fine. Any suggestions? Thanks, Joel
[jQuery] Re: Permit jQuery-wrapped DOM elements not currently in DOM as messages
An example use case is where the element is clone()'d. var dispMenu = $('#widgetChooser').clone(true); $.blockUI({message: dispMenu}); On Dec 5 2008, 5:33 pm, harningt harni...@gmail.com wrote: CurrentlyblockUImakes the assumption that any jQuery element that is passed in is a 'real' DOM element. To fix this, also check that the element also has a parent when performing operations on the parent.
[jQuery] validate and form plugins
i have a table with an edit button in each row. when the edit button is clicked, the following script is run: //edit click $('#edit_lnk_' + index).click(function() { Boxy.get('#cancel_changes_lnk').show(); $('#ddlProjects').clearSelect(); $('#ddlTasks').clearSelect(); populateBoxy(index); }); function populateBoxy(index) { SetupFormValidationRules(); //...more code } function SetupFormValidationRules() { $('#add_edit_form').validate({ errorPlacement: function(error, element) { error.appendTo(element.next()); }, rules: { tbxHours: { required: true, //number: true, min: .25 }, ddlProjects: { required: function(element) { return $('#ddlProjects')[0].selectedIndex == 0; } } }, messages: { tbxHours: { required: br/Hour field is required., //number: Hour field must be a number., min: br/Hour field must be a value greater than or equal to 15 min (.25) }, ddlProjects: { required: br/You must select a project } }, submitHandler: function(form) { var options = { url: '/Time/SaveTimeActivity', type: 'POST', contentType: application/x-www-form-urlencoded, success: function(result, status) { Boxy.get('#cancel_changes_lnk').hide(); GetDay(_tabIndex); }, resetForm: true, error: function(xhr, status, thrownError) { if (xhr.getResponseHeader(SafeErrorMessage)) { SetStatusMessage(Error); alert(xhr.getResponseHeader(SafeErrorMessage)); } else { SetStatusMessage(Unknown error occurred); alert(Unknown Error: Please contact technical support); } document.body.style.cursor = 'default'; } } $(form).ajaxSubmit(options); return false; } }).resetForm(); } the first time the form [#add_edit_form] is submitted, the ajax submit works great and everything is great(the modal hides, grid repopulated with new data, etc). then, when i click any other edit button on the grid, the modal reappears with all the correct data, but when i hit submit, a default submit occurs (no ajaxSubmit) any help would be appreciated! thanks -- View this message in context: http://www.nabble.com/validate-and-form-plugins-tp21503313s27240p21503313.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Load page after succesfull validation
Hi all, I am struglin' for a while to load a PHP file after a succesfull validation with the beautiful Basisstance Validation plugin. How can I use the submitHandler to load an external PHP file and please the data in the right target? submitHandler: function(form) { jQuery(form).ajaxSubmit({ // load test.php by the GET method target: #right }); }, Somebody got an idea how to fix this? Thx!
[jQuery] newbie - cluetip
Goodmorning I'm completely new to jquery and java script. I'm a graphic designer and learned some basic scripting by meself. So please don't shoot me if my code is a mess. However I want to change the menu on this site www.moof.be/intro.html with a cluetip. I already made some changes to it http://www.moof.be/nieuw/intro2.html but I only seem to get one link working. The first one (working means it pops up but the content seems not to get loaded -) it works offline but onlinne I get a error) The other two links are identical but don't pop up at all. Can anyone help me? thanxs! -- mvg jurgen Signature {moof’} graphic design Steenland 46 | 8930 Rekkem | 0498 84 42 62 | www.moof.be
[jQuery] load question
i'm stuck on a pretty basic concept. on hovers of a's, i'm trying to load an element from another page by url and id into a display div. i'm trying to get those 2 bits of info from the triggering a. i'm close: the product matches a hard coded string, but doesn't load (the way the hard coded version does) any tips at all (other than consult the docs--i've tried, i'm learning.) on doing this, or streamlining my caveman work will be insanely appreciated. thanks! $(document).ready(function() { var defHref; var defHrefSplit; var defUrl; var defId; var defList; $(a).hover( // over function () { defHref = $(this).attr(href); defHrefSplit = defHref.split('#'); defUrl = defHrefSplit[0]; defId = #+defHrefSplit[1]; $(#display).append(span id='def'/span); // seems to eval correctly, but doesn't work $(#def).load(defUrl defId)); // the hard coded version (works) //$(#def).load(dictionary.html #puppy); }, // out function () { $(#display).find(#def).remove(); } ); }); an example a tag: a href=dictionary.html#puppiespuppies/a dev url: http://root-interactive.com/problems/
[jQuery] some help to modify a class plz
Hi, i have this html: ul class=dropdown li class=myaccountspansome text/span/li /ul and this code does not work: $(.myaccount).hover(function() { $(ul.dropdown li.myaccount_hover).removeClass (myaccount_hover).addClass(myaccount); }); how can i access to myaccount_hover class for work on it ? (here i want to change the class) thanks you veru much for your help ! Fredj from Paris
[jQuery] Re: jQuery Ajax, getting data returned from my PHP script
is the post actually getting to your .php? if so, what does your alert say? does it say Data Saved: anything? ? another thing to consider: there is a validation plugin that would benefit your needs along with the jquery form plugin that allows you to submit the form via ajax. that way, you don't need to go to the server to validate. btw, i'm not too familiar with php On Jan 16, 11:04 am, gemmes variouspix...@googlemail.com wrote: Hi All, I created a form and decided to add some AJAX. What I want to do is add a span class=required*/span next to my required label elements and change to span class=valid*/span when the AJAX blur event validates each of my fields. My problem, when I run the script I get no data returned from my ajax- validation.php script. Can anyone help?? many thanks gemmes // SELECTED JAVASCRIPT /* AJAX Form */ $('#submit').click(function() { // using click instead of blur while in development var name = $('input#name').val(); var email = $('input#email').val(); var message = $('textarea#message').val(); $.ajax({ type: 'POST', url: 'ajax-validation.php', data: 'name=' + name + 'email=' + email + 'message=' + message, success: function(results) { alert( Data Saved: + results ); // This alert has given me no feedback - always blank } }); // end ajax return false; }); // End .click() // SELECTED PHP ?php /* InputFields */ $ajax_validation_name = trim($_POST['name']); $ajax_validation_email = $_POST['email']; $ajax_validation_message = $_POST['message']; $ajax_validation_response = array(); // $name if (strlen($ajax_validation_name) 2) { $ajax_validation_response ['name'] = Please enter your name. 2; } // $email if (!preg_match('/^[a-z0-9\'\.\-_\...@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+ [a-z]{2}/is', $ajax_validation_email)) { $ajax_validation_response['email'] = Please enter a valid email address 2; } // $message if (strlen($ajax_validation_message) 1) { $ajax_validation_response ['message'] = Please leave a message. 2; } return $ajax_validation_response; ?
[jQuery] Re: No element found when firing $.post()
I had the same issue. It was caused by my handler not actually returning anything.
[jQuery] question about changes to :not() in 1.3
Here I am trying to get every element which is not a div that contains another div. Is $(':not(div:has(div))') supposed to now be equivalent to $('*').not ($('div:has(div)')) or am I misunderstanding what the change was (I'm just getting started with jQuery)? Thanks!
[jQuery] Autocomplete
Hi, In IE6 we find that if we have a combo box below the Autocomplete text box, the combo box displays on top of the item selection list that is displayed. Is there a work around for this. Thanks Anurag
[jQuery] How to? Multiple Colored Accordion...
I have found plenty of accordion tutorials online, however, I'm trying to create an accordion with multiple colors for each section (that don't change when clicked.) Here is an example of what I am trying to accomplish: http://blackstonemediaonline.com/dump/accordion.jpg Does anyone know of any tutorials or help you can give me?
[jQuery] Re: sorting a select list of option elements
Maybe use makeArray() first. Something like: $.makeArray($('#ops-memb option')).sort(... On Fri, Jan 16, 2009 at 11:04 AM, mtz tracey.zellm...@gmail.com wrote: I have a select list into which I place new option elements, and I want to show them in sorted order. I've searched around and tried some approaches, but not successful yet. Here is an example. It may not be the best use of jQuery, but at least I understand it. The select element has id ops-memb I get the current content, then add another option item. var members = $('#ops-memb').html() + option id='507'Another Item/ option; $'#ops-memb').html(members); This works. Now I try to sort $('#ops-memb option').sort(function(a,b) { return $(a).text() $(b).text() ? 1 : -1; }); I get an error message that $('#ops-memb').sort is not a function Could someone help me understand what I am doing wrong and how to get this to work correctly? Thanks.
[jQuery] validate and form plugins
i have a table with an edit button in each row. when the edit button is clicked, the following script is run: //edit click $('#edit_lnk_' + index).click(function() { Boxy.get('#cancel_changes_lnk').show(); $('#ddlProjects').clearSelect(); $('#ddlTasks').clearSelect(); populateBoxy(index); }); function populateBoxy(index) { SetupFormValidationRules(); //...more code } function SetupFormValidationRules() { $('#add_edit_form').validate({ errorPlacement: function(error, element) { error.appendTo(element.next()); }, rules: { tbxHours: { required: true, //number: true, min: .25 }, ddlProjects: { required: function(element) { return $('#ddlProjects')[0].selectedIndex == 0; } } }, messages: { tbxHours: { required: br/Hour field is required., //number: Hour field must be a number., min: br/Hour field must be a value greater than or equal to 15 min (.25) }, ddlProjects: { required: br/You must select a project } }, submitHandler: function(form) { var options = { url: '/Time/SaveTimeActivity', type: 'POST', contentType: application/x-www-form-urlencoded, success: function(result, status) { Boxy.get('#cancel_changes_lnk').hide(); GetDay(_tabIndex); }, resetForm: true, error: function(xhr, status, thrownError) { if (xhr.getResponseHeader(SafeErrorMessage)) { SetStatusMessage(Error); alert(xhr.getResponseHeader (SafeErrorMessage)); } else { SetStatusMessage(Unknown error occurred); alert(Unknown Error: Please contact technical support); } document.body.style.cursor = 'default'; } } $(form).ajaxSubmit(options); return false; } }).resetForm(); } the first time the form [#add_edit_form] is submitted, the ajax submit works great and everything is great(the modal hides, grid repopulated with new data, etc). then, when i click any other edit button on the grid, the modal reappears with all the correct data, but when i hit submit, a default submit occurs (no ajaxSubmit) any help would be appreciated! thanks
[jQuery] Re: sorting a select list of option elements
Only true arrays will inherit the sort method. On Jan 16, 10:10 am, brian bally.z...@gmail.com wrote: Maybe use makeArray() first. Something like: $.makeArray($('#ops-memb option')).sort(... On Fri, Jan 16, 2009 at 11:04 AM, mtz tracey.zellm...@gmail.com wrote: I have a select list into which I place new option elements, and I want to show them in sorted order. I've searched around and tried some approaches, but not successful yet. Here is an example. It may not be the best use of jQuery, but at least I understand it. The select element has id ops-memb I get the current content, then add another option item. var members = $('#ops-memb').html() + option id='507'Another Item/ option; $'#ops-memb').html(members); This works. Now I try to sort $('#ops-memb option').sort(function(a,b) { return $(a).text() $(b).text() ? 1 : -1; }); I get an error message that $('#ops-memb').sort is not a function Could someone help me understand what I am doing wrong and how to get this to work correctly? Thanks.
[jQuery] Re: sorting a select list of option elements
http://docs.jquery.com/Utilities/jQuery.makeArray#obj -- snip -- jQuery.makeArray( obj ) Turns anything into a true array. -- snip -- On Fri, Jan 16, 2009 at 1:25 PM, Kean shenan...@gmail.com wrote: Only true arrays will inherit the sort method. On Jan 16, 10:10 am, brian bally.z...@gmail.com wrote: Maybe use makeArray() first. Something like: $.makeArray($('#ops-memb option')).sort(... On Fri, Jan 16, 2009 at 11:04 AM, mtz tracey.zellm...@gmail.com wrote: I have a select list into which I place new option elements, and I want to show them in sorted order. I've searched around and tried some approaches, but not successful yet. Here is an example. It may not be the best use of jQuery, but at least I understand it. The select element has id ops-memb I get the current content, then add another option item. var members = $('#ops-memb').html() + option id='507'Another Item/ option; $'#ops-memb').html(members); This works. Now I try to sort $('#ops-memb option').sort(function(a,b) { return $(a).text() $(b).text() ? 1 : -1; }); I get an error message that $('#ops-memb').sort is not a function Could someone help me understand what I am doing wrong and how to get this to work correctly? Thanks.
[jQuery] how can we set script/noscript tag html ?
we can get the .html() in script/noscript but once we want to write it back, we got error e.g. $(script).html(var a=123); Unexecpeted call to method or property access
[jQuery] Re: sorting a select list of option elements
Thanks. I can make the array now and it legitimately sorts. However, I can't see an easy way to get the values in the array back into the option id='123''A name/option format again, so I can put teh HTML into the select . On Jan 16, 1:33 pm, brian bally.z...@gmail.com wrote: http://docs.jquery.com/Utilities/jQuery.makeArray#obj -- snip -- jQuery.makeArray( obj ) Turns anything into a true array. -- snip -- On Fri, Jan 16, 2009 at 1:25 PM, Kean shenan...@gmail.com wrote: Only true arrays will inherit the sort method. On Jan 16, 10:10 am, brian bally.z...@gmail.com wrote: Maybe use makeArray() first. Something like: $.makeArray($('#ops-memb option')).sort(... On Fri, Jan 16, 2009 at 11:04 AM, mtz tracey.zellm...@gmail.com wrote: I have a select list into which I place new option elements, and I want to show them in sorted order. I've searched around and tried some approaches, but not successful yet. Here is an example. It may not be the best use of jQuery, but at least I understand it. The select element has id ops-memb I get the current content, then add another option item. var members = $('#ops-memb').html() + option id='507'Another Item/ option; $'#ops-memb').html(members); This works. Now I try to sort $('#ops-memb option').sort(function(a,b) { return $(a).text() $(b).text() ? 1 : -1; }); I get an error message that $('#ops-memb').sort is not a function Could someone help me understand what I am doing wrong and how to get this to work correctly? Thanks.
[jQuery] Re: how can we set script/noscript tag html ?
For the same reason you can't replace the fan on an engine while it's running? Use $.getScript() On Jan 16, 1:42 pm, cc96ai calvin.chan@gmail.com wrote: we can get the .html() in script/noscript but once we want to write it back, we got error e.g. $(script).html(var a=123); Unexecpeted call to method or property access
[jQuery] Re: Autocomplete
Right off the plugin's homepage http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ -- * optional: bgiframe plugin to fix select-problems in IE, just include to apply to autocomplete -- that is what is needed to fix your issue On Jan 16, 12:10 pm, avagarwal avagar...@gmail.com wrote: Hi, In IE6 we find that if we have a combo box below the Autocomplete text box, the combo box displays on top of the item selection list that is displayed. Is there a work around for this. Thanks Anurag
[jQuery] Re: sorting a select list of option elements
You'll need to save the output into a variable, then loop through that to create new options and replace the existing ones. var new_opts = $.makeArray($('#ops-memb option')).sort(... There's probably a neat jQuery way to do all of this compactly. On Fri, Jan 16, 2009 at 1:44 PM, mtz tracey.zellm...@gmail.com wrote: Thanks. I can make the array now and it legitimately sorts. However, I can't see an easy way to get the values in the array back into the option id='123''A name/option format again, so I can put teh HTML into the select . On Jan 16, 1:33 pm, brian bally.z...@gmail.com wrote: http://docs.jquery.com/Utilities/jQuery.makeArray#obj -- snip -- jQuery.makeArray( obj ) Turns anything into a true array. -- snip -- On Fri, Jan 16, 2009 at 1:25 PM, Kean shenan...@gmail.com wrote: Only true arrays will inherit the sort method. On Jan 16, 10:10 am, brian bally.z...@gmail.com wrote: Maybe use makeArray() first. Something like: $.makeArray($('#ops-memb option')).sort(... On Fri, Jan 16, 2009 at 11:04 AM, mtz tracey.zellm...@gmail.com wrote: I have a select list into which I place new option elements, and I want to show them in sorted order. I've searched around and tried some approaches, but not successful yet. Here is an example. It may not be the best use of jQuery, but at least I understand it. The select element has id ops-memb I get the current content, then add another option item. var members = $('#ops-memb').html() + option id='507'Another Item/ option; $'#ops-memb').html(members); This works. Now I try to sort $('#ops-memb option').sort(function(a,b) { return $(a).text() $(b).text() ? 1 : -1; }); I get an error message that $('#ops-memb').sort is not a function Could someone help me understand what I am doing wrong and how to get this to work correctly? Thanks.
[jQuery] Re: sorting a select list of option elements
Yeah - I think this is getting too complicated. I actually am only inserting one item at a time. Rather than sort, I think I only need to go through the existing items which are already in alphabetical order, and find where to insert the new one. On Jan 16, 1:58 pm, brian bally.z...@gmail.com wrote: You'll need to save the output into a variable, then loop through that to create new options and replace the existing ones. var new_opts = $.makeArray($('#ops-memb option')).sort(... There's probably a neat jQuery way to do all of this compactly. On Fri, Jan 16, 2009 at 1:44 PM, mtz tracey.zellm...@gmail.com wrote: Thanks. I can make the array now and it legitimately sorts. However, I can't see an easy way to get the values in the array back into the option id='123''A name/option format again, so I can put teh HTML into the select . On Jan 16, 1:33 pm, brian bally.z...@gmail.com wrote: http://docs.jquery.com/Utilities/jQuery.makeArray#obj -- snip -- jQuery.makeArray( obj ) Turns anything into a true array. -- snip -- On Fri, Jan 16, 2009 at 1:25 PM, Kean shenan...@gmail.com wrote: Only true arrays will inherit the sort method. On Jan 16, 10:10 am, brian bally.z...@gmail.com wrote: Maybe use makeArray() first. Something like: $.makeArray($('#ops-memb option')).sort(... On Fri, Jan 16, 2009 at 11:04 AM, mtz tracey.zellm...@gmail.com wrote: I have a select list into which I place new option elements, and I want to show them in sorted order. I've searched around and tried some approaches, but not successful yet. Here is an example. It may not be the best use of jQuery, but at least I understand it. The select element has id ops-memb I get the current content, then add another option item. var members = $('#ops-memb').html() + option id='507'Another Item/ option; $'#ops-memb').html(members); This works. Now I try to sort $('#ops-memb option').sort(function(a,b) { return $(a).text() $(b).text() ? 1 : -1; }); I get an error message that $('#ops-memb').sort is not a function Could someone help me understand what I am doing wrong and how to get this to work correctly? Thanks.
[jQuery] More efficient way to find Parent element
after learning the difference between parents and parent, I am having to resort to using parent(), but it's not very clean. Consider the following table, which is embedded in a page, which may have additional tables (for this reason I cannot use parents(table) because it returns multiple tables): table class=gridview id=A cellpadding=0 cellspacing=0 tbody tr class='gvheader' th width=20pxnbsp;/th th width=150pxHost/th th width=100pxDirects To/th th width=40pxTTL/th /tr tr class=dgalt id=trEmptyA runat=server visible=false td colspan=5You currently do not have any Records./td /tr tr class=gvfooter td colspan=4 class=newRecordAdd New Record/td /tr /tbody /table and now my jquery: Notice the multiple .parent().parent().parent() and $currentTable.children().children().size(); $(function() { $(.newRecord).click(function() { var $currentTable = $(this).parent().parent().parent (); var tableType = $currentTable.attr(id); var numRows = $currentTable.children().children().size (); var $templateRow = $(#EditRowTemplate).clone().attr (id, new+tableType+Record_+numRows); if (tableType=='MX'){ $(td:nth-child(5), $templateRow).show(); } else { $(td:nth-child(5), $templateRow).hide(); } $templateRow.insertAfter($(tr:last, $currentTable).prev()); }); }); Is there a way to use parents, while only selecting the immediate parent table? and similarily with children, is there a better way to do this? I cannot always assume this is the first table, there may be 3,4,5 etc tables side-by-side. Thanks
[jQuery] How do I abort a function?
If I want to abort a function based on a condition, what is the command to do that? if x == 0 abort this function... Thanks, Rick
[jQuery] Re: How do I abort a function?
return; - Original Message - From: Rick Faircloth r...@whitestonemedia.com To: jquery-en@googlegroups.com Sent: Friday, January 16, 2009 2:34:39 PM GMT -05:00 US/Canada Eastern Subject: [jQuery] How do I abort a function? If I want to abort a function based on a condition, what is the command to do that? if x == 0 abort this function... Thanks, Rick
[jQuery] Re: How do I abort a function?
Thanks! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Donald J. Organ IV Sent: Friday, January 16, 2009 2:41 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: How do I abort a function? return; - Original Message - From: Rick Faircloth r...@whitestonemedia.com To: jquery-en@googlegroups.com Sent: Friday, January 16, 2009 2:34:39 PM GMT -05:00 US/Canada Eastern Subject: [jQuery] How do I abort a function? If I want to abort a function based on a condition, what is the command to do that? if x == 0 abort this function... Thanks, Rick
[jQuery] Re: question about changes to :not() in 1.3
$(':not(div:has(div))') is equivalent to $('*:not(div:has(div))') is equivalent to $('*').filter(':not(div:has(div))') is equivalent to $('*').not('div:has(div)') Hope that helps to answer your question :) --John On Fri, Jan 16, 2009 at 11:24 AM, jdwbell jdwb...@gmail.com wrote: Here I am trying to get every element which is not a div that contains another div. Is $(':not(div:has(div))') supposed to now be equivalent to $('*').not ($('div:has(div)')) or am I misunderstanding what the change was (I'm just getting started with jQuery)? Thanks!
[jQuery] cluetip not loading external web page
I have setup the cluetip plugin on my website. I was able to get it working when using local content, similar to the example code of $ ('a.title').cluetip({splitTitle: '|'}); However, I can't get it to load an external website. The tool tip comes up, but it says sorry the contents cannot be loaded. The external site is a servlet rendered page that loads fine if I type the URL into a browser window. The only differences between my code and the example is that I'm using an image for the link and am using livequery. a title=Help rel=/portlets/help.do href=/portlets/help.do class=help style= img class=icon src=/theme/images/portlet/help.png alt=Help/ /a jQuery(a.help).livequery(function() { jQuery(this).cluetip(); });
[jQuery] jQuery 1.3 live() vs listen/intercept plugins
I'm trying to understand where the new live() fits in to the world of event delegation, and plugins like listen and intercept What are the arguments for one approach over the other? thanks!
[jQuery] Re: question about changes to :not() in 1.3
Thank you very much for your reply. I am finding that with the example listed below these two work as expected (that is they are returning non divs and all divs which do not contain other divs): $('*').not('div:has(div)') $('*').not($('div:has(div)')) but these three: $(':not(div:has(div))') $('*:not(div:has(div))' $('*').filter(':not(div:has(div))') are excluding ALL divs as all other elements which contain divs Hopefully that explanation makes because I'm kind of confusing myself! I've tried this on IE 6 and Chrome with the same results. Thanks! html head style div, fieldset, p { border: ridge 1px silver; padding: 20px; margin: 20px; } .wrappedElement { border: ridge 2px #FF; } /style script type=text/javascript src=../../scripts/jquery-1.3.js/script script $(function(){ $(':not(div:has(div))').addClass('wrappedElement'); //$('*:not(div:has(div))').addClass('wrappedElement'); //$('*').filter(':not(div:has(div))').addClass('wrappedElement'); //$('*').not('div:has(div)').addClass('wrappedElement'); //$('*').not($('div:has(div)')).addClass('wrappedElement'); }) /script /head body div div div pparagraph surrounded by three divs/p /div /div /div fieldset div div surrounded by fieldset /div /fieldset /body /html On Jan 16, 1:50 pm, John Resig jere...@gmail.com wrote: $(':not(div:has(div))') is equivalent to $('*:not(div:has(div))') is equivalent to $('*').filter(':not(div:has(div))') is equivalent to $('*').not('div:has(div)') Hope that helps to answer your question :) --John On Fri, Jan 16, 2009 at 11:24 AM, jdwbell jdwb...@gmail.com wrote: Here I am trying to get every element which is not a div that contains another div. Is $(':not(div:has(div))') supposed to now be equivalent to $('*').not ($('div:has(div)')) or am I misunderstanding what the change was (I'm just getting started with jQuery)? Thanks!
[jQuery] Re: jQuery in a Firefox Extension...
Hm, that makes sense. So, I suppose I could do something like jQuery.noConflict(); var doc = window.content.document; jQuery(#id, doc); Which would solve the issue that jQuery doesn't live in the HTML anymore (and lives in the browser). But how would this work on .ajax functions? Do I have to edit the instantiation/references in the first couple lines of jQuery to point somewhere other than window? Or will functions like .ajax (that don't browse the DOM) only work when there is a document to access (as opposed to on load of Firefox)? Thanks- On Fri, Jan 16, 2009 at 9:29 AM, Eric Garside gars...@gmail.com wrote: I'm pretty sure the problem is that jQuery is defining itself in it's header section as something like window.jQuery = jQuery = $ or some such referential transitive equation strand. I'm not an expert at FF plugins, but I have gone through the motions of building one that modified current pages only. And to get to that page, you had to invoke a special call to get access to the current tabs current page html. I'd look into that, and get to the point where you can alert the innerHTML of a page element. That's how I first started to learn it. I just wish I hadn't already forgotten. :P On Jan 15, 11:37 pm, Nic nic.luci...@gmail.com wrote: It seems like this has been asked a million times, but nothing seems to answer my question. I include it in my .xul above my other scripts- (I checked the location and it's correct). It's the first time I've used jQuery in an extension, so I'm trying to run some commands on load just to see if it works. The following below throws no exceptions: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); } catch(e) { alert(e); } } Below I'll list a bunch of things I tried with their respective errors to maybe help give a glimpse into whats going on... What's going on here? I'm sure it's something obvious, or simple... The following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); alert(jQuery(body)); } catch(e) { alert(e); } } Throws: TypeError: n.find is not a function The Following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { $.getJSON(http://www.google.com/;, function(data) { alert(data); }); } catch(e) { alert(e); } } Throws: TypeError: $.getJSON is not a function The Following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); jQuery.getJSON(http://www.google.com/;, function(data) { alert(data); }); } catch(e) { alert(e); }} Throws: TypeError: jQuery.getJSON is not a function Thanks, guys!