[jQuery] Re: Case Insentitive Selectorys
Nothing? On Sep 20, 5:22 pm, blockedmind [EMAIL PROTECTED] wrote: I am making search in an xml file, but I don't get expected results since jQuery selectors arecase-sensitive. I use something like $(returnedXml).find(item[name*='+search+']).each(function(){ }); How to make it INCASE-SENSITIVE?
[jQuery] Re: Treeview problem with checkboxes in IE
Can you build a testpage that doesn't require any browser plugins to install first? Jörn On Mon, Sep 22, 2008 at 7:19 AM, mrhankey [EMAIL PROTECTED] wrote: I also just noticed that the problem goes away when I turn animation off (although the plus/minus icons still display erratically on the last parent node in the list). I have left animation on for now so that you can see the problem. On Sep 22, 12:10 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: I don't see any checkboxed-tree on that page. Below the google earth box are only navigation and print links. Jörn On Sat, Sep 20, 2008 at 10:43 PM, mrhankey [EMAIL PROTECTED] wrote: The page is: test.cloudbase.org.nz/node/126 The list is below the google earth plugin. It is populated by a script in the page. It is running in Drupal 5.7 but I have patched it up to jQuery 1.2.6 Cheers On Sep 21, 12:40 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Could you post a testpage? On Sat, Sep 20, 2008 at 9:35 AM, mrhankey [EMAIL PROTECTED] wrote: I have set up a tree usingTreeviewwhere each list item includes a checkbox input. This works perfectly on Firefox but withIE6 7 every time I expand a tree branch the checkboxes in the branch all disappear almost immediately after the branch opens. Furthermore, when I mouse over a parent node one child checkbox immediately above and below the node reappear. Has anyone else experienced this problem? Any solutions?
[jQuery] Re: Validate with bassistance local bug
Thank you, I will try that. Regards, Kevin On Sep 20, 5:37 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Try to download the complete package, which includes the demo and it's PHP files for remote validation:http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Jörn On Sat, Sep 20, 2008 at 2:23 AM,ripcurlksm[EMAIL PROTECTED] wrote: On this demo: http://jquery.bassistance.de/validate/demo/milk/ I cant get the email validation to work on the second try locally. The above link works fine. If you submit an invalid email address it asks you to reenter it. Great. So I try to move it locally. I downloaded jQuery and the validation plugin. Everything works... except if I try an invalid email.. it throws an error, so I fix it to a valid email and hit submit... nothing. As a second try, I visited the above link, and downloaded the entire source using my browser... same issue. If you type the wrong email in and try to fix it, it will never validate. This demo works and this issue is not seen in the demo. What am I doing wrong? Regards, Kevin
[jQuery] Re: Insert variable into a selector
This is the JS code: $('.makeFavorite').click(function() { $.ajax({ type: POST, url: make_favorite.php, data: id= + $(this.id), success: function(msg) { alert('Data saved: ' + msg); $('h1 a#' + this.id + ' img').attr({src : images/+msg+.png}); } }); return false; }); The HTML code: h1{$ent.firma} a href={$ent.id} class=makeFavorite id={$ent.id} title=Save favoriteimg src=images/{if $ent.favorit == 1}favorites.png{else}favorites2.png{/if} width=16 height=16 alt= //a/h1 Both variables don't do what what I expect them to do. The first doesn't find the correct target/id and the seccond doesn't insert the image correctly. But if I write down the id and the true path it works fine. What do I have to change? On 22 Sep., 05:42, ricardobeat [EMAIL PROTECTED] wrote: I can't get it either, what are you trying to accomplish? $('h1 a#' + this.id') is not logical, you first need to reference some a element to get it's ID, but in doing that you already wrote the ID... On Sep 21, 11:16 pm, FrenchiINLA [EMAIL PROTECTED] wrote: i think your problem is this.id, you have to show the entire code in order for us to see what does this mean. try just to add a alert for example to see what you get for this.id On Sep 21, 7:38 am, suntrop [EMAIL PROTECTED] wrote: HI there, I want to insert two variables into the selector and an attribute. But it doesn't work. $('h1 a#' + this.id + ' img').attr({src : images/ + msg + .png}); I looked through various tutorials but couldn't find an answer to this. The first variable comes from the object's (a element) id and the seccond is a response from an php script. Can somebody please help me?
[jQuery] Re: Case Insentitive Selectorys
Maybe try using filter and a regexp for the part that you want to be case insensitive. Something like (very untested): $(...).find('item').filter(function() { return this.name.match(new RegExp(search, 'i')); }).each(function() { }); I don't recall the syntax for accessing an XML attribute from javascript, so the this.name part might be wrong. Maybe you need $(this).attr('name') instead. Also, you might want to be doing more than just passing the search into a RegExp, but you get the idea. Also, maybe reconsider what you're trying to do. Maybe just return your xml such that it's already been converted to lower case, then just do what you were doing before except use search.toLowerCase() instead of just search. Hope it helps. --Erik On Mon, Sep 22, 2008 at 12:35 AM, blockedmind [EMAIL PROTECTED] wrote: Nothing? On Sep 20, 5:22 pm, blockedmind [EMAIL PROTECTED] wrote: I am making search in an xml file, but I don't get expected results since jQuery selectors arecase-sensitive. I use something like $(returnedXml).find(item[name*='+search+']).each(function(){ }); How to make it INCASE-SENSITIVE?
[jQuery] Re: Insert variable into a selector
According to the docs, 'this' within a success callback is the options object, so 'this.id' doesn't mean anything useful: http://docs.jquery.com/Ajax/jQuery.ajax#options Also, $(this.id) probably isn't anything useful either. Maybe try this (untested): $('.makeFavorite').click(function() { var id = this.id; $.ajax({ type: POST, url: make_favorite.php, data: id= + id, success: function(msg) { alert('Data saved: ' + msg); $('#' + id + ' img').attr({src : images/+msg+.png}); } }); return false; }); Hope it helps. --Erik On Mon, Sep 22, 2008 at 1:16 AM, suntrop [EMAIL PROTECTED] wrote: This is the JS code: $('.makeFavorite').click(function() { $.ajax({ type: POST, url: make_favorite.php, data: id= + $(this.id), success: function(msg) { alert('Data saved: ' + msg); $('h1 a#' + this.id + ' img').attr({src : images/+msg+.png}); } }); return false; }); The HTML code: h1{$ent.firma} a href={$ent.id} class=makeFavorite id={$ent.id} title=Save favoriteimg src=images/{if $ent.favorit == 1}favorites.png{else}favorites2.png{/if} width=16 height=16 alt= //a/h1 Both variables don't do what what I expect them to do. The first doesn't find the correct target/id and the seccond doesn't insert the image correctly. But if I write down the id and the true path it works fine. What do I have to change? On 22 Sep., 05:42, ricardobeat [EMAIL PROTECTED] wrote: I can't get it either, what are you trying to accomplish? $('h1 a#' + this.id') is not logical, you first need to reference some a element to get it's ID, but in doing that you already wrote the ID... On Sep 21, 11:16 pm, FrenchiINLA [EMAIL PROTECTED] wrote: i think your problem is this.id, you have to show the entire code in order for us to see what does this mean. try just to add a alert for example to see what you get for this.id On Sep 21, 7:38 am, suntrop [EMAIL PROTECTED] wrote: HI there, I want to insert two variables into the selector and an attribute. But it doesn't work. $('h1 a#' + this.id + ' img').attr({src : images/ + msg + .png}); I looked through various tutorials but couldn't find an answer to this. The first variable comes from the object's (a element) id and the seccond is a response from an php script. Can somebody please help me?
[jQuery] Re: docs.jquery.com status update
I hate to revive a more-or-less dead thread, but this problem is still occurring as far as I can see. The docs. subdomain doesn't just host the documentation, so the other sources are of no use. It happens to host a good portion of the content regarding release notes, download notes, tutorials, the discussions, and credits. If this were a non-tech-oriented community this might be understandable, but really this is absurd. MediaTemple has had issues with this for several months now. I think their time has run out. I'm sure that between all of the people willing to help out a better solution can be had. On Jul 29, 8:40 am, Lance McCulley [EMAIL PROTECTED] wrote: I figure you're completely aware that docs.jquery.com is not responding, but I'm wondering if there is a status update? And, on a side note, how would I setup a loop to remove all child elements of a particular element? Thanks! -Lance
[jQuery] Re: Insert variable into a selector
Hi Can you show more code? I think showing an alert would be a good idea. On Sep 22, 12:38 am, suntrop [EMAIL PROTECTED] wrote: HI there, I want to insert two variables into the selector and an attribute. But it doesn't work. $('h1 a#' + this.id + ' img').attr({src : images/ + msg + .png}); I looked through various tutorials but couldn't find an answer to this. The first variable comes from the object's (a element) id and the seccond is a response from an php script. Can somebody please help me?
[jQuery] ajax request with datatype:script
I am trying to insert array elements through ajax request, these elements are also arrays or multidimensional arrays. here is an example main script : var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: script, success: function(data){ alert( list[1][0] ); } }); ids.js contents: list[1] = [['aaa', 'bbb'], ['ccc', 'ddd']]; that would produce ' list is undefined' error but changing datatype to 'html' and adding eval() would work fine var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: html, success: function(data){ eval( data); alert( list[1][0] ); } }); any ideas what am i doing wrong ?
[jQuery] Superfish and wordpress - menus show up only on first page...?
Hi everyone! first off I'm a newbie using Superfish, but I just wanted to see if anyone has had the following problem: I was able to get the superfish vertical dropdown menu working on this site for the front page; however, when I use superfish for any sub pages it does not work; what happens is that all the sub menus appear on the same level as the rest of the menu items. you can check it out here: http://www.townofross.org I'll have to take it down in a couple of hours...but hopefully someone out there is still up! here is what I did: 1.) created a css dropdown menu 2.) added jquery includes/style sheets to the head of each header file(there is one for each page/main menu item) thanks in advance, and I hope this makes sense!!
[jQuery] JSON data issue in IE | Language Translation
Hi All, Hope, you all would be doing well. I am trying to create a language translation utility using jQuery for some specific words only, seems working fine in Firefox but don’t do well in IE 6/7. Given is the JSON file, where I map headings which needs to be translated in French. JSON Data: { download : télécharger, categories : sujets d'actualité, recent_comments : mais que l'histoire de l', recent posts : Messages Récents, also worthy : aussi digne, archieves : archives, } I am able to load my JSON file successfully using $.getJSON(), it translates in FF but does not do the same in IE 6/7. jQuery Method: function loadJSON(){ $.getJSON(json/data_ca_fr.json, function(json){ $(.json_trans).each(function(i){ //getting all the headings to translate switch($(.json_trans)[i].innerHTML) { case Download: // Start here if $(.json_trans)[i].innerHTML == download $(.json_trans)[i].innerHTML = json.download; break;// Stop here case Categories: // Start here if $(.json_trans)[i].innerHTML == download $(.json_trans)[i].innerHTML = json.categories; break;// Stop here default break; } }) }); } I am just comparing English words in the page through innerHTML because jQuery html() return the first array index only , defined span tag with .json_trans class for picking up all the required spans and do the translation. I know, it’s not the robust way to do the language translation but does require for client and it’s not AJAX at all, just calling the json file on dom ready. Any quick pointer/ suggestion should be appreciated. Thanks for your time Mohammed Arif http://www.mohammedarif.com
[jQuery] Re: Superfish navbar for Wordpress
Sweet! That was a nice and simple solution. It works but I realized that I'll have to change some of the CSS... :) Many Thanks! Müfit On Sep 21, 9:57 am, Joel Birch [EMAIL PROTECTED] wrote: I just thought of a really simple solution for this. Before initialising Superfish simply dynamically add one common class to the elements that are of any of three WordPress classes. $('document').ready(function(){ $('ul.sf-menu') .find('li.current_page_item,li.current_page_parent,li.current_page_ancestor') .addClass('current') .end() .superfish({ pathClass : 'current' }); }); Joel Birch. On 18/09/2008,kiper[EMAIL PROTECTED] wrote: Hi Joel! I am just happy if I can contribute to make Superfish even better! All the best, Müfit On Sep 18, 5:29 am, Joel Birch [EMAIL PROTECTED] wrote: Hi Müfit, Thanks for your well-articulated thoughts on this. I agree that being able to specify more that one pathClass would be very useful for WordPress generated menus. I will aim to get this in as a Superfish feature as soon as possible, although I'm snowed under with work for the next few weeks. Thanks again for the great feedback. I wish I could offer more immediate help. Joel Birch.
[jQuery] Re: forms
Hi, The easy option is if you could define what the maximum number of addresses you can enter. For this you would not need javascript. CGI (for example perl) would be sufficient. You would create a table of input elements where each row represents an address. If not it is a little complicated. You have to make a table with one input row. Then when clicking on a button you have to add another row in the table with input fields (with the append function). Anyway on the server side you would get them in input fields (cgi- param). Afterwards you could push them into a hash. This is a general answer. Hope it helps, David On Sep 21, 10:58 pm, johnmiller [EMAIL PROTECTED] wrote: hello, right upfront, please let me apologize for my ignorance. i'm a server dude and got stuck with some front end work and obviously too stupid not only to figure it out but even to formulate the question. hence, let me give my need statement: i need an input form that gathers user info including one or more addresses. on top of it, i need to return these inputs in a hash table -like structure, e.g. {'username':'joe', ...{'street':some lane', 'city':'some town', ...}, {'street':'dad's place', 'city':'boring village', ...}, ..., 'dob':'02/02/1985', ...}. as i said, i don;t even know what i need to type into google to find what i'm looking for. so any help, search terms, etc. are massively appreciated. many thanks, johnny
[jQuery] Re: simple wizard: stuck with first jquery usage
Hi, You could give all the divs a certain class, for example wizard. At the beginning make that just one will be visible. For the next and back you could find the index of the div which is visible with this function $('.wizard').index($('.wizard:visible)) Then you just make it invisible and the next or previous invisible. Just be aware of the corner cases where you don't have next and back (first and last). Good luck, David On Sep 21, 8:08 am, claudes [EMAIL PROTECTED] wrote: Hi, I would like to make a simple wizard. I have gotten as far as hiding all divs aside from the first, and inserting the next and back buttons. I'm having problems assigning click function to next/back next should hide current div and revel next div back hides current and revels previous markup (simplified): div id=content div class=step-oneform/form/div div class=step-twoform/form/div div class=step-threeform/form/div /div jquery: $(document).ready(function() { // assign buttons to divs $('#content div:not(:first)').hide(); // hide divs //$('div.step-two').hide(); //$('div.step-three').hide(); // insert buttons var next = $(' #next Next '); var back = $(' #back Back '); $(next).insertAfter('#content div[class*=step]:not(:last) form'); $(back).insertAfter('#content div[class*=step]:gt(0) form'); //wizard functionality $(next).click(function () { $('div.step-one').hide(); }); /*$('div.step-two a.next').click (function () { $('div.step-two').hide(); $('div.step-three').show(); }); $('div.step-two a.back').click (function () { $('div.step-one').show(); $('div.step-two').hide(); }); $('div.step-three a.back').click (function () { $('div.step-two').show(); $('div.step-three').hide(); }); */ }); I've left my initial script where I was calling out each div...issue is, number of divs is uncertain, so script needs to take that into factor and not call out each click function as I was doing. Any help, any modification truly welcome. I'd like to keep it as progressively enhanced as possible; hence hiding divs from js and inserting next/back via DOM. Thanks. -- View this message in context:http://www.nabble.com/simple-wizard%3A-stuck-with-first-jquery-usage-... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Adding Arrows to a DropDownMenu based on Lists
Good Morning Everyone, I am struggling a few hours with a problem, which solution isn't that easy as I initial though. The following example list is generated by backend code. ul id=nav li a id=hyperlink class=navlink href=/home title=Home/a /li lia id=hyperlink class=navlinkparent href= title=Folder A/a ul lia id=hyperlink class=navsublinkparent href=/folder_a/ page1 title=Page1/a /li lia id=hyperlink class=navsublinkparent href=/folder_b/ page2 title=Page2/a /li lia id=hyperlink class=navsublinkparent href= title=Folder B/a ul li a id=hyperlink class=navsubsublink href=/folder/page1 title=Page1/a /li li a id=hyperlink class=navsubsublink href=/folder/page2 title=Page2/a /li li a id=hyperlink class=navsubsublink href=/folder/page3 title=Page3/a /li /ul /ul Thats only a shortened version. JQuery is used to create a horizontal dropdown menu. Up to this part everything is working as expected. To improve the usability I want to add two kinds of arrows to the menu. One arrow down for the top elements and one arrow right for child entries. That part should accomplished by the following snippets. $(ul li a.navlinkparent).css({ background-image: url(/img/nav_arrow_down.gif), background-repeat: no-repeat, background-position: right center }); $(#nav ul li a.navsublinkparent).css({ background-image: url(/img/nav_arrow_right.gif), background-repeat: no-repeat, background-position: right center }); The problem I am facing right know is, that not every parent has childs and therefor it shouldn't get an arrow assigned. I tried various filters but without any luck. Does anyone has a hint on solving? best regards, Gordon
[jQuery] superfish style current top
I'am using the navbar example. I would like to set another color for the current top-level menu item if a submenu is selected current (like a breadcrumb). I've put li class=current in both the top-level menu and the submenu. I've figured out how to change the submenu current font color but I have trouble finding a solution for the top- level menu. Here is my css code: /*** adding the class sf-navbar in addition to sf-menu creates an all- horizontal nav-bar menu ***/ .sf-navbar { background: #fff; height: 1.4em; /* totale hoogte */ padding-bottom: 0.0em; /* totale hoogte */ position: relative; } .sf-navbar li { background: #fff; position: static; font: 12px Arial; color: #043882; font-weight:bold; text-transform: uppercase; } .sf-navbar a { border-top: none; } .sf-navbar li ul { width: 44em; /*IE6 soils itself without this*/ } .sf-navbar li li, .sf-navbar li li a { background: #fff; position: relative; font: 10px Arial; color: #9c9e9f; text-transform: uppercase; } .sf-navbar li li ul { width: 13em; /* width van sub sub menu */ } .sf-navbar li li li { width: 100%; } .sf-navbar ul li { width: auto; float: left; } .sf-navbar a, .sf-navbar a:visited { border: none; } .sf-navbar li:hover, .sf-navbar li.sfHover, .sf-navbar li li.current, .sf-navbar li li.current a, .sf-navbar a:focus, .sf-navbar a:hover, .sf-navbar a:active { background: #fff; color: #1e7bbc; /* hoofdmenu hover color */ } .sf-navbar ul li:hover, .sf-navbar ul li.sfHover, ul.sf-navbar ul li:hover li, ul.sf-navbar ul li.sfHover li, .sf-navbar ul a:focus, .sf-navbar ul a:hover, .sf-navbar ul a:active { background: #fff; color: #1e7bbc; /* submenu hover color */ } ul.sf-navbar li li li:hover, ul.sf-navbar li li li.sfHover, .sf-navbar li li.current li.current, .sf-navbar ul li li a:focus, .sf-navbar ul li li a:hover, .sf-navbar ul li li a:active { background: #fff; color: #1e7bbc; } ul.sf-navbar .current ul, ul.sf-navbar ul li:hover ul, ul.sf-navbar ul li.sfHover ul { left: 0; /* put sub sub back in view when hover */ top:1.5em; /* match top ul list item height */ } ul.sf-navbar .current ul ul { top:-999em; /* put sub sub out of view until hover */ } .sf-navbar li li.current a { font-weight:bold; } /*** point all arrows down ***/ /* point right for anchors in subs */ .sf-navbar ul .sf-sub-indicator { background-position: -10px -100px; } .sf-navbar ul a .sf-sub-indicator { background-position: 0 -100px; } /* apply hovers to modern browsers */ .sf-navbar ul a:focus .sf-sub-indicator, .sf-navbar ul a:hover .sf-sub-indicator, .sf-navbar ul a:active .sf-sub-indicator, .sf-navbar ul li:hover a .sf-sub-indicator, .sf-navbar ul li.sfHover a .sf-sub-indicator { background-position: -10px -100px; /* arrow hovers for modern browsers*/ } /*** remove shadow on first submenu ***/ .sf-navbar li ul { background: transparent; padding: 0; -moz-border-radius-bottomleft: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; -webkit-border-bottom-left-radius: 0; }
[jQuery] Re: Insert variable into a selector
you concatenate a string with an object.. On 22 Sep., 10:16, suntrop [EMAIL PROTECTED] wrote: This is the JS code: $('.makeFavorite').click(function() { $.ajax({ type: POST, url: make_favorite.php, data: id= + $(this.id), success: function(msg) { alert('Data saved: ' + msg); $('h1 a#' + this.id + ' img').attr({src : images/+msg+.png}); } }); return false;}); The HTML code: h1{$ent.firma} a href={$ent.id} class=makeFavorite id={$ent.id} title=Save favoriteimg src=images/{if $ent.favorit == 1}favorites.png{else}favorites2.png{/if} width=16 height=16 alt= //a/h1 Both variables don't do what what I expect them to do. The first doesn't find the correct target/id and the seccond doesn't insert the image correctly. But if I write down the id and the true path it works fine. What do I have to change? On 22 Sep., 05:42, ricardobeat [EMAIL PROTECTED] wrote: I can't get it either, what are you trying to accomplish? $('h1 a#' + this.id') is not logical, you first need to reference some a element to get it's ID, but in doing that you already wrote the ID... On Sep 21, 11:16 pm, FrenchiINLA [EMAIL PROTECTED] wrote: i think your problem is this.id, you have to show the entire code in order for us to see what does this mean. try just to add a alert for example to see what you get for this.id On Sep 21, 7:38 am, suntrop [EMAIL PROTECTED] wrote: HI there, I want to insert two variables into the selector and an attribute. But it doesn't work. $('h1 a#' + this.id + ' img').attr({src : images/ + msg + .png}); I looked through various tutorials but couldn't find an answer to this. The first variable comes from the object's (a element) id and the seccond is a response from an php script. Can somebody please help me?- Zitierten Text ausblenden - - Zitierten Text anzeigen -
[jQuery] Re: JSON data issue in IE | Language Translation
Even I got the issue, it's not been rendering because of French accented characters in IE. So what do I need to change the JSON character encoding? P.S: I don't have server control, can change the front end layer (xhtml/css/js/json) only, and will not be able to write any server side code otherwise I could have easily done it. Many thanks Mohammed Arif http://www.mohammedarif.com On Sep 22, 11:12 am, Arif [EMAIL PROTECTED] wrote: Hi All, Hope, you all would be doing well. I am trying to create a language translation utility using jQuery for some specific words only, seems working fine in Firefox but don’t do well in IE 6/7. Given is the JSON file, where I map headings which needs to be translated in French. JSON Data: { download : télécharger, categories : sujets d'actualité, recent_comments : mais que l'histoire de l', recent posts : Messages Récents, also worthy : aussi digne, archieves : archives, } I am able to load my JSON file successfully using $.getJSON(), it translates in FF but does not do the same in IE 6/7. jQuery Method: function loadJSON(){ $.getJSON(json/data_ca_fr.json, function(json){ $(.json_trans).each(function(i){ //getting all the headings to translate switch($(.json_trans)[i].innerHTML) { case Download: // Start here if $(.json_trans)[i].innerHTML == download $(.json_trans)[i].innerHTML = json.download; break;// Stop here case Categories: // Start here if $(.json_trans)[i].innerHTML == download $(.json_trans)[i].innerHTML = json.categories; break;// Stop here default break; } }) }); } I am just comparing English words in the page through innerHTML because jQuery html() return the first array index only , defined span tag with .json_trans class for picking up all the required spans and do the translation. I know, it’s not the robust way to do the language translation but does require for client and it’s not AJAX at all, just calling the json file on dom ready. Any quick pointer/ suggestion should be appreciated. Thanks for your time Mohammed Arifhttp://www.mohammedarif.com
[jQuery] Re: Help refactoring code for css sprite animation
Thanks Michael Your code worked right off the copy and paste. I knew there was a recursive procedure in there somewhere, but I'm just getting up to speed with Javascript after years of ignoring it due to the pain and suffering involved in writing cross platform stuff. Jquery has made me want to learn again. Thanks Again -- View this message in context: http://www.nabble.com/Help-refactoring-code-for-css-sprite-animation-tp19597457s27240p19604365.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] [sites using jQuery] adobe.com
dunno if anybody noticed, but adobe is using jQuery on some of their pages: http://opensource.adobe.com/wiki/display/site/Projects dennis.
[jQuery] Re: Insert variable into a selector
Thanks Erik. It helped! The id is inserted correctly. But the image isn't replaced correctly. What code should I sow you more Makisa? The other code isn't affected with this. What do you mean? On 22 Sep., 10:26, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: you concatenate a string with an object.. On 22 Sep., 10:16, suntrop [EMAIL PROTECTED] wrote: This is the JS code: $('.makeFavorite').click(function() { $.ajax({ type: POST, url: make_favorite.php, data: id= + $(this.id), success: function(msg) { alert('Data saved: ' + msg); $('h1 a#' + this.id + ' img').attr({src : images/+msg+.png}); } }); return false;}); The HTML code: h1{$ent.firma} a href={$ent.id} class=makeFavorite id={$ent.id} title=Save favoriteimg src=images/{if $ent.favorit == 1}favorites.png{else}favorites2.png{/if} width=16 height=16 alt= //a/h1 Both variables don't do what what I expect them to do. The first doesn't find the correct target/id and the seccond doesn't insert the image correctly. But if I write down the id and the true path it works fine. What do I have to change? On 22 Sep., 05:42, ricardobeat [EMAIL PROTECTED] wrote: I can't get it either, what are you trying to accomplish? $('h1 a#' + this.id') is not logical, you first need to reference some a element to get it's ID, but in doing that you already wrote the ID... On Sep 21, 11:16 pm, FrenchiINLA [EMAIL PROTECTED] wrote: i think your problem is this.id, you have to show the entire code in order for us to see what does this mean. try just to add a alert for example to see what you get for this.id On Sep 21, 7:38 am, suntrop [EMAIL PROTECTED] wrote: HI there, I want to insert two variables into the selector and an attribute. But it doesn't work. $('h1 a#' + this.id + ' img').attr({src : images/ + msg + .png}); I looked through various tutorials but couldn't find an answer to this. The first variable comes from the object's (a element) id and the seccond is a response from an php script. Can somebody please help me?- Zitierten Text ausblenden - - Zitierten Text anzeigen -
[jQuery] [validate] how to test text against a bad word list?
hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: [validate] how to test text against a bad word list?
return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: ajax request with datatype:script
Hi, What do you get from the server side ? I think you are getting a json structure. But this is text for javascript till you make eval; instead of the ajax function try getjson. Best regards, David On Sep 22, 7:04 am, seo++ [EMAIL PROTECTED] wrote: I am trying to insert array elements through ajax request, these elements are also arrays or multidimensional arrays. here is an example main script : var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: script, success: function(data){ alert( list[1][0] ); } }); ids.js contents: list[1] = [['aaa', 'bbb'], ['ccc', 'ddd']]; that would produce ' list is undefined' error but changing datatype to 'html' and adding eval() would work fine var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: html, success: function(data){ eval( data); alert( list[1][0] ); } }); any ideas what am i doing wrong ?
[jQuery] Re: Insert variable into a selector
But the image isn't replaced correctly Perhaps try changing this line instead $('#' + id + ' img').attr(src, images/+msg+.png); There's no reason why that (or your line for that matter) wouldn't work as long as the selector finds something and the value of the src is a valid path on your server
[jQuery] Re: [validate] how to test text against a bad word list?
uh, that was fast! thx, i will give it a try. aehm, is it possible to put the bad word in an array and test this. On 22 Sep., 13:31, Jörn Zaefferer [EMAIL PROTECTED] wrote: return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: [validate] how to test text against a bad word list?
Sure. You can create a regexes on the fly with new RegExp(bla) and use that instead of the inline regex /bla|blu/. Jörn On Mon, Sep 22, 2008 at 1:37 PM, tobaco [EMAIL PROTECTED] wrote: uh, that was fast! thx, i will give it a try. aehm, is it possible to put the bad word in an array and test this. On 22 Sep., 13:31, Jörn Zaefferer [EMAIL PROTECTED] wrote: return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: Insert variable into a selector
When write: $('#' + id + ' img').attr(src, images/favorites.png); … it works. alert (msg) says favorites. There must be something wrong with msg. If the variable is defined before var favimg = favorites; and I insert favimg it works just fine. What could be wrong with msg? msg is what I echo back in my PHP code. I don't know if this is the appropriate way. On 22 Sep., 13:34, MorningZ [EMAIL PROTECTED] wrote: But the image isn't replaced correctly Perhaps try changing this line instead $('#' + id + ' img').attr(src, images/+msg+.png); There's no reason why that (or your line for that matter) wouldn't work as long as the selector finds something and the value of the src is a valid path on your server
[jQuery] help needed with new node replace
If anyone knows a jQuery way to replace a node and return the new node object that would be great (replaceWith returns the old object)
[jQuery] Error when trying to load the carousel.html
i copied over the files into a directory on my webspace and get the following error when trying to access the carousel.html. Error on the jquery.agile_carousel-beta.1.zip: Fatal error: Call to undefined function: filter_var() in /homepages/14/ d227853429/htdocs/caro1/make_slides.php on line 9 Error on the jquery.agile_carousel-beta.2.0.zip: Fatal error: Call to undefined function: filter_var() in /homepages/14/ d227853429/htdocs/caro2/make_slides.php on line 17 macmike
[jQuery] Re: jEditable Clone Referring to the Original Element
Thanks, Mike. This info helps. Great work, btw. -Wayne On Sep 20, 12:22 pm, Mika Tuupola [EMAIL PROTECTED] wrote: On Sep 19, 2008, at 6:20 PM, Wayne wrote: In short, I can clone jEditable items, but I can't edit them in place without a page reload and rewriting from the server side. Am I ignoring something or do I need to reset a binding somewhere when I do the DOM modification? This should help: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... basically you need to rebind events to cloned elements. -- Mika Tuupolahttp://www.appelsiini.net/
[jQuery] Re: jScrollPane and fadeIn
Thanks for your reply dude. I actually had the scripts grouped like that, but I wasn't sure if that was causing the problems, so I split them again, cheers for clarifying that for me. Anyway, I still have the same problem. If the contentContainer DIV is set to fadeIn, it will render any contents within it fine, until the jScrollPane class is applied to the child DIV (mainContent). This causes mainContent not to render. I have tried setting mainContent to display:block and that had no effect. Conversly, if I disable the fadeIn effect on the contentContainer DIV, the mainContent DIV displays fine, and CSS scrollbars render fine. I have uploaded all three configurations to my server... http://graham-russell.co.uk/misc/newSite/index_1.html - jScrollPane Disabled, fadeIn Enabled http://graham-russell.co.uk/misc/newSite/index_2.html - jScrollPane Enabled, fadeIn Disabled http://graham-russell.co.uk/misc/newSite/index_3.html - jScrollPane Enabled, fadeIn Enabled Any ideas? I'm going to carry on experimenting myself, I'll repost if I find a solution. Cheers guys! -R. On Sep 21, 10:46 pm, ricardobeat [EMAIL PROTECTED] wrote: You should apply the fadeIn effect to the element that contains both the content DIV and the jScrollPane controls, either #jScrollPaneContainer or #containerContent. Applying the effect to the DIV in use by jScrollPane will override it's changes. Also, jQuery provides a function for use in place of the window.onload event, and there's no need to keep your scripts separate. script .. $(document).ready(function(){ $('.scroll-pane').jScrollPane(); $(#containerContent).fadeIn(2000); }); /script On Sep 21, 6:56 am, RitchieTheBrit [EMAIL PROTECTED] wrote: Hey guys! I've searched everywhere before posting here, but I've found nothing. Anyway, I have a page that fades in a DIV on page load using fadeIn. I tried to apply the jScrollPane effect to the div, but it seems that the fadeIn effect breaks it. Is there a way around this? Below is the way I have applied the code: script type=text/javascript $(function() { $('.scroll-pane').jScrollPane(); }); /script script type=text/javascript window.onload = function() { $(div#mainContent).fadeIn(2000);} /script I'm a totaly newb, so I'm not too sure if I am calling the functions incorrectly. I have tried the opposite order as well. A demo of the page can be found athttp://graham-russell.co.uk/misc/newSite/ I am running jQuery 1.2.6 minified. Many thanks guys! -Ritchie.
[jQuery] Re: Insert variable into a selector
are you sure there is no white space getting returned in your echo? if you have a line break (which you can't see in the returned value) that could be throwing off the img src tag maybe wash the returned value through a function stripping off leading and trailing whitespace http://www.google.com/search?hl=enq=javascript+strip+whitespace
[jQuery] Re: [validate] how to test text against a bad word list?
hm, i tried it this way, var badwordlist = new Array(Nice Site, Good Work, xxx, url=http, drugs, aciphex, nude); jQuery.validator.addMethod(badWord, function(value) { return new RegExp('!/' + badwordlist.join('|') + '/').test(value); }, Verdacht auf Spam-Versuch. Bitte passen Sie Ihren Kommentar an.); but now it works in the opposite way. the textarea is now only valid, if i enter one of the bad words … this return !/nice site|good work|xxx|aciphex|url=http|nude/.test(value); works fine. On 22 Sep., 14:32, Jörn Zaefferer [EMAIL PROTECTED] wrote: Sure. You can create a regexes on the fly with new RegExp(bla) and use that instead of the inline regex /bla|blu/. Jörn On Mon, Sep 22, 2008 at 1:37 PM, tobaco [EMAIL PROTECTED] wrote: uh, that was fast! thx, i will give it a try. aehm, is it possible to put the bad word in an array and test this. On 22 Sep., 13:31, Jörn Zaefferer [EMAIL PROTECTED] wrote: return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: [validate] how to test text against a bad word list?
Try this: return !new RegExp(badwordlist.join('|')).test(value); Jörn On Mon, Sep 22, 2008 at 3:50 PM, tobaco [EMAIL PROTECTED] wrote: hm, i tried it this way, var badwordlist = new Array(Nice Site, Good Work, xxx, url=http, drugs, aciphex, nude); jQuery.validator.addMethod(badWord, function(value) { return new RegExp('!/' + badwordlist.join('|') + '/').test(value); }, Verdacht auf Spam-Versuch. Bitte passen Sie Ihren Kommentar an.); but now it works in the opposite way. the textarea is now only valid, if i enter one of the bad words … this return !/nice site|good work|xxx|aciphex|url=http|nude/.test(value); works fine. On 22 Sep., 14:32, Jörn Zaefferer [EMAIL PROTECTED] wrote: Sure. You can create a regexes on the fly with new RegExp(bla) and use that instead of the inline regex /bla|blu/. Jörn On Mon, Sep 22, 2008 at 1:37 PM, tobaco [EMAIL PROTECTED] wrote: uh, that was fast! thx, i will give it a try. aehm, is it possible to put the bad word in an array and test this. On 22 Sep., 13:31, Jörn Zaefferer [EMAIL PROTECTED] wrote: return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: load progress on background image...
well i think i found the answer, for the record: var imageObj = new Image(); $(imageObj).attr(src,imagePath).load(function(){ $(#loadingGal).hide(); }); $(#leftCol).css(background-image,url(+imagePath+)); Since the load command does not take into account background images, i loaded up the same image in an image object, and traced that at the same time. i figured if it is loaded in one place, it will work. bah. On Sep 20, 1:10 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is it possible to detect this? I've searched everywhere. What i have is an image gallery that changes the background image, so it will be liquid with different resolutions. Id like to trace it so i can attach a load image and text. $(#leftCol).css(background-image,none).hide().css(background- image,url(+imagePath+)).fadeIn(2000);
[jQuery] Re: Help refactoring code for css sprite animation
That's great, I'm glad it worked! Just a minor point of terminology: There's actually no recursion in that code, although it does have a recursive feel to it. The callback functions are called at a later time after the original function has returned. Recursion would be when you have a function calling itself *before* it returns. -Mike From: gogojuice Thanks Michael Your code worked right off the copy and paste. I knew there was a recursive procedure in there somewhere, but I'm just getting up to speed with Javascript after years of ignoring it due to the pain and suffering involved in writing cross platform stuff. Jquery has made me want to learn again. Thanks Again
[jQuery] Re: [validate] how to test text against a bad word list?
doh! (http://www.fortunecity.com/lavendar/poitier/135/doh.wav) (hätte ich auch selber drauf kommen können …) thanks! works great! On 22 Sep., 16:03, Jörn Zaefferer [EMAIL PROTECTED] wrote: Try this: return !new RegExp(badwordlist.join('|')).test(value); Jörn On Mon, Sep 22, 2008 at 3:50 PM, tobaco [EMAIL PROTECTED] wrote: hm, i tried it this way, var badwordlist = new Array(Nice Site, Good Work, xxx, url=http, drugs, aciphex, nude); jQuery.validator.addMethod(badWord, function(value) { return new RegExp('!/' + badwordlist.join('|') + '/').test(value); }, Verdacht auf Spam-Versuch. Bitte passen Sie Ihren Kommentar an.); but now it works in the opposite way. the textarea is now only valid, if i enter one of the bad words … this return !/nice site|good work|xxx|aciphex|url=http|nude/.test(value); works fine. On 22 Sep., 14:32, Jörn Zaefferer [EMAIL PROTECTED] wrote: Sure. You can create a regexes on the fly with new RegExp(bla) and use that instead of the inline regex /bla|blu/. Jörn On Mon, Sep 22, 2008 at 1:37 PM, tobaco [EMAIL PROTECTED] wrote: uh, that was fast! thx, i will give it a try. aehm, is it possible to put the bad word in an array and test this. On 22 Sep., 13:31, Jörn Zaefferer [EMAIL PROTECTED] wrote: return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: Insert variable into a selector
No one could possibly have any idea what's wrong there (other than a lucky guess), because we're not seeing your actual code. Forget about PHP for the moment and look at what you get back from a View Source in the browser. That's all the browser and its JavaScript interpreter know about - your PHP source is out of the picture at that point. Do you see what's wrong there? If not, then please post a link to a live test page (not just a code snippet) and I'm sure someone will be able to spot the problem. -Mike From: suntrop When write: $('#' + id + ' img').attr(src, images/favorites.png); . it works. alert (msg) says favorites. There must be something wrong with msg. If the variable is defined before var favimg = favorites; and I insert favimg it works just fine. What could be wrong with msg? msg is what I echo back in my PHP code. I don't know if this is the appropriate way. On 22 Sep., 13:34, MorningZ [EMAIL PROTECTED] wrote: But the image isn't replaced correctly Perhaps try changing this line instead $('#' + id + ' img').attr(src, images/+msg+.png); There's no reason why that (or your line for that matter) wouldn't work as long as the selector finds something and the value of the src is a valid path on your server
[jQuery] Re: event delegation in jQuery - delegate vs listen vs ?
if you have to sell it, just mention speed, that increases by a lot. or the fact that elements that are added dynamically have their handlers on standby. (warning plug) look at my article about it with examples at the bottom http://www.wnas.nl/?p=238 From: rolfsf Thanks Mike, I guess what I'm wrestling with, is what advantages the plugins offer (I'm not that adept at javascript, but I'm hoping to 'sell' the concept to others who are more adept at it). We have some big data tables with lots of clicks, sometimes expanding rows, sometimes hovers or clueTips, and sometimes the clicks will trigger a jqModal- controlled window (hence my interest in how to work with jqModal in this event delegation scenario).
[jQuery] Re: about $(document).ready()
哦,谢谢,呵呵,收获不小,想不到这里国内的朋友还不少啊! 2008/9/21 Xinhao Zheng [EMAIL PROTECTED] 你好, 你可以为ready事件定义多个函数。也就是你那样写是可以的。 至于你说的合在一起和分开是有区别的,至少我亲身体验的是我是能合在一起就合在一起,需要分开就不得不分开。 不过分开写的时候,最好每个函数彼此之间不要相互依赖。 Xinhao Zheng SGL中文Blog: http://blog.cjcht.com SGL中文文档: http://wiki.cjcht.com SGL中文Group:http://groups.google.com/group/seagull_forum 2008/9/21 立体风 [EMAIL PROTECTED] 不好意思,英语不好见笑了,我实际是想问问: 放在$(document).ready(x)中的函数多少有限制吗?比如: $(document).ready(function(){ a(); b(); c(); }); 上面是放了3个函数,如果这样写: $(document).ready(function(){ a(); }); $(document).ready(function(){ b(); }); $(document).ready(function(){ c(); }); 在这里a(); b(); c();是jquery的一个效果或事件,和到一起和分开有区别吗? 谢谢! 2008/9/18 ~flow [EMAIL PROTECTED] 敬��原��但是文字上大概有�c儿不太清楚。 `$(document).ready(x)` [EMAIL PROTECTED] 如果document已��完成的�r候script�f`$(document).ready(x)`的��,那它的引��`x`立即被execute。 一个document ready的引��function可以有多少clauses,也可以在一个script�Y面define多少document ready,它��都�⒈��绦小� 例。$(document).ready(function(){alert('helo')}) 以上。 On Sep 18, 1:43 pm, 立体风 [EMAIL PROTECTED] wrote: Hello all, Why sometimes with time, and sometimes $(document).ready() with many times?
[jQuery] Re: Insert variable into a selector
Hi Michael, I didn't want to screw things up with the complete code, because I thought it is a pretty simple thing :-) So here is the whole code: (I haven't a live page, it is only on my local machine) !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=de head meta http-equiv=content-type content=text/html; charset=utf-8 / titleWerbetrommel/title link rel=stylesheet type=text/css href=http:// yui.yahooapis.com/2.5.2/build/reset-fonts-grids/reset-fonts- grids.css link rel=stylesheet type=text/css href=http:// yui.yahooapis.com/2.5.2/build/base/base-min.css link rel=stylesheet type=text/css href=css/master.css script type=text/javascript src=js/jquery-1.2.6.pack.js/ script script type=text/javascript {literal} $(document).ready(function() { $('.customer').hide(); $(h1).click(function() { $(this).next().slideToggle(); }); $('#displayAll').click(function() { $('.customer').each(function() { $(this).show(); }); return false; }); $('#displayNone').click(function() { $('.customer').each(function() { $(this).hide(); }); return false; }); // Make Favorite $('.makeFavorite').click(function() { var id = this.id; var favimg = favorites; $.ajax({ type: POST, url: make_favorite.php, data: id= + $(this.id), success: function(msg) { alert('Data saved: ' + msg); $('h1 a#'+id+' img').attr({src : images/+favimg+.png}); } }); return false; }); }); {/literal} /script /head body div id=wrapper div id=header img src=/images/core/logo.png width= height= title= alt= / div id=searchRow form action= id=searchBox method=post input type=text / /form /div div id=alphabetRow ul lia/li lib/li liy/li liz/li /ul /div div id=addRow img src=images/add.png width=32 height=32 title=Neuen Interessenten hinzufügen alt=Hinzufügen / /div /div!-- end #header -- div id=listing div id=control a href=# id=displayAll title=Alle User vollständig einblendenAlle einblenden/a - a href=# id=displayNone title=Alle User ausbendenAlle ausblenden/a /div {foreach from=$eintrag item=inhalt} h1{$inhalt.firma} a href={$inhalt.id} class=makeFavorite id={$inhalt.id} title=Als Favorit speichernimg src=images/{if $inhalt.favorit == 1}favorites.png{else}favorites2.png{/if} width=16 height=16 alt= //a/h1 div id=customer_{$inhalt.id} class=customer div class=user h2Empfänger/h2 p{$inhalt.name}/p p{$inhalt.adresse|nl2br}/p p{$inhalt.email}br /a href={$inhalt.website} title={$inhalt.website}{$inhalt.website}/a/p /div!-- end .user --
[jQuery] Re: Case Insentitive Selectorys
my_search = sEarCh; //global var, you can't pass arguments to the filter function my_search = new RegExp(my_search,'i'); // 'i' makes the regexp case insensitive $('h1').filter(function () { return $(this).attr('title').match(my_search); }); this might be slow if you're handling large XML files, and it's limited to single word searches or exact concatenated matches. - ricardo On Sep 22, 6:27 am, Erik Beeson [EMAIL PROTECTED] wrote: Maybe try using filter and a regexp for the part that you want to be case insensitive. Something like (very untested): $(...).find('item').filter(function() { return this.name.match(new RegExp(search, 'i')); }).each(function() { }); I don't recall the syntax for accessing an XML attribute from javascript, so the this.name part might be wrong. Maybe you need $(this).attr('name') instead. Also, you might want to be doing more than just passing the search into a RegExp, but you get the idea. Also, maybe reconsider what you're trying to do. Maybe just return your xml such that it's already been converted to lower case, then just do what you were doing before except use search.toLowerCase() instead of just search. Hope it helps. --Erik On Mon, Sep 22, 2008 at 12:35 AM, blockedmind [EMAIL PROTECTED] wrote: Nothing? On Sep 20, 5:22 pm, blockedmind [EMAIL PROTECTED] wrote: I am making search in an xml file, but I don't get expected results since jQuery selectors arecase-sensitive. I use something like $(returnedXml).find(item[name*='+search+']).each(function(){ }); How to make it INCASE-SENSITIVE?
[jQuery] Re: help needed with new node replace
Write plugins! It's easy: $.fn.myReplaceWith = function () { var ret = $( arguments[0] ); this.replaceWith( ret ); return ret; }; On Sep 22, 3:15 pm, redcom [EMAIL PROTECTED] wrote: If anyone knows a jQuery way to replace a node and return the new node object that would be great (replaceWith returns the old object)
[jQuery] Re: about $(document).ready()
araio, da pra escreverem em uma linguagem que todo mundo entenda?! hahahaha JW 2008/9/22 立体风 [EMAIL PROTECTED] 哦,谢谢,呵呵,收获不小,想不到这里国内的朋友还不少啊! 2008/9/21 Xinhao Zheng [EMAIL PROTECTED] 你好, 你可以为ready事件定义多个函数。也就是你那样写是可以的。 至于你说的合在一起和分开是有区别的,至少我亲身体验的是我是能合在一起就合在一起,需要分开就不得不分开。 不过分开写的时候,最好每个函数彼此之间不要相互依赖。 Xinhao Zheng SGL中文Blog: http://blog.cjcht.com SGL中文文档: http://wiki.cjcht.com SGL中文Group:http://groups.google.com/group/seagull_forum 2008/9/21 立体风 [EMAIL PROTECTED] 不好意思,英语不好见笑了,我实际是想问问: 放在$(document).ready(x)中的函数多少有限制吗?比如: $(document).ready(function(){ a(); b(); c(); }); 上面是放了3个函数,如果这样写: $(document).ready(function(){ a(); }); $(document).ready(function(){ b(); }); $(document).ready(function(){ c(); }); 在这里a(); b(); c();是jquery的一个效果或事件,和到一起和分开有区别吗? 谢谢! 2008/9/18 ~flow [EMAIL PROTECTED] 敬��原��但是文字上大概有�c儿不太清楚。 `$(document).ready(x)` [EMAIL PROTECTED] 如果document已��完成的�r候script�f`$(document).ready(x)`的��,那它的引��`x`立即被execute。 一个document ready的引��function可以有多少clauses,也可以在一个script�Y面define多少document ready,它��都�⒈��绦小� 例。$(document).ready(function(){alert('helo')}) 以上。 On Sep 18, 1:43 pm, 立体风 [EMAIL PROTECTED] wrote: Hello all, Why sometimes with time, and sometimes $(document).ready() with many times?
[jQuery] IE ignores event load()
Hi, please could somebody tell me how to improve the following code: $(document).ready(function() { $(img.thumb).load(function() { $(this).addClass(visible); }); }); The idea is that an image needs to be displayed only when it has fully loaded. Prior to that the background of the div is displayed as the image is set to hidden. FF and Opera are fine with this, but IE6 consistently fails to unhide some images. I guess the .load() function is called too late for some of them, but not sure how to improve the situation. Thank you! Martin
[jQuery] Tools for packing js
Hey, few days ago I started to develop with jQuery - and I love it! I'd like to know what tool was used to pack jquery. Another thing: In the last days docs.jquery.com was down several times. Is there any mirror? Manuel
[jQuery] Re: ajax request with datatype:script
server side sends ids.js mentioned in first post it's a JavaScript array On Sep 22, 2:33 pm, david [EMAIL PROTECTED] wrote: Hi, What do you get from the server side ? I think you are getting a json structure. But this is text for javascript till you make eval; instead of theajaxfunction try getjson. Best regards, David On Sep 22, 7:04 am, seo++ [EMAIL PROTECTED] wrote: I am trying to insert array elements throughajaxrequest, these elements are also arrays or multidimensional arrays. here is an example main script : var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: script, success: function(data){ alert( list[1][0] ); } }); ids.js contents: list[1] = [['aaa', 'bbb'], ['ccc', 'ddd']]; that would produce ' list is undefined' error but changingdatatypeto 'html' and adding eval() would work fine var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: html, success: function(data){ eval( data); alert( list[1][0] ); } }); any ideas what am i doing wrong ?
[jQuery] Re: Superfish loading problem
I found this problem when I using smarty with jquery .. but I have not sloved this problem,whatever I using 1st method or 2nd method.. so I give up jQuery althrough jquery very cool...
[jQuery] Newbie: .after to add an image ref into code
Hello list! Apologies if this is a recurrent request! I would like to append an image after an a href, so far I have my html: a href=# name=foo target=_blank class=openInNewWindowopen in new window/a and my first attempt at jQuery: $('.openInNewWindow').after('img src=images/newWindow.gif / ').attr('target','_blank'); to obtain the following: a href=# name=foo target=_blank class=openInNewWindowopen in new window/aimg src=images/newWindow.gif / but nothing happens!!! Am I pointing in the right direction? Any advice would be greatly appreciated Thanks AMWJ
[jQuery] Toggling that degrades gracefully
Hello guys. I have this code (simplizied and without irrelevant here thtbody etc. code): table tr class=section_head tdname/td tdvalue/td /tr tr td colespan=2divsome stuff/div/td /tr /table I want to show/hide non-classed tr when clicking on section_head table row. $(document).ready(function() { $('.section_head').click(function(){ $(this).next().toggle(); }); }); This works and everything is fine. BUT! To make it as requested in design I need all toggled stuff to be hidden when page is opening. To achieve that I give my tr (display:none;) from css. And in the same time I want the page to degrade gracefully, so when javascript is off usually hidden stuff will be shown. So I can't load the page with tr (display:none;) and I need to hide it with javascript; So what I do is: $(document).ready(function() { $('.section_head').each(function(){ $(this).next().toggle(); }); $('.section_head').click(function(){ $(this).next().toggle(); }); }); But then I get this “jumping”. When page loads trs are open, then it jumps and closes it. Does anybody knows some graceful solution for whole problem?
[jQuery] jquery, works in FF, but no love in IE.
Hey all.. this is the rendered HTML from a ColdFusion app that I'm working on. I'm having a bear of a time trying to get the JQuery plugins functioning in IE 7. They run like a champ in Firefox 3, but in IE 7, I get the loading text but no display of the called page in the href. any help would be appreciated. script type=text/javascript src=js/jquery-1.2.6.min.js/script script type=text/javascript src=js/jquery.form.js/script script type=text/javascript src=js/jquery.metadata.js/script script type=text/javascript src=js/jquery.tablesorter.js/script script type=text/javascript src=js/jquery.ajaxContent.js/script script language=JavaScript type=text/JavaScript $(document).ready(function(){ $(.ajax).ajaxContent(); $(#category_table).tablesorter({ debug: true }); } ); /script table width=100% cellpadding=0 cellspacing=0 border=0 style=background-image:url(images/nav_bg.jpg); tr td nowrap=nowrap width=180 div id=Tab_NPP div class=leftyellow/div div class=rightyellow/div div class=middleyellowa class=ajax href=forms/frm_npp_cat.cfmNon Physician Practitioners/a/div /div /td td width=5 nowrap=nowrapimg src=images/spacer.gif width=5 height=5 border=0 //td td nowrap=nowrap width=180 div id=Tab_TA div class=leftbrown/div div class=rightbrown/div div class=middlebrowna class=ajax href=forms/frm_ta_cat.cfmTransplant Admins/a/div /div /td td width=5 nowrap=nowrapimg src=images/spacer.gif width=5 height=5 border=0 //td td nowrap=nowrap width=180 div id=Tab_FS div class=leftbrown/div div class=rightbrown/div div class=middlebrowna class=ajax href=forms/frm_fs_cat.cfmFaculty/Staff/a/div /div /td td width=5 nowrap=nowrapimg src=images/spacer.gif width=5 height=5 border=0 //td tdnbsp;/td td width=1 valign=bottomimg src=images/nav_tab_right_top.gif width=1 height=12 border=0 //td /tr /table /div table width=98% border=0 cellpadding=2 cellspacing=0 class=tablemainsub tr td colspan=4 class=tableheadersubCurrent Categories: Fiscal Year: 2009 /td /tr /table div id=ajaxContent class=box_tab_info /div/td /tr /table -- Scott Stewart ColdFusion Developer Office of Research Information Systems Research amp; Economic Development University of North Carolina at Chapel Hill Phone:(919)843-2408 Fax: (919)962-3600 Email: [EMAIL PROTECTED]
[jQuery] Re: finding the state of slideToggle
Here is the answer, thanks to digilover over at the SitePoint forums... function initMenu() { $('#groups ul').hide(); $('#groups li a').click( function() { $(this).next().slideToggle('normal',function(){ var id = $(this).attr('id'); if ($(this).is(':hidden')) { var state = closed; } else if ($(this).is(':visible')) { var state = open; } alert($(this).attr('id') + ' is ' + state); return false; }); } ); }
[jQuery] Re: ajax request with datatype:script
the server side sends ids.js it's a JavaScript Array On Sep 22, 2:33 pm, david [EMAIL PROTECTED] wrote: Hi, What do you get from the server side ? I think you are getting a json structure. But this is text for javascript till you make eval; instead of the ajax function try getjson. Best regards, David On Sep 22, 7:04 am, seo++ [EMAIL PROTECTED] wrote: I am trying to insert array elements through ajax request, these elements are also arrays or multidimensional arrays. here is an example main script : var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: script, success: function(data){ alert( list[1][0] ); } }); ids.js contents: list[1] = [['aaa', 'bbb'], ['ccc', 'ddd']]; that would produce ' list is undefined' error but changing datatype to 'html' and adding eval() would work fine var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: html, success: function(data){ eval( data); alert( list[1][0] ); } }); any ideas what am i doing wrong ?
[jQuery] Re: docs.jquery.com status update
I have accessed docs.jquery.com daily for the last 3 months. In this time the site has failed to load only once or twice, maybe it's not just a hosting issue? - ricardo On Sep 22, 12:54 am, coreyw [EMAIL PROTECTED] wrote: I hate to revive a more-or-less dead thread, but this problem is still occurring as far as I can see. The docs. subdomain doesn't just host the documentation, so the other sources are of no use. It happens to host a good portion of the content regarding release notes, download notes, tutorials, the discussions, and credits. If this were a non-tech-oriented community this might be understandable, but really this is absurd. MediaTemple has had issues with this for several months now. I think their time has run out. I'm sure that between all of the people willing to help out a better solution can be had. On Jul 29, 8:40 am, Lance McCulley [EMAIL PROTECTED] wrote: I figure you're completely aware that docs.jquery.com is not responding, but I'm wondering if there is a status update? And, on a side note, how would I setup a loop to remove all child elements of a particular element? Thanks! -Lance
[jQuery] Re: IE ignores event load()
$(window).load(function() { $(img.thumb).addClass(visible); }); will do what you are after
[jQuery] Re: Adding Arrows to a DropDownMenu based on Lists
docs.jquery.com always helps. The has() function does what you want: $(#nav li).has(ul).find(a.navlinkparent).css({ background-image: url(/img/nav_arrow_down.gif), background-repeat: no-repeat, background-position: right center }); $(#nav ul li).has(ul).find(a.navlinkparent).css({ background-image: url(/img/nav_arrow_right.gif), background-repeat: no-repeat, background-position: right center }); hope this helps (and works). -ricardo On Sep 22, 5:09 am, Gordon Bergling [EMAIL PROTECTED] wrote: Good Morning Everyone, I am struggling a few hours with a problem, which solution isn't that easy as I initial though. The following example list is generated by backend code. ul id=nav li a id=hyperlink class=navlink href=/home title=Home/a /li lia id=hyperlink class=navlinkparent href= title=Folder A/a ul lia id=hyperlink class=navsublinkparent href=/folder_a/ page1 title=Page1/a /li lia id=hyperlink class=navsublinkparent href=/folder_b/ page2 title=Page2/a /li lia id=hyperlink class=navsublinkparent href= title=Folder B/a ul li a id=hyperlink class=navsubsublink href=/folder/page1 title=Page1/a /li li a id=hyperlink class=navsubsublink href=/folder/page2 title=Page2/a /li li a id=hyperlink class=navsubsublink href=/folder/page3 title=Page3/a /li /ul /ul Thats only a shortened version. JQuery is used to create a horizontal dropdown menu. Up to this part everything is working as expected. To improve the usability I want to add two kinds of arrows to the menu. One arrow down for the top elements and one arrow right for child entries. That part should accomplished by the following snippets. $(ul li a.navlinkparent).css({ background-image: url(/img/nav_arrow_down.gif), background-repeat: no-repeat, background-position: right center }); $(#nav ul li a.navsublinkparent).css({ background-image: url(/img/nav_arrow_right.gif), background-repeat: no-repeat, background-position: right center }); The problem I am facing right know is, that not every parent has childs and therefor it shouldn't get an arrow assigned. I tried various filters but without any luck. Does anyone has a hint on solving? best regards, Gordon
[jQuery] Re: Adding Arrows to a DropDownMenu based on Lists
oh, I forgot to mention that IDs should be unique, you are using the same ID for many a elements - use classes instead. On Sep 22, 3:39 pm, ricardobeat [EMAIL PROTECTED] wrote: docs.jquery.com always helps. The has() function does what you want: $(#nav li).has(ul).find(a.navlinkparent).css({ background-image: url(/img/nav_arrow_down.gif), background-repeat: no-repeat, background-position: right center }); $(#nav ul li).has(ul).find(a.navlinkparent).css({ background-image: url(/img/nav_arrow_right.gif), background-repeat: no-repeat, background-position: right center }); hope this helps (and works). -ricardo On Sep 22, 5:09 am, Gordon Bergling [EMAIL PROTECTED] wrote: Good Morning Everyone, I am struggling a few hours with a problem, which solution isn't that easy as I initial though. The following example list is generated by backend code. ul id=nav li a id=hyperlink class=navlink href=/home title=Home/a /li lia id=hyperlink class=navlinkparent href= title=Folder A/a ul lia id=hyperlink class=navsublinkparent href=/folder_a/ page1 title=Page1/a /li lia id=hyperlink class=navsublinkparent href=/folder_b/ page2 title=Page2/a /li lia id=hyperlink class=navsublinkparent href= title=Folder B/a ul li a id=hyperlink class=navsubsublink href=/folder/page1 title=Page1/a /li li a id=hyperlink class=navsubsublink href=/folder/page2 title=Page2/a /li li a id=hyperlink class=navsubsublink href=/folder/page3 title=Page3/a /li /ul /ul Thats only a shortened version. JQuery is used to create a horizontal dropdown menu. Up to this part everything is working as expected. To improve the usability I want to add two kinds of arrows to the menu. One arrow down for the top elements and one arrow right for child entries. That part should accomplished by the following snippets. $(ul li a.navlinkparent).css({ background-image: url(/img/nav_arrow_down.gif), background-repeat: no-repeat, background-position: right center }); $(#nav ul li a.navsublinkparent).css({ background-image: url(/img/nav_arrow_right.gif), background-repeat: no-repeat, background-position: right center }); The problem I am facing right know is, that not every parent has childs and therefor it shouldn't get an arrow assigned. I tried various filters but without any luck. Does anyone has a hint on solving? best regards, Gordon
[jQuery] How can I make sure one AJAX call returns before another?
I have several AJAX calls. Most of them retrieve values for drop-down lists and one fills in the data. Of course, unless the drop down lists are fully loaded, the data filler doesn't select them properly. Is there anyway to trigger the data filler after they are complete with more sophistication than setTimeout? BTW, I've tried ajaxStop but that causes an infinite loop since the data filler triggers it again. Thanks!
[jQuery] Re: jScrollPane and fadeIn
hmm, here's the thing: jScrollPane needs the height and width of the element it's being applied to in order to work. By setting #containerContent display:none in your CSS your effectively giving it 0 height and width, and jScrollPane keeps those measures after being applied. What I came up with is this: remove #containerContent's display:none from CSS, add visibility: hidden, then use the following JS: $('.scroll-pane').jScrollPane(); $ (#containerContent).css({visibility:'visible',display:'none'}).fadeIn(2000); - ricardo On Sep 22, 11:29 am, RitchieTheBrit [EMAIL PROTECTED] wrote: Thanks for your reply dude. I actually had the scripts grouped like that, but I wasn't sure if that was causing the problems, so I split them again, cheers for clarifying that for me. Anyway, I still have the same problem. If the contentContainer DIV is set to fadeIn, it will render any contents within it fine, until the jScrollPane class is applied to the child DIV (mainContent). This causes mainContent not to render. I have tried setting mainContent to display:block and that had no effect. Conversly, if I disable the fadeIn effect on the contentContainer DIV, the mainContent DIV displays fine, and CSS scrollbars render fine. I have uploaded all three configurations to my server... http://graham-russell.co.uk/misc/newSite/index_1.html - jScrollPane Disabled, fadeIn Enabledhttp://graham-russell.co.uk/misc/newSite/index_2.html - jScrollPane Enabled, fadeIn Disabledhttp://graham-russell.co.uk/misc/newSite/index_3.html - jScrollPane Enabled, fadeIn Enabled Any ideas? I'm going to carry on experimenting myself, I'll repost if I find a solution. Cheers guys! -R. On Sep 21, 10:46 pm, ricardobeat [EMAIL PROTECTED] wrote: You should apply the fadeIn effect to the element that contains both the content DIV and the jScrollPane controls, either #jScrollPaneContainer or #containerContent. Applying the effect to the DIV in use by jScrollPane will override it's changes. Also, jQuery provides a function for use in place of the window.onload event, and there's no need to keep your scripts separate. script .. $(document).ready(function(){ $('.scroll-pane').jScrollPane(); $(#containerContent).fadeIn(2000); }); /script On Sep 21, 6:56 am, RitchieTheBrit [EMAIL PROTECTED] wrote: Hey guys! I've searched everywhere before posting here, but I've found nothing. Anyway, I have a page that fades in a DIV on page load using fadeIn. I tried to apply the jScrollPane effect to the div, but it seems that the fadeIn effect breaks it. Is there a way around this? Below is the way I have applied the code: script type=text/javascript $(function() { $('.scroll-pane').jScrollPane(); }); /script script type=text/javascript window.onload = function() { $(div#mainContent).fadeIn(2000);} /script I'm a totaly newb, so I'm not too sure if I am calling the functions incorrectly. I have tried the opposite order as well. A demo of the page can be found athttp://graham-russell.co.uk/misc/newSite/ I am running jQuery 1.2.6 minified. Many thanks guys! -Ritchie.
[jQuery] Re: Newbie: .after to add an image ref into code
Are you running this code inside the head tag? Try wrapping it like this: $(document).ready(function(){ $('.openInNewWindow').after('img src=images/newWindow.gif /'); }); Also, why are you setting the target attribute if it is already set to the same value? cheers - ricardo On Sep 22, 2:56 pm, artpunx [EMAIL PROTECTED] wrote: Hello list! Apologies if this is a recurrent request! I would like to append an image after an a href, so far I have my html: a href=# name=foo target=_blank class=openInNewWindowopen in new window/a and my first attempt at jQuery: $('.openInNewWindow').after('img src=images/newWindow.gif / ').attr('target','_blank'); to obtain the following: a href=# name=foo target=_blank class=openInNewWindowopen in new window/aimg src=images/newWindow.gif / but nothing happens!!! Am I pointing in the right direction? Any advice would be greatly appreciated Thanks AMWJ
[jQuery] Re: Superfish loading problem
Are you using any other Javascript library in the same page? smarty works server-side, there is no reason to conflict with jQuery unless you're doing something wrong. A working html example would help! On Sep 22, 2:11 pm, macleo [EMAIL PROTECTED] wrote: I found this problem when I using smarty with jquery .. but I have not sloved this problem,whatever I using 1st method or 2nd method.. so I give up jQuery althrough jquery very cool...
[jQuery] cool new DatePicker with a familiar name, but how to make multi-month start with current
I've been using Kevin Lucks datepicker for the past few months, and I was trying to figure out how to make it a 'range' datepicker when I came across http://www.eyecon.ro/datepicker/ The naming will probably get confusing, but this is a really nice range picker. I am having one problem with it though. When I show multiple calendars on my page (3), I've got is showing last month, this month, and next month, but I'm trying to get the code to show this month, next month, following month as there is no point in having history on my site. The section of code which defines which calendars to display is [code] for (var i = ; i options.calendars; i++) { date = new Date(options.current); date.addMonths(-currentCal +i); tblCal = cal.find('table').eq(i+1); switch (tblCal[0].className) { case 'datepickerViewDays': dow = formatDate(date, 'B, Y'); [/code] changing to 'date.addMonths(currentCal +i)' starts at next month, and everything else I've tried screws everything up. Any idea how to change this code to show this month?
[jQuery] Re: IE ignores event load()
Hi MorningZ, $(window).load(function() { $(img.thumb).addClass(visible); }); will do what you are after thank you for your response. The problem with this one is that it will not show a single image until the whole lot has loaded - and that can be 20 or so seconds if the connection is slow. And then it will show them all at once. I am starting to think that I will have to use an array that contains all image URLs, then artificially create images one by one, and define the load() event on each. This is something I am not very keen on doing because I am rendering the HTML by using a django template. Another potential idea is that I can create a loop once the DOM is ready and convert invisible objects to visible until none are left. But at the same time this could lead to CPU spikes and this is something I am trying to avoid as well. Best regards, Martin
[jQuery] Re: jScrollPane and fadeIn
Fantastic work! For posterity, to help any noobs (like me!), here is the way the script is used in its entirety... script type=text/javascript $(document).ready(function(){ $('.scroll-pane').jScrollPane(); $(#containerContent).css({visibility:'visible',display:'none'}).fadeIn(2000); }); /script http://graham-russell.co.uk/misc/newSite/ (this link may disappear once the new site is launched) -r. - Original Message From: ricardobeat [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, 22 September, 2008 19:01:33 Subject: [jQuery] Re: jScrollPane and fadeIn hmm, here's the thing: jScrollPane needs the height and width of the element it's being applied to in order to work. By setting #containerContent display:none in your CSS your effectively giving it 0 height and width, and jScrollPane keeps those measures after being applied. What I came up with is this: remove #containerContent's display:none from CSS, add visibility: hidden, then use the following JS: $('.scroll-pane').jScrollPane(); $ (#containerContent).css({visibility:'visible',display:'none'}).fadeIn(2000); - ricardo On Sep 22, 11:29 am, RitchieTheBrit [EMAIL PROTECTED] wrote: Thanks for your reply dude. I actually had the scripts grouped like that, but I wasn't sure if that was causing the problems, so I split them again, cheers for clarifying that for me. Anyway, I still have the same problem. If the contentContainer DIV is set to fadeIn, it will render any contents within it fine, until the jScrollPane class is applied to the child DIV (mainContent). This causes mainContent not to render. I have tried setting mainContent to display:block and that had no effect. Conversly, if I disable the fadeIn effect on the contentContainer DIV, the mainContent DIV displays fine, and CSS scrollbars render fine. I have uploaded all three configurations to my server... http://graham-russell.co.uk/misc/newSite/index_1.html - jScrollPane Disabled, fadeIn Enabledhttp://graham-russell.co.uk/misc/newSite/index_2.html - jScrollPane Enabled, fadeIn Disabledhttp://graham-russell.co.uk/misc/newSite/index_3.html - jScrollPane Enabled, fadeIn Enabled Any ideas? I'm going to carry on experimenting myself, I'll repost if I find a solution. Cheers guys! -R. On Sep 21, 10:46 pm, ricardobeat [EMAIL PROTECTED] wrote: You should apply the fadeIn effect to the element that contains both the content DIV and the jScrollPane controls, either #jScrollPaneContainer or #containerContent. Applying the effect to the DIV in use by jScrollPane will override it's changes. Also, jQuery provides a function for use in place of the window.onload event, and there's no need to keep your scripts separate. script .. $(document).ready(function(){ $('.scroll-pane').jScrollPane(); $(#containerContent).fadeIn(2000); }); /script On Sep 21, 6:56 am, RitchieTheBrit [EMAIL PROTECTED] wrote: Hey guys! I've searched everywhere before posting here, but I've found nothing. Anyway, I have a page that fades in a DIV on page load using fadeIn. I tried to apply the jScrollPane effect to the div, but it seems that the fadeIn effect breaks it. Is there a way around this? Below is the way I have applied the code: script type=text/javascript $(function() { $('.scroll-pane').jScrollPane(); }); /script script type=text/javascript window.onload = function() { $(div#mainContent).fadeIn(2000);} /script I'm a totaly newb, so I'm not too sure if I am calling the functions incorrectly. I have tried the opposite order as well. A demo of the page can be found athttp://graham-russell.co.uk/misc/newSite/ I am running jQuery 1.2.6 minified. Many thanks guys! -Ritchie.
[jQuery] Re: Bind events on DOM elements inserted from other frame
So, would this be in addition to my normal document ready? On Sep 17, 7:12 pm, ricardobeat [EMAIL PROTECTED] wrote: Not sure but $(frames['frame'].document).ready() should work (from the parent window). On Sep 17, 8:21 pm, hubbs [EMAIL PROTECTED] wrote: Ok, I am realizing it has to do with the do with the $(document).ready function. If I just use: $ = window.parent.$; $(#hold).append('a href=#Inserted from iFrame/a br /'); In the iframe, it correctly adds the link to the parent, and it gets the event from livequery! Hooray!! But, obviously I need to add back a document ready function so that I can bind events within the iframe. How does that need to be done in this context? As I said, using the normal document ready does not work. On Sep 17, 9:58 am, ricardobeat [EMAIL PROTECTED] wrote: using the iframe's jQuery object: $('.classinparentframe', parent.window.document) Ideally if the contents of the iframe are always known to you, you should use only one instance of jQuery on the parent window and do all your stuff from it, it's simpler to debug also. On Sep 16, 10:29 pm, hubbs [EMAIL PROTECTED] wrote: Thanks Ricardo. But what if I wanted to access the parent document from WITHIN the iframe? On Sep 16, 12:27 pm, ricardobeat [EMAIL PROTECTED] wrote: You need to understand that a frame is another 'window' instance, it doesn't have the same jQuery object as the parent window unless you tell it to. So the '$' object you use in firebug console is always the one from the parent window. If i'm not mistaken you can acess frame content with the parent window's jQuery object using $('.classinsidetheframe', frames['name'].document).css(); On Sep 16, 1:48 pm, hubbs [EMAIL PROTECTED] wrote: Ok Brandon, I found this in another post: var doc = $('#testframe')[0].contentWindow.document; $(doc.body).append('spantest/span'); This seems like it would help, but I am not sure how to use this, along with what you posted to get it working correctly. Somehow sending the GET within the context of the contentWindow is confusing me, and I just can't get it working. On Sep 15, 9:18 am, Brandon Aaron [EMAIL PROTECTED] wrote: To see what I mean run this in Firebug: $('iframe')[0].contentWindow.$ = $; Then click on the link in the iframe and it will behave as you expect. -- Brandon Aaron On Mon, Sep 15, 2008 at 9:13 AM, Brandon Aaron [EMAIL PROTECTED]wrote: This would work if you used the frames parent instance of jQuery. LiveQuery works by monitoring the DOM methods within jQuery. Since within the frame you are using a new instance of jQuery, LiveQuery will not be monitoring its DOM methods. -- Brandon Aaron On Sun, Sep 14, 2008 at 11:04 PM, hubbs [EMAIL PROTECTED] wrote: I can confirm that using event delegation will fix this problem. I guess that it is just a problem with the LiveQuery plugin. Brandon, if you are where around here, could you comment on this? Thanks. On Sep 14, 2:29 pm, hubbs [EMAIL PROTECTED] wrote: I have a working example of this, and would really like help understanding why bind or livequery does not bind events to DOM elements that are inserted from an iframe. http://web2.puc.edu/PUC/files/bind.html Clicking the insert from frame link will append links to the parent frame, which won't pick up the click event. But, clicking the insert from body link will append links within the same frame and will correctly have the click events bound. Why is this happening? On Sep 12, 9:02 pm, hubbs [EMAIL PROTECTED] wrote: I have been experiencing strangeness with trying tobindevents to DOM elements that have been inserted from a different frame using .get(). For some reason the elements don't be binded with the events if they are inserted from other frame. In testing, if I try the same thingwithinthe SAME frame the the events get binded correctly. Am I missing something here? Is this a limitation of jQuery?
[jQuery] Re: cool new DatePicker with a familiar name, but how to make multi-month start with current
Wow, that's got some pretty styling. Good find. I don't know how to modify the plugin code, but I found that if you want to display the current month as the first month, you can set the current value to a date in next month, while leaving the date value to the date you want initially selected. As follows: $('#date').DatePicker({ flat: true, date: '2008-09-22', current: '2008-10-01', calendars: 3, starts: 1 }); Hope that helps, -Wayne On Sep 22, 2:40 pm, pedalpete [EMAIL PROTECTED] wrote: I've been using Kevin Lucks datepicker for the past few months, and I was trying to figure out how to make it a 'range' datepicker when I came acrosshttp://www.eyecon.ro/datepicker/ The naming will probably get confusing, but this is a really nice range picker. I am having one problem with it though. When I show multiple calendars on my page (3), I've got is showing last month, this month, and next month, but I'm trying to get the code to show this month, next month, following month as there is no point in having history on my site. The section of code which defines which calendars to display is [code] for (var i = ; i options.calendars; i++) { date = new Date(options.current); date.addMonths(-currentCal +i); tblCal = cal.find('table').eq(i+1); switch (tblCal[0].className) { case 'datepickerViewDays': dow = formatDate(date, 'B, Y'); [/code] changing to 'date.addMonths(currentCal +i)' starts at next month, and everything else I've tried screws everything up. Any idea how to change this code to show this month?
[jQuery] using click() with $(event.target).is(something)
I'm a Jquery newbie, so if this answer is available somewhere, please let me know. My user needs to click button B, which processes some info with AJAX (working great), and then needs to programmatically click button A, which itself runs an AJAX request. Button B works fine, but when it tries $('a.buttonA').click() the code in button A doesn't run. I suspect this is because I'm using $(event.target).is('a.buttonB'), resulting in no binding for click() to run. Can anyone confirm? Any suggestions to fix this? Thanks!
[jQuery] Re: using click() with $(event.target).is(something)
If the click event for button A happens after the page load, then you'll need to rebind the event for button A in button b's success block. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of light-blue Sent: Monday, September 22, 2008 3:24 PM To: jQuery (English) Subject: [jQuery] using click() with $(event.target).is(something) I'm a Jquery newbie, so if this answer is available somewhere, please let me know. My user needs to click button B, which processes some info with AJAX (working great), and then needs to programmatically click button A, which itself runs an AJAX request. Button B works fine, but when it tries $('a.buttonA').click() the code in button A doesn't run. I suspect this is because I'm using $(event.target).is('a.buttonB'), resulting in no binding for click() to run. Can anyone confirm? Any suggestions to fix this? Thanks!
[jQuery] Re: cool new DatePicker with a familiar name, but how to make multi-month start with current
Very nice work around Wayne, can't believe I didn't think of that. Here's the code I used to set-up the next month in case anybody else needs this. [code] function multiCalDate(){ var startingDate = new Date(); var startMonth = startingDate.addMonths(1); return startMonth; } [/code] On Sep 22, 1:00 pm, Wayne [EMAIL PROTECTED] wrote: Wow, that's got some pretty styling. Good find. I don't know how to modify the plugin code, but I found that if you want to display the current month as the first month, you can set the current value to a date in next month, while leaving the date value to the date you want initially selected. As follows: $('#date').DatePicker({ flat: true, date: '2008-09-22', current: '2008-10-01', calendars: 3, starts: 1 }); Hope that helps, -Wayne On Sep 22, 2:40 pm, pedalpete [EMAIL PROTECTED] wrote: I've been using Kevin Lucks datepicker for the past few months, and I was trying to figure out how to make it a 'range' datepicker when I came acrosshttp://www.eyecon.ro/datepicker/ The naming will probably get confusing, but this is a really nice range picker. I am having one problem with it though. When I show multiple calendars on my page (3), I've got is showing last month, this month, and next month, but I'm trying to get the code to show this month, next month, following month as there is no point in having history on my site. The section of code which defines which calendars to display is [code] for (var i = ; i options.calendars; i++) { date = new Date(options.current); date.addMonths(-currentCal +i); tblCal = cal.find('table').eq(i+1); switch (tblCal[0].className) { case 'datepickerViewDays': dow = formatDate(date, 'B, Y'); [/code] changing to 'date.addMonths(currentCal +i)' starts at next month, and everything else I've tried screws everything up. Any idea how to change this code to show this month?
[jQuery] Apply JQuery to HTML returned by AJAX function $.get()
This is a problem that I can solve with callbacks, but I dont know if there is another way to do this.. Lets say that I have this HTML div id=parent pThis is the first string/p /div If i specify... $(#parent p).hover(function(){ $(this).addClass(blue); }, function(){ $(this).removeClass(blue); }); The paragraph in the div will turn to blue when I hover over it (assuming that this is what .blue does, whatever). Now here is my question, lets say I have a HTML doc called somepage.html and all it has in it is... pThis is the second paragraph/p if I add the code... $.get(somepage.html, function(data){ $(#parent).append(data); }); it will add the paragraph to the div, but this paragraph WILL NOT have the hover event applied to it. I need to add the JQuery AGAIN in the $.get() callback to get the second paragraph to change color when the mouse hovers over it. Is there someway that I can apply the JQuery to the appended HTML without having to recall the function? Thanks
[jQuery] Help with ajax contact form
I'm trying to use the ajax contact form i found from: http://capsizedesigns.com/blog/2008/04/an-ultra-slick-ajax-contact-form-with-jquery/ PHP: ?php error_reporting(E_NOTICE); function valid_email($str) { return ( ! preg_match(/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-] +)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix, $str)) ? FALSE : TRUE; } if($_POST['name']!='' $_POST['email']!='' valid_email($_POST['email'])==TRUE strlen($_POST['comment'])1) { $to = [EMAIL PROTECTED]; $headers = 'From: '.$_POST['email'].''. \r\n . 'Reply-To: '.$_POST['email'].'' . \r\n . 'X-Mailer: PHP/' . phpversion(); $subject = Contact Form; $message = htmlspecialchars($_POST['comment']); if(mail($to, $subject, $message, $headers)) { echo 1; //SUCCESS } else { echo 2; //FAILURE - server failure } } else { echo 3; //FAILURE - not valid email } ? And the js: $(document).ready(function(){ $('#myForm').ajaxForm(function(data) { if (data==1){ $('#success').fadeIn(slow); $('#myForm').resetForm(); } else if (data==2){ $('#badserver').fadeIn(slow); } else if (data==3) { $('#bademail').fadeIn(slow); } }); }); What I want it to do is still be usable when javascript is disabled. So I need to it output the actual error message though php instead of the number. I can obviously change this really easy by just putting the error message in the echo instead of there being the number. But when I try to change the javascript to match the corresponding error message, the whole script stops working. I try putting data==Please enter a valid email address. It seems to me that it should work, but I am still new to javascript and php so I could be making a stupid mistake. I would be grateful for any help.
[jQuery] Manipulating input fields
I'm trying to take the input from one text input field to the next and I'm not sure how to do it through jQuery. Can someone please send me a tutorial or example of how to do so? Right now I have: $(document).ready(function() { $(#agentfirstname).change(function() { // take the content from #agentfirstname, set it to lowercase and place it in // the text field #agentusername $(#agentusername).val($(#agentfirstname).text().toLowerCase()); alert('Here'); }); }); Where I am trying to take the input from #agentfirstname and put it in #agentusername. What functions am I to use in jQuery? Should I be using toLowerCase()? The alert appears to work, so I know jQuery is capturing the .change, I just need to know how to manipulate input fields. The HTML looks like so: input type=text name=agentfirstname id=agentfirstname class=textfield tabindex=2 / input type=text name=agentusername id=agentusername class=textfield tabindex=5 / Thanks for all your help!
[jQuery] Change Event Firing Twice
My problem is that I seem to be having a change even firing twice. Here are the details I have several checkboxes (input type=checkbox) all containing a class named metaABOCode. Whenever one is ticked or unticked (hence the change event), I want to grab some data via a json ajax call to populate some content. Everything works brilliantly, except for the fact that it seems as though the code below is being called twice (resulting in two ajax calls, etc.). Any ideas/suggestions as to why this is happening? Feel free to let me know if anything else is of glaringly poor form as well! Thanks a lot; appreciate any help you might be able to provide. The code (and using 1.2.6)... $('.metaABOCode').change(function() { $('#metaDistributorCodeTable tr.metaDynamic').remove(); if (!$(this).is(':checked')) { $('#meta_abocode_all').removeAttr('checked'); } else if ($('.metaABOCode:checked').size() == $ ('.metaABOCode').size()-1) { $('#meta_abocode_all').attr('checked','true'); } var str = ''; $('input.metaABOCode:checked').each(function() { if ($(this).attr('id').substring(13) != 'all') { str += $(this).attr('id').substring(13) + -; } }); jQuery.getJSON('/cms/page/meta/distributorcode/' + str, function(json) { var html = ''; html += 'tr class=metaDynamic'; html += 'tdinput id=meta_distributor_all class=metaDistributorCode clickable type=checkbox //td'; html += 'tdspan style=font-weight:bold;Select All/span/ td'; html += '/tr'; for (var i=0; ijson.length; i++) { html += 'tr class=metaDynamic'; html += 'tdinput id=meta_distributorcode_' + json[i] ['sp_code'] + ' class=metaDistributorCode clickable type=checkbox //td'; html += 'td' + json[i]['sp_name'] + '/td'; html += '/tr'; } $('#metaDistributorCodeTable').append(html); }); });
[jQuery] Script Errors
I receive this following error when posting a new post in WP. It freezes up my browser (i've used IE, Firefox, Opera, Chrome, etc.) every single time, please help: A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: http://www.rhymehouse.com/wp-includes/js/jquery/jquery.js?ver=1.2.6:11
[jQuery] Re: jQuery and Rails Block
If I understand your question correctly, you should be able to do it by Traversing the DOM. So, let's say that the HTML is like this: div class='one_record' pLorem ipsum.../p a class='hide_show_link' href='#'Hide/Show extra info/a div class='starts_hidden' Show this when the link is clicked. /div /div So your CSS would probably have something like: .starts_hidden { display: none; } Now, this *wouldn't* work: $( function () { $('.hide_show_link').click( function () { $('.starts_hidden').toggle(); }); }); Because clicking on a hide_show_link will toggle ALL of the things of class 'starts_hidden'. You probably want to do something like this: $( function () { // DOM is ready: $('.hide_show_link').click( function () { // in here, 'this' refers to the particular link we're inspecting. $(this).next().toggle(); // start at the current link, find the next element in the DOM, and toggle it. }); }); The reason this works is because each link hide shows the Next div in the DOM. If your HTML is different, then the code between $(this) and .toggle() will be different. See: http://docs.jquery.com/Traversing for the functions that will help you here. Cheers, -Eric On Sep 20, 10:40 am, Bob O [EMAIL PROTECTED] wrote: Hello, Im am a CSS guy moving into the world of js and RoR, so its nice to find things like jQuery and supporting groups. I am a n00b, so the more english the response the better Question: I have a rails partial that cycles a :collection. So every record in the db table receives the same HTML/CSS structure. There is a hidden div with extra info, that expands when the exposed div is clicked. the problem is ALL of the displayed :collections reveal/hide the extra content at the same time. where the HTML/CSS is dynamically generated, im not sure how to have it differentiate between each item. I have seen in the Learning jQuery book that there is a way to loop and add an index, and also some kind of append feature, but Im not quite versed enough to understand if this is what i need. any help would be great.. Thank you
[jQuery] $.modal() Not a function driving me crazy
Hi I know this is going to be something simple, but I've been looking at it for hours and just can't see it. Problem page can be found here: http://www.fridgeframes.co.uk/dashtest.html I'm trying to use the Simple Modal plugin, but just get a $ ().modal() is not a function error each time. I've put a Go! button in to see if it was a timing thing, but no joy. According to Firebug, the files are all loaded. So what am I doing wrong? Many thanks Regards John
[jQuery] Re: using click() with $(event.target).is(something)
Code samples would be really helpful here. I'm assuming that you've already attached a function to the Click event on Button B? $('.buttonB').click( ...some function to attach...); Because, unless you've done that, then running .click() isn't going to have much effect. Can you explain your reason for using $(event.target).is() in this case? I'm a bit confused as to how you're using it, and what effect that might have on the click() binding. Also, if you don't have Firebug installed yet, I'd recommend it so you can do things like: console.log( $(event.target) ) It can be helpful to find out what JS thinks a certain variable is set to. I'll try to be more helpful if you can provide more info. :-) Cheers. On Sep 22, 4:24 pm, light-blue [EMAIL PROTECTED] wrote: I'm a Jquery newbie, so if this answer is available somewhere, please let me know. My user needs to click button B, which processes some info with AJAX (working great), and then needs to programmatically click button A, which itself runs an AJAX request. Button B works fine, but when it tries $('a.buttonA').click() the code in button A doesn't run. I suspect this is because I'm using $(event.target).is('a.buttonB'), resulting in no binding for click() to run. Can anyone confirm? Any suggestions to fix this? Thanks!
[jQuery] A better way to animate this list..?
I'm new to jQuery so be gentle!! I have a menu list, and I want each li to fade in one at a time, I can do this with the following code: $(ul.menu li:first-child).fadeIn(1000, function () { $(this).next().fadeIn(1000, function () { $(this).next().fadeIn(1000, function () { $(this).next().fadeIn(1000, function () { $(this).next().fadeIn(1000, function () { $(this).next().fadeIn(1000, function (){ $(this).next().fadeIn(1000, function (){ $(this).next().fadeIn(1000); }) }); }); }); }); }); }); As you can see its not nice! I'm sure there is a better way, especially as the menu is dynamic so I'd never know how many items there are. Any help or advice is appreciated.
[jQuery] Re: How can I make sure one AJAX call returns before another?
Maybe this is something for you: http://welcome.totheinter.net/2008/09/21/bundled-and-ordered-asynchronous-ajax/ Haven't read it myseld yet, but judging from the subject of the article, it might help you. I found it on the jQuery-tweet here: http://twitter.com/jquery Regards, Mickster On Sep 22, 7:51 pm, Namlet [EMAIL PROTECTED] wrote: I have several AJAX calls. Most of them retrieve values for drop-down lists and one fills in the data. Of course, unless the drop down lists are fully loaded, the data filler doesn't select them properly. Is there anyway to trigger the data filler after they are complete with more sophistication than setTimeout? BTW, I've tried ajaxStop but that causes an infinite loop since the data filler triggers it again. Thanks!
[jQuery] tablesorter with pager addon: Adding rows with ajax and auto-sorting
I've been trying to get tablesorterPager working with AJAX addition of rows. I can get the rows added, but they are always on the last page, and are never get sorted properly. I've been trying various methods of trying to update the caches that are held by pager and tablesorter, but I haven't found the magic combination. Does anyone have example code for doing this?
[jQuery] Re: Superfish (IE cleartype bug)
Sorry, for late reply. But this code did not worked in my case. I had to stick with my code. On Aug 18, 8:56 pm, Joel Birch [EMAIL PROTECTED] wrote: Hello, 'This' should do the job (pardon the pun): onShow: function(){ if ($.browser.msie){ this.style.removeAttribute('filter'); } } Joel Birch.
[jQuery] ClueTip plugin
The ClueTip plugin seems to reject html objects when loading locally. I have a div object that loads fine if I have text in it, but if I put a table in it, the cluetip becomes empty. Can anyone else confirm this? Is it possible to load a local table in a different tooltip implementation? Thank you for your time, Steve
[jQuery] Re: Simple/obvious way to reveal items clipped by overflow:hidden ?
Could you post how you got the code to dynamically decide the height of the expanded div? I have a grid system that will possibly have text that moves outside of the alloted 100px height. It could be 105px or it could be 600px tall. On Jul 24, 11:38 pm, Su [EMAIL PROTECTED] wrote: Doh! I forgot to come back on this. What you suggest is pretty much exactly what I ended up doing once I sat on it for a bit and decided I was overthinking. I'll have to steal the selector for the animation value, though. More elegant than the variable I used *grin* Thanks. On Thu, Jul 24, 2008 at 12:11 PM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Su, One way you could do it is to make sure that the contents of the div are contained within another div. Something like this: div id=outer div h3Heading/h3 pparagraph/p panother paragraph/p !-- more stuff here -- /div /div Then you could animate the outer div to the inner div's height: $(document).ready(function() { var initHeight = $('#outer').height(); $('#outer').hover(function() { $(this).animate({height: $(' div', this).height()}, 400); }, function() { $(this).animate({height: initHeight}, 400); }); }); You don't have to animate it, of course, but I thought that would look cool. :-) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 24, 2008, at 12:22 PM, Su wrote: Let's say I have a div with a CSS height of 200px, with overflow:hidden, and so there's content clipped inside it. Is there any way to have .hover() make that div expand down to reveal the internal content, without having to manually specify the target height? Since overflow:auto produces proportional scrollbars, I have the impression that the browser /does/ know this number somehow, but I have no idea how to get at it.
[jQuery] Pb with JqModal et datepicker
Hi, I would like to display 2 datepickers in a jqm window. The problem is when I click on the second datepicker and I choose a date, the first datepicker displays and I can't choose a date for the second. This is my code : index.html !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titleUntitled Document/title link href=style/ui.datepicker.css type=text/css rel=stylesheet / link href=style/jqModal.css type=text/css rel=stylesheet / script type=text/javascript src=javascript/jquery-1.2.6.min.js/script script type=text/javascript src=javascript/jquery-ui-personalized-1.5.2.min.js/script script type=text/javascript src=javascript/jqModal.js/script /head body div class=jqmWindow id=jqm/div input type=button value=TEST onclick=TEST(); script type=text/javascript $().ready(function() { $('#jqm').jqm({ajax: 'window.html',modal:true}); }); function TEST() { $('#jqm').jqmShow(); } /script /body /html window.html div class=oneFormLine div class=fieldTitleFrom/div div class=fieldinput type=text class=calendarRange id=jqmFrom size=10/div /div div class=oneFormLine div class=fieldTitleTo/div div class=fieldinput type=text class=calendarRange id=jqmTo size=10/div /div script type=text/javascript $(document).ready(function(){ $('.calendarRange').datepicker({ showOn: 'both', buttonImage: 'images/calendar.gif', buttonImageOnly: true, dateFormat: yy-mm-dd }); }); /script -- View this message in context: http://www.nabble.com/Pb-with-JqModal-et-datepicker-tp19616071s27240p19616071.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: How can I make sure one AJAX call returns before another?
Well, here's a bit of a hackish solution, but you basically want to keep track of what happens when the first batch of Ajax calls complete. You do this by specifying functions to be called when the Ajax calls finish (succeed). http://docs.jquery.com/Ajax/jQuery.ajax#options Let's say you have three functions in the first wave and then you want to call your data filler: var counter; function start_first_wave() { counter = 0; // set counter back to zero. // trigger ajax calls for first three, specifying 'completed_func' as the success function for the ajax call } function completed_func() { counter = counter + 1; if ( counter == 3 ) { start_data_filler() } } Of course, you'd probably want to name space these, provide for the case where an AJAX call fails, etc. On Sep 22, 1:51 pm, Namlet [EMAIL PROTECTED] wrote: I have several AJAX calls. Most of them retrieve values for drop-down lists and one fills in the data. Of course, unless the drop down lists are fully loaded, the data filler doesn't select them properly. Is there anyway to trigger the data filler after they are complete with more sophistication than setTimeout? BTW, I've tried ajaxStop but that causes an infinite loop since the data filler triggers it again. Thanks!
[jQuery] Re: Tools for packing js
The jQuery developers use the YUI compressor for their releases. However, I can recommend you this one which is a bit more advanced than the YUI alternative: /packer/ http://dean.edwards.name/packer/ On Mon, Sep 22, 2008 at 4:36 PM, Manuel Meyer [EMAIL PROTECTED]wrote: Hey, few days ago I started to develop with jQuery - and I love it! I'd like to know what tool was used to pack jquery. Another thing: In the last days docs.jquery.com was down several times. Is there any mirror? Manuel -- Isaak Malik Web Developer
[jQuery] Shadowbox and AJAX
I am trying to make a page that is using the ajax call on an XML file. The trouble I am having is trying to get shadowbox to work. I need some help please. Here is the code so far script type=text/javascript !-- var $j = jQuery.noConflict(); $j(document).ready(function(){ $j.ajax({ type: GET, url: Events.xml, dataType: xml, success: function(xml) { $j(xml).find('event').each(function(){ var EventTitle = $j(this).find('title').text(); var StartDate = $j(this).find('start').text(); var EndDate = $j(this).find('end').text(); var EventDesc = $j(this).find('description').text(); var url = $j(this).find('url').text(); var trigger = $j(this).find('trigger').text(); if (url != ' ') { $j('div class=StoreEvent/div').html('div class=StoreEventTitle'+EventTitle+'/div'+EventDesc+'a href='+url +' rel=shadowbox class=EventLink'+trigger+'/ a').appendTo('.StoreEventGeneric'); } else { $j('div class=StoreEvent/div').html('div class=StoreEventTitle'+EventTitle+'/div'+EventDesc+' ').appendTo('.StoreEventGeneric'); } }); } }); }); -- /script
[jQuery] Re: jScrollPane and fadeIn
It seems that there is some issues with this under Internet Explorer. The DIVs load fine, but the text is missing from the scroll pane, and there is no actual slider (although the scroll track is present). It's a bit late for me to look into it now, but if look at the above page using FF, it render fine, then check it in IE, and you'll see what I mean. -R. On Sep 22, 8:43 pm, Richard Brier [EMAIL PROTECTED] wrote: Fantastic work! For posterity, to help any noobs (like me!), here is the way the script is used in its entirety... script type=text/javascript $(document).ready(function(){ $('.scroll-pane').jScrollPane(); $(#containerContent).css({visibility:'visible',display:'none'}).fadeIn(2000); }); /script http://graham-russell.co.uk/misc/newSite/ (this link may disappear once the new site is launched) -r. - Original Message From: ricardobeat [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, 22 September, 2008 19:01:33 Subject: [jQuery] Re: jScrollPane and fadeIn hmm, here's the thing: jScrollPane needs the height and width of the element it's being applied to in order to work. By setting #containerContent display:none in your CSS your effectively giving it 0 height and width, and jScrollPane keeps those measures after being applied. What I came up with is this: remove #containerContent's display:none from CSS, add visibility: hidden, then use the following JS: $('.scroll-pane').jScrollPane(); $ (#containerContent).css({visibility:'visible',display:'none'}).fadeIn(2000); - ricardo On Sep 22, 11:29 am, RitchieTheBrit [EMAIL PROTECTED] wrote: Thanks for your reply dude. I actually had the scripts grouped like that, but I wasn't sure if that was causing the problems, so I split them again, cheers for clarifying that for me. Anyway, I still have the same problem. If the contentContainer DIV is set to fadeIn, it will render any contents within it fine, until the jScrollPane class is applied to the child DIV (mainContent). This causes mainContent not to render. I have tried setting mainContent to display:block and that had no effect. Conversly, if I disable the fadeIn effect on the contentContainer DIV, the mainContent DIV displays fine, and CSS scrollbars render fine. I have uploaded all three configurations to my server... http://graham-russell.co.uk/misc/newSite/index_1.html- jScrollPane Disabled, fadeIn Enabledhttp://graham-russell.co.uk/misc/newSite/index_2.html- jScrollPane Enabled, fadeIn Disabledhttp://graham-russell.co.uk/misc/newSite/index_3.html- jScrollPane Enabled, fadeIn Enabled Any ideas? I'm going to carry on experimenting myself, I'll repost if I find a solution. Cheers guys! -R. On Sep 21, 10:46 pm, ricardobeat [EMAIL PROTECTED] wrote: You should apply the fadeIn effect to the element that contains both the content DIV and the jScrollPane controls, either #jScrollPaneContainer or #containerContent. Applying the effect to the DIV in use by jScrollPane will override it's changes. Also, jQuery provides a function for use in place of the window.onload event, and there's no need to keep your scripts separate. script .. $(document).ready(function(){ $('.scroll-pane').jScrollPane(); $(#containerContent).fadeIn(2000); }); /script On Sep 21, 6:56 am, RitchieTheBrit [EMAIL PROTECTED] wrote: Hey guys! I've searched everywhere before posting here, but I've found nothing. Anyway, I have a page that fades in a DIV on page load using fadeIn. I tried to apply the jScrollPane effect to the div, but it seems that the fadeIn effect breaks it. Is there a way around this? Below is the way I have applied the code: script type=text/javascript $(function() { $('.scroll-pane').jScrollPane(); }); /script script type=text/javascript window.onload = function() { $(div#mainContent).fadeIn(2000);} /script I'm a totaly newb, so I'm not too sure if I am calling the functions incorrectly. I have tried the opposite order as well. A demo of the page can be found athttp://graham-russell.co.uk/misc/newSite/ I am running jQuery 1.2.6 minified. Many thanks guys! -Ritchie.
[jQuery] Re: Apply JQuery to HTML returned by AJAX function $.get()
I ran into the same thing. Livequery will be your savior. http://brandonaaron.net/docs/livequery/ On Sep 22, 4:02 pm, yanbozey [EMAIL PROTECTED] wrote: This is a problem that I can solve with callbacks, but I dont know if there is another way to do this.. Lets say that I have this HTML div id=parent pThis is the first string/p /div If i specify... $(#parent p).hover(function(){ $(this).addClass(blue); }, function(){ $(this).removeClass(blue); }); The paragraph in the div will turn to blue when I hover over it (assuming that this is what .blue does, whatever). Now here is my question, lets say I have a HTML doc called somepage.html and all it has in it is... pThis is the second paragraph/p if I add the code... $.get(somepage.html, function(data){ $(#parent).append(data); }); it will add the paragraph to the div, but this paragraph WILL NOT have the hover event applied to it. I need to add the JQuery AGAIN in the $.get() callback to get the second paragraph to change color when the mouse hovers over it. Is there someway that I can apply the JQuery to the appended HTML without having to recall the function? Thanks
[jQuery] Re: $.modal() Not a function driving me crazy
OK - I have it The modal was calling in an external HTML file that contained a reference to the jquery script. Clearly a no-no! John
[jQuery] Re: using click() with $(event.target).is(something)
I think Andy might be correct about the binding issue. Since I'm relatively new to jquery, I'm likely missing something basic. Below is code sample... // $Id$ // Global killswitch if (Drupal.jsEnabled) { $(document).ready(function(){ $('body').click(function(event) { if ($(event.target).is('a.targetme')) { var listUnits = function (data) { var result = Drupal.parseJson(data); $('div.units').html(result['units']); $('div.units').css('display','inline'); $('div.units').fadeIn('slow'); } $.get(event.target, null, listUnits); return false; } if ($(event.target).is('a.unit')) { unitsLink=($(event.target).attr('href')); //global listRes = function (data) { var result = Drupal.parseJson(data); $('div.unitres').html(result['unitres']); $('div.unitres').css('display','inline'); $('div.unitres').fadeIn('slow'); } $.get(event.target, null, listRes); event.preventDefault(); //return false; } if ($(event.target).is('a.rescck-link')) { var listUnitRes = function (data) { var result = Drupal.parseJson(data); $('div.rescck').html(result['rescck']) .fadeIn('fast',function() { $.getScript('/misc/progress.js'); $.getScript('/misc/collapse.js'); $.getScript('/misc/autocomplete.js'); }).fadeIn('fast',function() { Drupal.behaviors.ajaxSubmit(); }).fadeIn('fast',function() { $('[EMAIL PROTECTED]' + unitsLink + ']').click(); }); $.ajax({ type: GET, url: unitsLink, dataType: script, success: function () {alert('great')} }); } $.get(event.target, null, listUnitRes); return false; } }); }); }
[jQuery] Re: missing ) after argument list error
Can anyone tell my why this might not work in a separate .js file but it does work from the firebug debugger? On Sep 19, 5:45 pm, switch13 [EMAIL PROTECTED] wrote: FF2 and I also tried IE6. The class is not getting added. That error is appearing in FireBug. Funny thing is, when I test it in the script window under the watch tab in firebug it works fine. On Sep 19, 5:35 pm, Aaron Heimlich [EMAIL PROTECTED] wrote: Works fine for me (Firefox 3 on Mac OS X). What browser gave you that error? On Fri, Sep 19, 2008 at 4:13 PM, switch13 [EMAIL PROTECTED] wrote: I can't see why this wouldn't work: $('h1:contains(test)').parents('body').addClass(test_class); -- Aaron Heimlich Web Developer [EMAIL PROTECTED]
[jQuery] Re: ajax request with datatype:script
I am not getting an array, I am getting ids.js contents On Sep 22, 8:12 pm, FrenchiINLA [EMAIL PROTECTED] wrote: inside of your success function success: function(data){} you should refer to 'data' if you're getting back an array, you can refer to as data[0][0] On Sep 21, 9:04 pm, seo++ [EMAIL PROTECTED] wrote: I am trying to insert array elements through ajax request, these elements are also arrays or multidimensional arrays. here is an example main script : var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: script, success: function(data){ alert( list[1][0] ); } }); ids.js contents: list[1] = [['aaa', 'bbb'], ['ccc', 'ddd']]; that would produce ' list is undefined' error but changing datatype to 'html' and adding eval() would work fine var list = []; $.ajax({ type: POST, url: 'http://example.com/ids.js', data: id=1 , dataType: html, success: function(data){ eval( data); alert( list[1][0] ); } }); any ideas what am i doing wrong ?
[jQuery] Is anyone using jQuery + Jaxer?
I've gotten so much to the point where I think jQuery for everything nowadays, I like the framework that much and really feel like I've got my programming and patterns down pat enough that I am faster/more- complete with anything I have been coding this year With that said, I'm *really* intrigued by Aptana's Jaxer product (http://aptana.com/jaxer/), but there seems to be little excitement/ progress about it. Even so, anyone in this group toying around with it at all?
[jQuery] Re: missing ) after argument list error
Do we get to see this mystery .js file? Gonna be hard to guess what's wrong otherwise. From: switch13 Can anyone tell my why this might not work in a separate .js file but it does work from the firebug debugger? ... I can't see why this wouldn't work: $('h1:contains(test)').parents('body').addClass(test_class);
[jQuery] Re: Apply JQuery to HTML returned by AJAX function $.get()
Here's some more info/options: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F - Richard On Mon, Sep 22, 2008 at 5:51 PM, Norris [EMAIL PROTECTED] wrote: I ran into the same thing. Livequery will be your savior. http://brandonaaron.net/docs/livequery/ On Sep 22, 4:02 pm, yanbozey [EMAIL PROTECTED] wrote: This is a problem that I can solve with callbacks, but I dont know if there is another way to do this.. Lets say that I have this HTML div id=parent pThis is the first string/p /div If i specify... $(#parent p).hover(function(){ $(this).addClass(blue); }, function(){ $(this).removeClass(blue); }); The paragraph in the div will turn to blue when I hover over it (assuming that this is what .blue does, whatever). Now here is my question, lets say I have a HTML doc called somepage.html and all it has in it is... pThis is the second paragraph/p if I add the code... $.get(somepage.html, function(data){ $(#parent).append(data); }); it will add the paragraph to the div, but this paragraph WILL NOT have the hover event applied to it. I need to add the JQuery AGAIN in the $.get() callback to get the second paragraph to change color when the mouse hovers over it. Is there someway that I can apply the JQuery to the appended HTML without having to recall the function? Thanks
[jQuery] Re: Superfish (IE cleartype bug)
2008/9/23 nicholasnet [EMAIL PROTECTED]: Sorry, for late reply. But this code did not worked in my case. I had to stick with my code. On Aug 18, 8:56 pm, Joel Birch [EMAIL PROTECTED] wrote: Hello, 'This' should do the job (pardon the pun): onShow: function(){ if ($.browser.msie){ this.style.removeAttribute('filter'); } } Joel Birch. Yes, I have found that it doesn't work also. However, the cleartypeFix plugin that was posted to this group around the time we began this thread works great. Joel Birch.
[jQuery] Re: superfish style current top
Hello, In the original superfish-navbar.css file there is a rule like this, which you seem to be missing: .sf-navbar li.current { background: #BDD2FF; } Joel Birch.
[jQuery] Re: Superfish and wordpress - menus show up only on first page...?
Hello, Looks like you have sorted out the problem as it seems to work fine for me. Joel Birch.