[jQuery] Re: How do I return false if no elements found using XPath?
cool technique... -GTG On 7/4/07, Klaus Hartl [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I am trying to find a particular parentElement without knowing the ID. If not I need to find a different element. SO: var parentXpath = [EMAIL PROTECTED]@id=+obj.id+]/.. [EMAIL PROTECTED]; if (*noobjectfound*) { find new object } How can I do this? I did the following once I needed something similiar: $('#item, #other-item') I knew that #item could not exist but #other-item does. So: $('#item, #other-item').eq(0).show(); If #item exists that one gets shown, if not #other-item will. Kind of build-in if-clause so to say. --Klaus
[jQuery] Re: how to animate two divs' position smoothly at the same time
Thank you! Could you tell me how to do another event while animate? On 7月5日, 下午12时12分, Ganeshji Marwaha [EMAIL PROTECTED] wrote: select both and animate... like this... $(#first, #second).animate(...); I believe john once said that, the same timer is used for all the elements if specified this way... so, you might not have problems with smoothness.. -GTG On 7/4/07, eddy [EMAIL PROTECTED] wrote: There're two divs which have the same position, div id='first' style='left:0px,top:0px,width:100px,height:100px'/ div id='second' style='left:0px,top:0px,width:100px,height:100px'/ Is there a method to move them smoothly at the same time. below is not good: $('#first').animate({left:'50px',top:'100px'},1000); $('#second').animate({left:'50px',top:'100px'},1000);
[jQuery] Re: PACKER3 issues
Thanx for sharing Will! On Jul 5, 12:37 am, Will Arp [EMAIL PROTECTED] wrote: Dear list, this has been fixed in latest jquery svn, but still need fixing in the form and metadata plugins. - eval(data = + data); + data = eval(( + data + )); related to: Ticket #1298http://dev.jquery.com/ticket/1298 I've had quite some code break using packer3 shrink option, watch out.. Thank you and have a great day! -will
[jQuery] Re: What's happened to $.expr['@'] in jQuery 1.1.3?
On Wed, Jul 04, 2007, Ralf S. Engelschall wrote: On Wed, Jul 04, 2007, Diego A. wrote: Hi John (and the team), Congratulations on the new release, it's looking great. Can't wait for 1.2... The only small problem I've had is with an old plugin I've been used for a while, which adds regular expression selectors: (function($){ $.extend($.expr['@'], { =~: z.match(RegExp(m[4]))!=null, !~: z.match(RegExp(m[4]))==null }); $.parse[0] = /^\[ *(@)([a-z0-9_-]*) *([!*$^~=]*) *('??)(.*?)\4 *\]/ i; })(jQuery); In 1.1.3, $.expr['@'] is null and causes an error. Has $.expr['@'] been dropped? Seems like the jQuery.expr stuff is now replaced by some inline code, so AFAIK the above way of adding the regex matching is no longer possible. The jQuery patch (sorry, no jQuery extension possible here AFAIK) I'm now personally using is: Index: src/jquery/src/selector/selector.js === --- src/jquery/src/selector/selector.js (revision 2248) +++ src/jquery/src/selector/selector.js (working copy) @@ -343,6 +342,8 @@ z = jQuery.attr(a,m[2]) || ''; if ( (type == !!z || +type == =~ z.match(RegExp(m[5])) != null || +type == !~ z.match(RegExp(m[5])) == null || type == = z == m[5] || type == != z != m[5] || type == ^= z !z.indexOf(m[5]) || Ralf S. Engelschall [EMAIL PROTECTED] www.engelschall.com
[jQuery] Re: jQuery 1.1.3.1
Should the changelog say 'jQuery 1.1.4 Closed Bugs'? Plus: thanks for the quick fixes! --rob On 7/5/07, John Resig [EMAIL PROTECTED] wrote: Hi Everyone - This is a quick bug fix release for jQuery 1.1.3. About six major issues popped up after the 1.1.3 release that we deemed important enough to resolve immediately, with a follow-up release. The full list of resolved issues can be found here: http://dev.jquery.com/report/16 You can download the release from the jQuery Google Code page: Uncompressed: http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.1.3.1.js Compressed: http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.1.3.1.pack.js As always, be sure to let us know if you encounter any issues by submitting a bug report to the jQuery bug tracker: http://dev.jquery.com/ Thanks and enjoy! --John -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Is it possible to show elements that is not CSS display:none;?
You could always preload images before hand (no need to use CSS tricks). http://www.texotela.co.uk/code/jquery/preload/ On Jul 5, 3:02 am, Jon [EMAIL PROTECTED] wrote: What's better than asking, is testing.. div style=position:absolute;left:-2000px; img src=path to image/ /div Much better.. Sorry if you felt I've wasted your time. On 5 Jul., 03:25, Jon [EMAIL PROTECTED] wrote: Hi Benjamin. I would like to put visibility: hidden in my css for the elements (it's thirty something divs with an image set as background) and then use jQuery to display them. But so far I haven't had any success with that approach - it only works if I set the css to display:none. By doing so the browser won't download the images until the style is changed (which is what jQuery does) but that looks awful in IE6. I thought about just turning it off if it's IE6 (it's just eye candy) but I'm not sure how to distinguish between IE6 and IE7. Sadly jQuery only offers $.browser.msie. I've been digging in Ext to see how they do it but only found isIE flag code. And I'm running out of time so... :-( puh I'm gonna grab another cup of coffee.. Do you think it would work if I use div style=position:absolute;left:-2000px; img src=path to image/ /div instead of background images? On 5 Jul., 03:01, Benjamin Sterling [EMAIL PROTECTED] wrote: Jon, I don't completely understand what you are asking for; Are you asking if there is a way to preload images and have them hidden with out display:none? If so: div style=position:absolute;left:-2000px; img src=path to image/ /div Are you asking for filter out elements with display:none? If so: $('*').filter(':hidden'); // I may be wrong on this one On 7/4/07, Jon Ege Ronnenberg [EMAIL PROTECTED] wrote: Hi all! Is it possible to show elements that is not CSS display:none;? In my case I'm showing some pictures and I don't like that the browser only downloads the pictures when I show them through jQuery. I would prefer if the browser downloaded all the pictures and then I would show them though jQuery. I know I can do it by changing the CSS instead of using show(), animate, slideDown etc. But I like the easing effect and I'm not sure of to achieve that by setting css. Any ideas to a workaround or someone who can explain to me why jQuery took this approach? Thanks! Don't misunderstand me - I really like jQuery (and especially its simplicity). -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com
[jQuery] Re: opacity in IE6.0 not works with jquery-1.1.3
SeViR schrieb: Michael Stuhr escribió: Sam Collett schrieb: is there a 'compiled' version too (of this fix)? micha I simply download the SVN version and I compiled with ant. I have attached the new trunk version compiled (packed and source version of jquery.js) thanks micha
[jQuery] Re: Release: Tooltip plugin 1.1
thanks for the update. I am loading content to a page dynamically (Ajax: $.get) and have used tooltip to apply tooltip on the fly on each part. All elements uses the same tooltip selector. My problem with the new version is tooltip fails if you call it more than once: $(.toolTip).Tooltip(); $(.toolTip).Tooltip(); It worked in the previous version! My work-around at the moment is to start a timer that applies toolTip after 2 seconds (hoping all elements are loaded) /Jens On 5 Jul., 07:01, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: It seems to happen when you put the mouse somewhere between the 'ogle' on the third link. Also, the initial input tooltip caught me off guard. When you don't hover on the input element and just click in it like you normally would to type in it, then it gives a flash effect because the tooltip comes up quickly and disappears quickly. I thought there was a glitch at first as I tried it over and over again trying to see the tooltip. Only then did it dawn on me that I had to hover before clicking. It all makes sense in hindsight but ... On Jul 4, 11:40 pm, Glen Lipka [EMAIL PROTECTED] wrote: Nice work, this looks awesome. One quirk. On the last examples (bottom right), when I mouse over in FF, the tip goes offscreen. It doesnt happen every time. Strange behavior. Glen On 7/4/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: This update to the jQuery Tooltip plugin brings a few minor yet very useful features and some very important bug fixes. A full list of changes can be found in the changelog: http://jquery.bassistance.de/tooltip/changelog.txt. Maybe more useful are improvements on the project structure. In addition to the started changelog, the plugin page (http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/) now uses the same documenation format as other plugins, provides links to an reworked demo (http://jquery.bassistance.de/tooltip/), to the latest revision from subversion (http://dev.jquery.com/browser/trunk/plugins/tooltip) and, last but not least, there is now a project on jquery.com/plugins: http://jquery.com/plugins/project/tooltip. Vote for the plugin if you like. Planned features for Tooltip 1.2 are an opacity-option and footnote and modal tooltips. Have fun! -- Jörn Zaefferer http://bassistance.de
[jQuery] Can't get hover event to work correctly in IE6
Hey there. I've looked around a bit to see if anybody was having a similar problem, but I couldn't find anything useful. I'm a part-time developer and I don't spend too much time in javascript, much less jquery (I'm a Prototype refugee), so I hope this is my fault and easily fixable. Basically, I have been trying to build out a animated drop-down menu and I have managed to make it work fairly reliably in FF and Safari, but I can't get IE6 to act properly with the jquery .hover event. The menu structure is an unordered list and IE seems to fire the hover.off function when moving between the child list items on the submenus. It causes the flicker very similar to if one were to use the mouseOver and mouseOut events in its place. I found the bug with IE6 opacity in the 1.1.3 stable release, so I have already updated to the SVN build. I have uploaded my current version to www.natetodd.com/test so you can see what I mean. (Be sure to view it in IE) I would greatly appreciate any input and corrections to help solve this issue. I would also appreciate any corrections/additions to my code as Javascript is my weakest link. Thanks a bunch and take care.
[jQuery] tableSorter - problems with changing the number of rows
I'm using the tableSorter plugin and am having a problem with the number of rows displayed; I hope I can describe the situation clearly. I'm building my table dynamically from a local javascript array, initially populated with a database query. Next, I call the tableSorter function. So far so good. Next, I click a button to apply a filter. I clear out my table body's contents with $('#bodytable tbody').empty(); I fill it up again by looping through my data, but this time skipping certain rows, ending up with a smaller table. When I click on a column head to redisplay, it thinks I had the number of rows that were originally in the table, and doesn't sort correctly. It I have a filter on when I load the page and end up with 5 rows, then remove the filter and repopulate the table with ten rows, they all get displayed. But when I click to sort, only 5 rows are displayed. I want to avoid having to refresh the page, and am hoping there is something I can do to tell tableSorter to recalculate the table size after I have repopulated the table. I tried setting useCache to false, but that didn't help. I've tried calling $(#bodytable).tableSorter() again, hoping it would reset everything, but that didn't help either. Is there a way to force it to do a recalc? Thanks for your help, this is a great group.
[jQuery] question about redirecting url after post using jquery
hi devs, i'm new to this group. i recently play with jquery and feel happy with the features and simplicity offered. however, i stumble upon a problem with redirecting url using jquery. this is my code: //Start the ajax call var $vc = jQuery.noConflict(); $vc(document).ready(function() { $vc(#vcform).submit(function() { var inputs = []; $vc(':input', this).each(function() { inputs.push(this.name + '=' + escape(this.value)); }) $vc.ajax({ type: 'GET', data: inputs.join(''), url: http://localhost:8282/rpc.php;, timeout: 1000, error: function() { alert(Failed to submit or response error); }, success: function(r) { //redirUrl = r; location.href=r; } }); return false; }); }); the ajax call is used to get url from rpc.php and then redirect the page according to response url given by rpc.php. whenever i submit my form, i always get the alert message. i have done investigation that the error is caused by this line location.href=r; anybody ever experienced this issue? in native ajax call, i can do this by just simply using this code: function createRequestObject() { var ro; var browser = navigator.appName; if(browser == Microsoft Internet Explorer){ ro = new ActiveXObject(Microsoft.XMLHTTP); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sendVcRequest() { var param = 'vctype=' + document.getElementById('vctype').value + 'vcnations=' + document.getElementById('vcnations').value; http.open('get', 'http://localhost:8282/rpc.php?' + param); http.onreadystatechange = redirectUser; http.send(null); } function redirectUser() { if(http.readyState == 4){ var res = http.responseText; location.href= res; } } thanks before
[jQuery] Re: Websnapr using jQuery
I want to be able to put any content in the bubble. Websnapr works great if you want a previewimage of a site. The Link Preview script does exactly what I need, but the author doesn't update it anymore. And it also has some bugs regarding transparancy and positioning. If it was using jQuery, these bugs would probably go away automatically - and it would be easier to maintain. And probably faster too. Kia On 7/5/07, Rey Bango [EMAIL PROTECTED] wrote: Kia, I don't recall seeing a plugin that can do that but if Websnapr does the trick and there's no conflict with jQuery, then you should consider just using it. Was there something about Websnapr that didn't quite work? Rey... Kia Niskavaara wrote: A long shot. Is there a plugin that can put bubbles on a page and position them correctly, based on the mouse position? Like the Websnapr preview service? http://www.websnapr.com/previewbubble/ http://www.websnapr.com/previewbubble/ All I've found is the link-preview: http://www.frequency-decoder.com/2006/10/25/link-preview-v2/ But it's not based on jQuery. -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com
[jQuery] Re: Problem with WebTrends JS + jQuery in IE 6
Hi All, I am quiet new to this forum and this is my first post ever. Guys i need to implement webtrends tracking for a web-site and need to use smartsource data collector, though i could find the smartsource code from the posts, but still do not know how to implement it. Do i need webtrends software for that or by placing smartsource code at the footer of all my pages would work. As i'm using it for the first time can anybody of you volunteer to make me understand how to implement this code, in a stepwise manner, Shall be grateful to you guys. Thanx Niks On Jun 15, 6:53 pm, skyeflye [EMAIL PROTECTED] wrote: Hi all, I have a client that is runningWebTrendsfor a large, enterprise web site. The wayWebTrendsworks is very simple, and similar to many other user-trackingsoftware. There is a chunk ofWebTrendsJavaScript code (they call it the SmartSource Data Collector Script), embedded in the bottom of every page's source code. This script basically just gathers several environment variables and then appends a new img / tag to the DOM. The source (src) for the image tag is loaded from a separate web server that is running theWebTrendssoftware. So, when theWebTrendsserver receives the request for this tiny image, it logs the visit to the page in itsWebTrendsdatabase. The SmartSource script (embedded at the bottom of every web page) just defines a function and then immediately invokes it, like this: function dcs_main() { // collect client info; // create a new img / object;} dcs_main(); //immediately invoke the above function The problem I am having is that 99% of the time, IE6 is not finishing the execution of theWebTrendscode, so the special img / tag is not getting appended to the DOM. This is obviously bad because then the visit to the page is not recorded byWebTrends. I also have a few simple jQuery DOM manipulations firing on $ (document).ready(). Based on some testing, my theory is that in IE6, theWebTrendsdcs_main() function is beginning its execution but it never finishes because while it is running, my simple jQuery DOM manipulations also begin, and the two scripts collide when they both try to change the DOM at the same time. There are never any errors or anything. I guess I am actually lucky that only IE6 is having this problem since any browser might have a problem with DOM manipulation collisions. One potential solution is to re-invoke theWebTrendsdcs_main() function from inside the $(document).ready() event IF the special image tag has not already been added to the DOM. That way, if the dcs_main() function was short-circuited by the jQuery scripts (or if it was somehow not invoked at all), it would definitely be re-invoked from inside the $(document).ready() event. This backup measure could help to ensure that the img / was appended to the DOM no matter what and that the visit to the page was properly recorded byWebTrends. I am just wondering if anyone else could recommend a solution with a different methodology that might not require this kind of backup measure approach. For example, if there was any way to perhaps delay my jQuery scripts in $(document).ready() from running until after theWebTrendsimg / tag had been appended to the DOM (which will happen nearly instantaneously anyway). Thanks!
[jQuery] Re: Designerly Ajax ? from newbie
Just wanted to bump this (my first post) I suppose my question relates to chaining the commands mentioned in previous post (1)(2)(3) From a 'design point of view' the fadeOut and fadeIn treatment of AJAX calls really attracts me - and from what I gather jquery is in a unique position to accomplish this... just asking for a jump start here - rough scripts welcomed - cheers john
[jQuery] Tooltip plugin as a preview bubble (Was: Websnapr using jQuery)
[EMAIL PROTECTED] wrote: Are you wanting to actually get a snapshot of a website or are you just wanting the bubbles so that you can put your own content in them? If the later, you might want to check this out: http://groups.google.com/group/jquery-en/browse_thread/thread/91bc1d17185a7b3f In his demo (http://jquery.bassistance.de/tooltip/), look for the tooltip that is fired on this text: A fancy tooltip, now with some custom positioning. It has a bubble that pops up. I've tried A fancy tooltip, now with some custom positioning. That's almost what I want. But there seems to be a problem with viewports. The bubble always look the same, even if it is to the left or above the cursor. Two questions: 1) Is it possible to set a delay before the tooltip hides? I only find a setting that adds a delay before the tooltip shows. 2) Can I make the tooltip stay as long as the mouse is above the tooltip? 3) Why is fixPNG a setting? Shouldn't this always be taken care of? Or are there any negative effects when using this setting?
[jQuery] Need to put-in web trends tracking using SmartSource data collector
Dear All, I need to use web trends tracking for a web-site...can anybody suggest me how to perform the taskdo i need to use webtrends software for that or placing smartsource data code on all webpages would workas i'm working on this for the first timecan anyone of u volunteer to tell me what all i need to dostarting from step one (though i do could find the complete smartsource data collection code in the forum).shall be grateful to u guys. Thanx regards Niks
[jQuery] Opposite of .append
Hi, guys I tried to use the .append function on a mouseover event, but I can't find a way to un-append the text I added on mouseout. Am I missing something obvious? Thx Arno
[jQuery] Re: jQuery 1.1.3.1
Hi John, Thanks for the info. I'll surely pick and play with it. I also have an issue with jquery, but i'm still investigating if it is a bug. Thanks for the good work. Cheers, Mike
[jQuery] Re: Toggle element based on value
Thanks, Here is the code I used: $(a.emailitem).click(function(){ var i = $(this).attr(id); var y = i.split(|); var url = /emailstory/index/ + y[1]; $(div.newsitememail:eq( + y[0] + )).load(url); $(div.newsitememail:eq( + y[0] + )).toggle(); } ); I'm going to put the return false into this as well. Karl Swedberg-2 wrote: Hi Damian, I think you're on the right track, too, but it looks like you might be working too hard to find the right div to toggle. The trick is to determine where the div.newsitememail element is in relation to the clicked a.emailitem in the DOM. For example, if each newsitememail is the next sibling of its corresponding emailitem, you can do something like this: $(a.emailitem).click(function(){ $(this).next().toggle(); return false; //important to include so the browser doesn't try to follow the link. }); If you need to be more specific about the element coming next, you can place the details of the element to toggle inside the .next() parentheses: .next('div.newsitememail') Hope that helps point you in the right direction. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 1, 2007, at 9:42 PM, DamianD wrote: I think i'm on the right track, my code below works...sort of: $(a.emailitem).click(function(){ $(div.newsitememail:nth(0)).toggle(); } ); Though, obviously, no mater which a.emailitem is clicked - the first newsitememail div is toggled...not exactly what is needed. I tried this: $(a.emailitem).click(function(){ var i = $(this).attr(id); $(div.newsitememail:nth(i)).toggle(); } ); Which I thought should work, but has no effect. Nothing is toggled. It is as if 'var i' is not passed to nth(). How can I get the var to pass properly? DamianD wrote: Hi, How do I toggle a div based on the div's value? Example: The site I am working on has multiple blog posts per page. Under each post is a menu. One of the menu items is for emailing the story. Under this there is a div that will display the email form. This div is hidden by default. The link is as follows: # id ?Open Email Interface This div is: div class = newsitememail value = ?php echo $stroy-id ? My logic so far has been to grab the link's id using jquery and then display the appropriate div based on the value (which is the same as the id in the link). Here is the jquery code so far: $(a.emailitem).click(function(){ var id = $(this).attr(id); } How do I toggle the correct div? -- View this message in context: http://www.nabble.com/Toggle-element- based-on-value-tf4009643s15494.html#a11387195 Sent from the JQuery mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Toggle-element-based-on-value-tf4009643s15494.html#a11442829 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: What's happened to $.expr['@'] in jQuery 1.1.3?
Thanks Ralf, you've been a great help. I'll see what I can do with this... On 05/07/07, Ralf S. Engelschall [EMAIL PROTECTED] wrote: On Wed, Jul 04, 2007, Ralf S. Engelschall wrote: On Wed, Jul 04, 2007, Diego A. wrote: Hi John (and the team), Congratulations on the new release, it's looking great. Can't wait for 1.2... The only small problem I've had is with an old plugin I've been used for a while, which adds regular expression selectors: (function($){ $.extend($.expr['@'], { =~: z.match(RegExp(m[4]))!=null, !~: z.match(RegExp(m[4]))==null }); $.parse[0] = /^\[ *(@)([a-z0-9_-]*) *([!*$^~=]*) *('??)(.*?)\4 *\]/ i; })(jQuery); In 1.1.3, $.expr['@'] is null and causes an error. Has $.expr['@'] been dropped? Seems like the jQuery.expr stuff is now replaced by some inline code, so AFAIK the above way of adding the regex matching is no longer possible. The jQuery patch (sorry, no jQuery extension possible here AFAIK) I'm now personally using is: Index: src/jquery/src/selector/selector.js === --- src/jquery/src/selector/selector.js (revision 2248) +++ src/jquery/src/selector/selector.js (working copy) @@ -343,6 +342,8 @@ z = jQuery.attr(a,m[2]) || ''; if ( (type == !!z || +type == =~ z.match(RegExp(m[5])) != null || +type == !~ z.match(RegExp(m[5])) == null || type == = z == m[5] || type == != z != m[5] || type == ^= z !z.indexOf(m[5]) || Ralf S. Engelschall [EMAIL PROTECTED] www.engelschall.com
[jQuery] [SITE SUBMISSION] www.pharmaconnectme.com
http://www.pharmaconnectme.com - the first international network created by pharmacy students for all their friends in pharmacy.. jQuery 1.1.3.1 plugins used: thickbox, form plugin, accordion, jquery flash, and various others, some custom made, some that i probably forgot to mention.. dennis.
[jQuery] Problems with jCarouselLite and hide divs
I was making my defense for my university´s project and I´m trying hide divs only to show when i click in some tab but if i hide de divs with jcarousel it dont works, but the same code without the hide divs works, i have 2 examples´s pages. with hide http://www.interalfa.com.br/sisdent/apresentacao/index1.php without hide http://www.interalfa.com.br/sisdent/apresentacao/index2.php Someone can help me? -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com
[jQuery] Re: tableSorter - problems with changing the number of rows
Hi Phil, set useCache: false then trigger this after the update. $('#bodytable').trigger(updateColumnData); I'm addressing this issue in the new 2.0 version of tablesorter supplying a simple .update() method that will rebuild the cached table. And to leak a new feature: it will contain multiple column sorting. Best regards Christian 2007/7/5, Phil Glatz [EMAIL PROTECTED]: I'm using the tableSorter plugin and am having a problem with the number of rows displayed; I hope I can describe the situation clearly. I'm building my table dynamically from a local javascript array, initially populated with a database query. Next, I call the tableSorter function. So far so good. Next, I click a button to apply a filter. I clear out my table body's contents with $('#bodytable tbody').empty(); I fill it up again by looping through my data, but this time skipping certain rows, ending up with a smaller table. When I click on a column head to redisplay, it thinks I had the number of rows that were originally in the table, and doesn't sort correctly. It I have a filter on when I load the page and end up with 5 rows, then remove the filter and repopulate the table with ten rows, they all get displayed. But when I click to sort, only 5 rows are displayed. I want to avoid having to refresh the page, and am hoping there is something I can do to tell tableSorter to recalculate the table size after I have repopulated the table. I tried setting useCache to false, but that didn't help. I've tried calling $(#bodytable).tableSorter() again, hoping it would reset everything, but that didn't help either. Is there a way to force it to do a recalc? Thanks for your help, this is a great group. -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Any official documentation for selectors extension?
Hello, Following yesterday's discussion about my :containsExactly() filter, I would like to know if there is any official documentation about selectors extension. I found this e-mail in the archives: http://www.mail-archive.com/[EMAIL PROTECTED]/msg15863.html This is the interesting extract: You can use the variables 'a' for the element being considered, 'm [3]' for whatever was in parentheses in the selector (as in the '2' in 'nth(2)' ), 'i' for the index of the element being considered, and 'r' for the whole array of elements. The strange variable names and lack of official documentation make me fear potential future changes in this feature. Any hint? -Nicolas -- Nicolas Brush HOIZEY Clever Age : http://www.clever-age.com/ Gastero Prod : http://www.gasteroprod.com/ Photos : http://www.flickr.com/gp/[EMAIL PROTECTED]/M1c002
[jQuery] Re: jQuery 1.1.3.1
-Original Message- From: John Resig [mailto:[EMAIL PROTECTED] This is a quick bug fix release for jQuery 1.1.3. About six major issues popped up after the 1.1.3 release that we deemed important enough to resolve immediately, with a follow-up release. The full list of resolved issues can be found here: http://dev.jquery.com/report/16 Grabbed the latest 1.1.3.1... fadeOut still doesn't exhibit the same behavior it did in 1.1.2? $(#warning).fadeIn(1000); Is the new behavior to hide the element first? $(#warning).css('display', 'none').fadeIn(1000); Seems like an unnecessary step... Should I open a ticket for this? Jim
[jQuery] Re: Opposite of .append
If the cell is can be emptied after mouseout do $(selector).empty(); On 7/5/07, arno [EMAIL PROTECTED] wrote: Hi, guys I tried to use the .append function on a mouseover event, but I can't find a way to un-append the text I added on mouseout. Am I missing something obvious? Thx Arno -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: Syntax for selecting a form element named 'foo[0]'?
Thanks to you both; I'm all set. Cheers. - luis On Jul 3, 3:28 pm, Aaron Heimlich [EMAIL PROTECTED] wrote: On 7/3/07, sprak [EMAIL PROTECTED] wrote: What magic am I missing to be able to grab the value? $('[EMAIL PROTECTED]categoryID[0]]').val(); Notice the quotes around categeoryID[0] -- Aaron Heimlich Web Developer [EMAIL PROTECTED]://aheimlich.freepgs.com
[jQuery] Re: Basic Example not working
To expand on this just a bit, Shelane used what is perhaps a cryptic syntax here. $(function() { // ... }); could also be written $(document).ready(function() { // ... }); So the code inside this function will now be run when the document is ready, i.e. when the DOM is loaded. The original had the following code being run as the HEAD is being loaded: $(a).click(function(){ alert(ahh); return false; }); This code binds a function to the click event of each a element found in the DOM. But since the browser hasn't started parsing the DOM for the body yet, there are no a elements to bind to, so nothing happens. If you wrap it up in the $(document).ready() call, this should work fine. Cheers, -- Scott Shelane wrote: You tried wrapping it in a ready function? script type=text/javascript $(function(){ $(a).click(function(){ alert(ahh); return false; }); }); /script On Jul 4, 12:10 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have the following code in my file, the src for the jquery file is correct. I view the page in the browser and it just goes to the jQuery page, no alert box. Any idea why this is happening? html head script type=text/javascript src=jquery-1.1.3.js/script script type=text/javascript $(a).click(function(){ alert(ahh); return false; }); /script /head body a href=http://jquery.com/;jQuery/a /body /html
[jQuery] Re: Tooltip plugin as a preview bubble (Was: Websnapr using jQuery)
You should probably post your questions on the thread I noted above so that the author can see them and respond. I am not familiar very familiar with the plugin, I just happened to come across it yesterday. On Jul 5, 4:14 am, Kia Niskavaara [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Are you wanting to actually get a snapshot of a website or are you just wanting the bubbles so that you can put your own content in them? If the later, you might want to check this out: http://groups.google.com/group/jquery-en/browse_thread/thread/91bc1d1... In his demo (http://jquery.bassistance.de/tooltip/), look for the tooltip that is fired on this text: A fancy tooltip, now with some custom positioning. It has a bubble that pops up. I've tried A fancy tooltip, now with some custom positioning. That's almost what I want. But there seems to be a problem with viewports. The bubble always look the same, even if it is to the left or above the cursor. Two questions: 1) Is it possible to set a delay before the tooltip hides? I only find a setting that adds a delay before the tooltip shows. 2) Can I make the tooltip stay as long as the mouse is above the tooltip? 3) Why is fixPNG a setting? Shouldn't this always be taken care of? Or are there any negative effects when using this setting?
[jQuery] Re: Opposite of .append
Benjamin Sterling wrote: If the cell is can be emptied after mouseout do $(selector).empty(); Otherwise try this: var appendable = $('spanAppend me/span'); $('#mouseover').hover( function() { appendable.appendTo('#append-here'); }, function() { appendable.remove(); // removes from dom but not from jQuery set } ); --Klaus
[jQuery] Re: Need help with JQuery + Prototype integration
On Jul 3, 12:31 pm, Ganeshji Marwaha [EMAIL PROTECTED] wrote: wow... keep us in the loop if u find a way out. The developer who wrote the JQuery portion found the answer; apparently, the toggle attribute the JQuery code was applying to elements was conflicting with something in Prototype that was using the same variable name. Renaming toggle to jqtoggle cleared up that issue. e.g., var menu = $jq(this).find(+ [EMAIL PROTECTED]'up']); becomes var menu = $jq(this).find(+ [EMAIL PROTECTED]'up']); Got to love those subtle name collisions... Cheers. - luis
[jQuery] Re: jQuery 1.1.3.1
That's correct - I think I mentioned this before but all hide/show animations require that the element be actually hidden or visible before you do the opposite animation to them (so the element should be hidden if you want to show it, and it should be visible if you want to hide it). Doing this helped to resolve a lot of sticky animation bugs that existed. --John On 7/5/07, Priest, James (NIH/NIEHS) [C] [EMAIL PROTECTED] wrote: -Original Message- From: John Resig [mailto:[EMAIL PROTECTED] This is a quick bug fix release for jQuery 1.1.3. About six major issues popped up after the 1.1.3 release that we deemed important enough to resolve immediately, with a follow-up release. The full list of resolved issues can be found here: http://dev.jquery.com/report/16 Grabbed the latest 1.1.3.1... fadeOut still doesn't exhibit the same behavior it did in 1.1.2? $(#warning).fadeIn(1000); Is the new behavior to hide the element first? $(#warning).css('display', 'none').fadeIn(1000); Seems like an unnecessary step... Should I open a ticket for this? Jim
[jQuery] Re: jQuery 1.1.3.1
Yes, that's correct. These fixes will be going into the upcoming 1.1.4 release - this mini release is just to hold everyone over. --John On 7/5/07, Rob Desbois [EMAIL PROTECTED] wrote: Should the changelog say 'jQuery 1.1.4 Closed Bugs'? Plus: thanks for the quick fixes! --rob On 7/5/07, John Resig [EMAIL PROTECTED] wrote: Hi Everyone - This is a quick bug fix release for jQuery 1.1.3. About six major issues popped up after the 1.1.3 release that we deemed important enough to resolve immediately, with a follow-up release. The full list of resolved issues can be found here: http://dev.jquery.com/report/16 You can download the release from the jQuery Google Code page: Uncompressed: http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.1.3.1.js Compressed: http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.1.3.1.pack.js As always, be sure to let us know if you encounter any issues by submitting a bug report to the jQuery bug tracker: http://dev.jquery.com/ Thanks and enjoy! --John -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: simple ahref toggle problem [beginner]
anyone? too simple? ;-) thx for the 1.1.3.1 btw.! On 4 Jul., 14:43, tlob [EMAIL PROTECTED] wrote: Hey there I have a simple beginner problem. I have a link, that is opening a new windows with flash sound in it the client wants that! hmpff.. After I clicked the link sound on the a href text should change to sound off. also the link itself should change to javascript:close.windowname; You can find my attempt herehttp://siggibucher.com/preview/soundtest.html 1. Hardcoded Link a href=javascript:popUp('sound.html') id=gomusicsound on/a 2. User KLICK (Popup opens) 3. Link change to a href=javascript:sound.close() id=gomusicsound off/a 4. User KLICK (Popup close) 5. Link change to a href=javascript:popUp('sound.html') id=gomusicsound on/a repeat from 2. got it? something is broken, and I think I am doing some basic mistakesbeginner. can someone enlighten me? Thank you very much Thomas
[jQuery] Re: What's happened to $.expr['@'] in jQuery 1.1.3?
Yeah, this was a really unfortunate change that had to be made. We really wanted to keep the extensible functionality of [EMAIL PROTECTED] but it ended up being just to incredibly slow. Moving all of the code internal was the only way to receive any sort of speed up. Sorry about that guys. --John On 7/5/07, Ralf S. Engelschall [EMAIL PROTECTED] wrote: On Wed, Jul 04, 2007, Ralf S. Engelschall wrote: On Wed, Jul 04, 2007, Diego A. wrote: Hi John (and the team), Congratulations on the new release, it's looking great. Can't wait for 1.2... The only small problem I've had is with an old plugin I've been used for a while, which adds regular expression selectors: (function($){ $.extend($.expr['@'], { =~: z.match(RegExp(m[4]))!=null, !~: z.match(RegExp(m[4]))==null }); $.parse[0] = /^\[ *(@)([a-z0-9_-]*) *([!*$^~=]*) *('??)(.*?)\4 *\]/ i; })(jQuery); In 1.1.3, $.expr['@'] is null and causes an error. Has $.expr['@'] been dropped? Seems like the jQuery.expr stuff is now replaced by some inline code, so AFAIK the above way of adding the regex matching is no longer possible. The jQuery patch (sorry, no jQuery extension possible here AFAIK) I'm now personally using is: Index: src/jquery/src/selector/selector.js === --- src/jquery/src/selector/selector.js (revision 2248) +++ src/jquery/src/selector/selector.js (working copy) @@ -343,6 +342,8 @@ z = jQuery.attr(a,m[2]) || ''; if ( (type == !!z || +type == =~ z.match(RegExp(m[5])) != null || +type == !~ z.match(RegExp(m[5])) == null || type == = z == m[5] || type == != z != m[5] || type == ^= z !z.indexOf(m[5]) || Ralf S. Engelschall [EMAIL PROTECTED] www.engelschall.com
[jQuery] Re: jQuery 1.1.3.1
-Original Message- From: John Resig [mailto:[EMAIL PROTECTED] That's correct - I think I mentioned this before but all hide/show animations require that the element be actually hidden or visible before you do the opposite animation to them (so the element should be hidden if you want to show it, and it should be visible if you want to hide it). Doing this helped to resolve a lot of sticky animation bugs Sounds good! Someone should update the documentation examples to include that... Thanks! Jim
[jQuery] Re: [SITE SUBMISSION] www.pharmaconnectme.com
Nice look site spinnach. I really like the flyout div that appears next to each bloggers pic. Very nice. I've added it to the list. spinnach wrote: http://www.pharmaconnectme.com - the first international network created by pharmacy students for all their friends in pharmacy.. jQuery 1.1.3.1 plugins used: thickbox, form plugin, accordion, jquery flash, and various others, some custom made, some that i probably forgot to mention.. dennis. -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com
[jQuery] Ranges
I'm currently working on selections and ranges for a rich text editor. Is this built into jQuery in a cross-platform way, or is there a plugin I can use? -- Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504 717 1428 Think New Orleans | http://thinknola.com/
[jQuery] Re: Problem with .text() ??
Live Example: http://rcs-comp.com/code_examples/text_function_bug/ I have some code that has a three column table in it. When the user updates some number values in one of the two columns, I have some JS that sums those columns and updates the value in the third column with that info. When updating the third column, which his a TD element, I tried to use text() to do it: var total = col1Total + col2Total; $('#wi_medical_total').text(total); Try changing the code to: $('#wi_medical_total').text(total.toString()); Without looking at the jQuery source code, my guess is it's looking for you to explicitly pass in a String object--not a Number object. Passing in a number is probably causes the jQuery to simply discard the operation. -Dan
[jQuery] Re: Opposite of .append
Very good call Klaus. On 7/5/07, Klaus Hartl [EMAIL PROTECTED] wrote: Benjamin Sterling wrote: If the cell is can be emptied after mouseout do $(selector).empty(); Otherwise try this: var appendable = $('spanAppend me/span'); $('#mouseover').hover( function() { appendable.appendTo('#append-here'); }, function() { appendable.remove(); // removes from dom but not from jQuery set } ); --Klaus -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: Manipulating a stylesheet directly
Oh, forgot to mention, I thought I'd post some code here as an example of what I'd like to be able to do (though it's not possible yet) $('.someclass').each (function (thisElemNum) { var elem = $(this); var newProps= { left: someLeftVal, top : someTopVal }; elem.animate (newProps, 'slow') }); $('.someclass', document.styles).animate ({width : 100, height: 100},'slow'); That way, the top and left, which need to be set on a per-element basis get modified the old way, but the width and height for all elements that match the given class is animated with a stylesheet rule. On Jul 4, 9:51 pm, Michael Geary [EMAIL PROTECTED] wrote: I left out one line of code in my previous reply. Add this line before the two function definitions: var head = document.getElementsByTagName('head')[0]; Oops! :-) -Mike From: Michael Geary You are definitely on the right track, Gordon. Here's the code you need: // Add a stylesheet with the given CSS styles (a text string) // and return a reference to it function addStyleSheet( css ) { var sheet = document.createElement( 'style' ); sheet.type = 'text/css'; head.appendChild( sheet ); if( sheet.styleSheet ) sheet.styleSheet.cssText = css; else sheet.appendChild( document.createTextNode(css) ); return sheet; } // Replace a stylesheet with new CSS styles (a text string) // and return a reference to it function changeStyleSheet( sheet, css ) { if( sheet.styleSheet ) sheet.styleSheet.cssText = css; else sheet.replaceChild( document.createTextNode(css), sheet.firstChild ); return sheet; } // Example - add an empty stylesheet and then // replace it with new styles var sheet = addStyleSheet( '' ); changeStyleSheet( sheet, '#test-id { /*...*/ } .test-class { /*...*/ }' ); Note that you don't try to access any existing stylesheet in your document. You could do that, but I think it's better to create a new sheet dynamically just for this purpose. Given this code, can you think of a way to set all four position and size values for *all* of your elements in a single changeStyleSheet() call, so that you won't have to set any style attributes directly on the DOM elements? That would make your animation even faster than you are hoping for. If the answer doesn't jump out at you, give me a shout back and I'll post a more detailed example. -Mike From: Gordon When working with jquery and javascript in general I have found that manipulating DOM attributes, especially those associated with the appearence of an element, can be rather slow. In one script I am working on I have to animate a group of elements at once, but each element has to get a different top and left position. This means that each element must get its own top and left styles. Another thing the loop has to do is change the width and height of the elements being processed, but in this case all elements get the same dimensions. The loop currently manipulates 4 attributes per element (style.width, style.height, style.top, style.left) and can get rather slow when working with a large number of elements. this.each (function (thisElemNum) { var elem = $(this); // Calculate the new position and dimensions for the element var newProps= { left: someLeftVal, top : someTopVal, width : 100, height : 100 }; elem.animate (newProps, speed) }); (The width and height can change from one invokation of the loop to the next, but for each invokation they remain constant for all iterations) One idea that occured to me is that instead of animating the width and height on a per-element basis, I could use CSS to define the width and height and then animate those attributes by changing the width and height degined in the stylesheet. This would mean only animating 2 attributes per element, plus a further 2 in the stylesheet as opposed to 4 attributes per element, which should hopefully lead to a considerable speedup. I would give all the elements a class, define a width and height for that class in the stylesheet and then change that with animate() in order to change the width and height of all elements similtaniously. The only problem is I have no idea how to go about doing it. Is doing what I want to be able to do even possible? If so, how do I get at the stylesheet node and manipulate it like I would a DOM element?
[jQuery] tabs plugin help
Hi everybody I'm using Klaus' tabs plugin and was wondering how to return or pull out information like attribute values from the clicked tab. Is anything like this possible? $(#mycontainer).tabs({ onClick: myFunction(args) }); Sorry if that's unclear. I can think of a slightly longer way to do things by finding the currently selected tab but was hoping there's a more elegant solution. Nice plugin by the way Klaus! Rob
[jQuery] Re: Manipulating a stylesheet directly
Thanks for the help, but that's not quite what I had in mind. I need for the dimensions of my boxes to be animated when they change, I just thought that by doing it in a stylesheet instead of the style= attribute as jQuery uses currently I'd be able to get a big speedup as then I'd only have to change 2 style= parameters per element instead of four. I don't think what I want to do with jQuery is possible in the current release, but it does give me an idea for a feature suggestion. :) On Jul 4, 9:51 pm, Michael Geary [EMAIL PROTECTED] wrote: I left out one line of code in my previous reply. Add this line before the two function definitions: var head = document.getElementsByTagName('head')[0]; Oops! :-) -Mike From: Michael Geary You are definitely on the right track, Gordon. Here's the code you need: // Add a stylesheet with the given CSS styles (a text string) // and return a reference to it function addStyleSheet( css ) { var sheet = document.createElement( 'style' ); sheet.type = 'text/css'; head.appendChild( sheet ); if( sheet.styleSheet ) sheet.styleSheet.cssText = css; else sheet.appendChild( document.createTextNode(css) ); return sheet; } // Replace a stylesheet with new CSS styles (a text string) // and return a reference to it function changeStyleSheet( sheet, css ) { if( sheet.styleSheet ) sheet.styleSheet.cssText = css; else sheet.replaceChild( document.createTextNode(css), sheet.firstChild ); return sheet; } // Example - add an empty stylesheet and then // replace it with new styles var sheet = addStyleSheet( '' ); changeStyleSheet( sheet, '#test-id { /*...*/ } .test-class { /*...*/ }' ); Note that you don't try to access any existing stylesheet in your document. You could do that, but I think it's better to create a new sheet dynamically just for this purpose. Given this code, can you think of a way to set all four position and size values for *all* of your elements in a single changeStyleSheet() call, so that you won't have to set any style attributes directly on the DOM elements? That would make your animation even faster than you are hoping for. If the answer doesn't jump out at you, give me a shout back and I'll post a more detailed example. -Mike From: Gordon When working with jquery and javascript in general I have found that manipulating DOM attributes, especially those associated with the appearence of an element, can be rather slow. In one script I am working on I have to animate a group of elements at once, but each element has to get a different top and left position. This means that each element must get its own top and left styles. Another thing the loop has to do is change the width and height of the elements being processed, but in this case all elements get the same dimensions. The loop currently manipulates 4 attributes per element (style.width, style.height, style.top, style.left) and can get rather slow when working with a large number of elements. this.each (function (thisElemNum) { var elem = $(this); // Calculate the new position and dimensions for the element var newProps= { left: someLeftVal, top : someTopVal, width : 100, height : 100 }; elem.animate (newProps, speed) }); (The width and height can change from one invokation of the loop to the next, but for each invokation they remain constant for all iterations) One idea that occured to me is that instead of animating the width and height on a per-element basis, I could use CSS to define the width and height and then animate those attributes by changing the width and height degined in the stylesheet. This would mean only animating 2 attributes per element, plus a further 2 in the stylesheet as opposed to 4 attributes per element, which should hopefully lead to a considerable speedup. I would give all the elements a class, define a width and height for that class in the stylesheet and then change that with animate() in order to change the width and height of all elements similtaniously. The only problem is I have no idea how to go about doing it. Is doing what I want to be able to do even possible? If so, how do I get at the stylesheet node and manipulate it like I would a DOM element?
[jQuery] Re: jQuery 1.1.3.1
Looking good here so far, except for one thing. The interface sliders plugin doesn't appear to work in IE anymore when using 1.1.3.x, though it still does work i FireFox. I do realise that the plan is to scrap Interface in favour of UI, but UI is a long way off yet and I need the draggable/droppable/slider/etc functionality in my main project. On Jul 5, 6:11 am, John Resig [EMAIL PROTECTED] wrote: Hi Everyone - This is a quick bug fix release for jQuery 1.1.3. About six major issues popped up after the 1.1.3 release that we deemed important enough to resolve immediately, with a follow-up release. The full list of resolved issues can be found here:http://dev.jquery.com/report/16 You can download the release from the jQuery Google Code page: Uncompressed:http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.1.3 Compressed:http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.1.3 As always, be sure to let us know if you encounter any issues by submitting a bug report to the jQuery bug tracker:http://dev.jquery.com/ Thanks and enjoy! --John
[jQuery] Re: Form submit problem when dealing with more than 1 form
Most likely the problem occurs because you're using the extend method incorrectly. If you only pass a single arg to extend it extends the jQuery object. I'm not really sure what you're trying to accomplish with this line anyway: options = jQuery.extend(options); Did you mean to use something like this instead? options = options || {}; Mike On 7/5/07, Catalin [EMAIL PROTECTED] wrote: http://groups.google.com/group/jquery-en/browse_thread/thread/0d8bdb224df6ff02 So, is no one interested in this 2 forms on one page thing?
[jQuery] Feature suggestion: animating through stylesheets
It has been my observation that, when animating a lot of elements, jQuery does so by manipulating the style attribute of each element to be animated directly. Accessign DOM attributes tends to be relitively slow in most browsers, and if you're applying an effect to a large number of elements, this can really tell as animations that were smooth for small numbers of elements grow increasingly choppy. An idea occured to me, maybe it would be possible to use stylesheet rules for animating elements instead of manipulating the DOM style attribute directly. Of course this wouldn't be practical in all circumstances, but it could lead to dramatic speedups in the circumstances where it could be applied. Foe example: Consider $('.someclass').fadeOut ('slow') as an example. In current versions of jQuery all elements that match the selector get an opacity value attached to their style attribute, which is then decremented down to 0 to produce the fadeout effect. This is fine when dealign with 10 or 20 elements, but when you're dealing with more than 100 the results are choppy enough that in some circumstances it can appear as if no animation took place at all and the elements were simply hidden. now suppose that instead of doing that the jQuery library minipulated the .someclass rule directly (or created one if it didn't exist), now there would only be 1 value that would have to be decremented for the fadeout to happen instead of (number of elements) values. This would eliminate a lot of DOM access overhead, and would hopefully mitigate the choppiness problem when working with a lot of elements. Of course doing a lot of complex animation would cause choppiness no matter what you did, but a stylesheet rules based approach might stave off the threshold between an acceptible level and unacceptible level to a considerably higher level. What do you think? Can something like this be done in a future version of jQuery? Would it be possible/practical? Would the elimated DOM overhead be worth it?
[jQuery] Re: Problems with jCarouselLite and hide divs
I was making my defense for my university´s project and I´m trying hide divs only to show when i click in some tab but if i hide de divs with jcarousel it dont works, but the same code without the hide divs works, i have 2 examples´s pages. with hide http://www.interalfa.com.br/sisdent/apresentacao/index1.php without hide http://www.interalfa.com.br/sisdent/apresentacao/index2.php Someone can help me? -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com
[jQuery] Re: Dynamically created elements do not trigger event handlers
[EMAIL PROTECTED] wrote: Is it a fact that dynamically created content cannot trigger JS events? No. The problem is that the binding is done on specific items and not on some abstract class of items. When you later add items, they don't have your particular bindings associated with them. If you are using 1.1.3, you can use the Behavior plugin: http://jquery.com/plugins/project/behavior/ If not, look at the techniques in this article, especially the final one: http://docs.jquery.com/Tutorials:AJAX_and_Events Cheers, -- Scott
[jQuery] Re: Is it possible to show elements that is not CSS display:none;?
You could always preload images before hand (no need to use CSS tricks). http://www.texotela.co.uk/code/jquery/preload/ I would recommend using new Image() to preload images--it's going to use a little less overhead (which can be important if you're preloading lots of images.) jQuery.preloadImages = function(){ for(var i=0; i arguments.length; i++){ (new Image()).src = arguments[i]; } } More information on Image(): http://www.devguru.com/Technologies/ecmascript/quickref/image.html - Dan
[jQuery] Re: What's happened to $.expr['@'] in jQuery 1.1.3?
On 7/5/07, John Resig [EMAIL PROTECTED] wrote: Yeah, this was a really unfortunate change that had to be made. We really wanted to keep the extensible functionality of [EMAIL PROTECTED] but it ended up being just to incredibly slow. Moving all of the code internal was the only way to receive any sort of speed up. Sorry about that guys. --John Is it possible to attach an else to the if statement that replaced it[1] that checks in [EMAIL PROTECTED] [1] http://dev.jquery.com/browser/tags/1.1.3.1/src/selector/selector.js#L345 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Dynamically created elements do not trigger event handlers
When I insert a content to a page by using jQuerys append and after methods, those newly created elements do not trigger any javascript events as expected. var cont = $('a').attr('href', 'http:// goto.somewhere.org').append('go to...'); cont.click(handler); function handler() { alert($(this).attr('href')); return false; } This should prevent the browser to move on the page, but it does not. Is it a fact that dynamically created content cannot trigger JS events?
[jQuery] Re: tabs plugin help
Robert O'Rourke wrote: Hi everybody I'm using Klaus' tabs plugin and was wondering how to return or pull out information like attribute values from the clicked tab. Is anything like this possible? $(#mycontainer).tabs({ onClick: myFunction(args) }); Sorry if that's unclear. I can think of a slightly longer way to do things by finding the currently selected tab but was hoping there's a more elegant solution. Nice plugin by the way Klaus! Rob Thank you Rob. You're nearly there. Three arguments are passed to the onClick/onHide/onShow callbacks. The first one being the tab that was clicked (the anchor element), the second one the container that gets shown, and the third one the container that gets hidden: $('#mycontainer').tabs({ onClick: function(clicked, toShow, toHide) { alert(clicked.href); alert(toShow.id); alert(toHide.id); } }); or by using args: $('#mycontainer').tabs({ onClick: function() { alert(args[0].href); alert(args[1].id); alert(args[2].id); } }); To get the index of the currently selected tab you can always use the activeTab method: $('#mycontainer').activeTab(); // = 2 --Klaus
[jQuery] Re: Multiple-select-box: set multiple to false
I'm trying to set a multiple-select-box to multiple=false, but neither $([EMAIL PROTECTED]).multiple = false; Try: $([EMAIL PROTECTED])[0].multiple = false; You need to actually reference the actual DOM object, not the jQuery array of objects that gets returned. -Dan
[jQuery] Re: Using part of JQuery
You can download jQuery from SVN and build your own copy. If you were to open the Makefile that's included with jQuery you'd see a list of files that are to be included in jQuery directly - you can then remove the Ajax and FX modules and build a new copy. I realize that this is convoluted, and we're working on a better way - but at least it's something for now. --John On 7/5/07, climbingrose [EMAIL PROTECTED] wrote: Hi all, I've been moving from Prototype to jQuery and absolutely love it. Thanks a lot for all the excellent work guys! I just want to ask if I can build my custom jQuery js file for my specific need just like how mootools allow developer to select and download certain modules. I know that jQuery size is already very small but it is still quite large in my current project (The size of everything after being gzipped is around 8kb). I just need to use jQuery's selector and element/css manipulation function so I don't want to include other features in the js file. Any idea? Thanks.
[jQuery] Re: Feature suggestion: animating through stylesheets
Hi Gordon, There is an extension to the .animate() method in Interface that allows you to animate classes. Perhaps it's more in line with what you're looking for? See the demo here: http://interface.eyecon.ro/demos/animate.html --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 5, 2007, at 10:38 AM, Gordon wrote: It has been my observation that, when animating a lot of elements, jQuery does so by manipulating the style attribute of each element to be animated directly. Accessign DOM attributes tends to be relitively slow in most browsers, and if you're applying an effect to a large number of elements, this can really tell as animations that were smooth for small numbers of elements grow increasingly choppy. An idea occured to me, maybe it would be possible to use stylesheet rules for animating elements instead of manipulating the DOM style attribute directly. Of course this wouldn't be practical in all circumstances, but it could lead to dramatic speedups in the circumstances where it could be applied. Foe example: Consider $('.someclass').fadeOut ('slow') as an example. In current versions of jQuery all elements that match the selector get an opacity value attached to their style attribute, which is then decremented down to 0 to produce the fadeout effect. This is fine when dealign with 10 or 20 elements, but when you're dealing with more than 100 the results are choppy enough that in some circumstances it can appear as if no animation took place at all and the elements were simply hidden. now suppose that instead of doing that the jQuery library minipulated the .someclass rule directly (or created one if it didn't exist), now there would only be 1 value that would have to be decremented for the fadeout to happen instead of (number of elements) values. This would eliminate a lot of DOM access overhead, and would hopefully mitigate the choppiness problem when working with a lot of elements. Of course doing a lot of complex animation would cause choppiness no matter what you did, but a stylesheet rules based approach might stave off the threshold between an acceptible level and unacceptible level to a considerably higher level. What do you think? Can something like this be done in a future version of jQuery? Would it be possible/practical? Would the elimated DOM overhead be worth it?
[jQuery] Multiple-select-box: set multiple to false
I'm trying to set a multiple-select-box to multiple=false, but neither $([EMAIL PROTECTED]).multiple = false; nor $([EMAIL PROTECTED]).attr('multiple',''); nor $([EMAIL PROTECTED]).attr('multiple','false'); nor $([EMAIL PROTECTED]).removeAttr('multiple'); works. Has anybody an idea? -- View this message in context: http://www.nabble.com/Multiple-select-box%3A-set-multiple-to-false-tf4030118s15494.html#a11447655 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: Setting Default Submit Button For Forms
Dan, Very interesting thought. I have always done my input elements like this: input type=submit name=btn_sumbit value=Submit / input type=submit name=btn_cancel value=Cancel / and if I wanted btn_cancel to be the default button, I would have to put it first in the form. Your example of the input elements gives me another method to try. Thank you. On Jul 5, 11:02 am, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Have you ever seen this done with an entire form, instead of just a single input element? I would like to be able to do something like: $ ('#my_form').defaultButton('#btn_submit').cancelButton('#btn_cancel'); I found a plugin on the JQuery list that did this for an input element, but not the whole form. The only other option I could think of would be to create a plug-in that did a DOM traversal through the form, looking for INPUT elements, and then adding some kind of key binding on each element it found. I would hope there would be a better way though. The whole point if this is that when hitting the enter key, while in an input (text) element, the browser normally submits the form with the POST data representing that the user clicked the first input (button) element. I want to be able to set which button is sent. It sounds like maybe you've created a form that has multiple submit buttons that also have a name attribute: input type=submit name=action value=Submit / input type=submit name=action value=Cancel / If that's correct, then if the user submits the form using the [ENTER] key, the POST data shouldn't contain a variable called action, so just perform the desire if the user didn't click the button. Adding event handling for this is overkill. -Dan
[jQuery] Re: Setting Default Submit Button For Forms
Have you ever seen this done with an entire form, instead of just a single input element? I would like to be able to do something like: $ ('#my_form').defaultButton('#btn_submit').cancelButton('#btn_cancel'); I found a plugin on the JQuery list that did this for an input element, but not the whole form. The only other option I could think of would be to create a plug-in that did a DOM traversal through the form, looking for INPUT elements, and then adding some kind of key binding on each element it found. I would hope there would be a better way though. The whole point if this is that when hitting the enter key, while in an input (text) element, the browser normally submits the form with the POST data representing that the user clicked the first input (button) element. I want to be able to set which button is sent. It sounds like maybe you've created a form that has multiple submit buttons that also have a name attribute: input type=submit name=action value=Submit / input type=submit name=action value=Cancel / If that's correct, then if the user submits the form using the [ENTER] key, the POST data shouldn't contain a variable called action, so just perform the desire if the user didn't click the button. Adding event handling for this is overkill. -Dan
[jQuery] Re: Problem with .text() ??
Dan, Yes, I figured it had to do with the type of variable it was and you are correct, that worked. However, it still doesn't make sense to me that it would work for .html() but not for .text(). Why would the two operate differently? It just seems inconsistent to me. On Jul 5, 10:23 am, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Live Example: http://rcs-comp.com/code_examples/text_function_bug/ I have some code that has a three column table in it. When the user updates some number values in one of the two columns, I have some JS that sums those columns and updates the value in the third column with that info. When updating the third column, which his a TD element, I tried to use text() to do it: var total = col1Total + col2Total; $('#wi_medical_total').text(total); Try changing the code to: $('#wi_medical_total').text(total.toString()); Without looking at the jQuery source code, my guess is it's looking for you to explicitly pass in a String object--not a Number object. Passing in a number is probably causes the jQuery to simply discard the operation. -Dan
[jQuery] Using part of JQuery
Hi all, I've been moving from Prototype to jQuery and absolutely love it. Thanks a lot for all the excellent work guys! I just want to ask if I can build my custom jQuery js file for my specific need just like how mootools allow developer to select and download certain modules. I know that jQuery size is already very small but it is still quite large in my current project (The size of everything after being gzipped is around 8kb). I just need to use jQuery's selector and element/css manipulation function so I don't want to include other features in the js file. Any idea? Thanks.
[jQuery] Re: Feature suggestion: animating through stylesheets
That wasn't quite what I was getting at. While the ability to morph between one class and another is quite nifty, as far as I can tell, it stil works by modifying the style attribute of the target elements. What I'm suggesting is a speed optimization, where animation is achieved by modifying a rule in a stylesheet instead of modifying the style attribute of the target elements. On Jul 5, 4:19 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Gordon, There is an extension to the .animate() method in Interface that allows you to animate classes. Perhaps it's more in line with what you're looking for? See the demo here: http://interface.eyecon.ro/demos/animate.html --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 5, 2007, at 10:38 AM, Gordon wrote: It has been my observation that, when animating a lot of elements, jQuery does so by manipulating the style attribute of each element to be animated directly. Accessign DOM attributes tends to be relitively slow in most browsers, and if you're applying an effect to a large number of elements, this can really tell as animations that were smooth for small numbers of elements grow increasingly choppy. An idea occured to me, maybe it would be possible to use stylesheet rules for animating elements instead of manipulating the DOM style attribute directly. Of course this wouldn't be practical in all circumstances, but it could lead to dramatic speedups in the circumstances where it could be applied. Foe example: Consider $('.someclass').fadeOut ('slow') as an example. In current versions of jQuery all elements that match the selector get an opacity value attached to their style attribute, which is then decremented down to 0 to produce the fadeout effect. This is fine when dealign with 10 or 20 elements, but when you're dealing with more than 100 the results are choppy enough that in some circumstances it can appear as if no animation took place at all and the elements were simply hidden. now suppose that instead of doing that the jQuery library minipulated the .someclass rule directly (or created one if it didn't exist), now there would only be 1 value that would have to be decremented for the fadeout to happen instead of (number of elements) values. This would eliminate a lot of DOM access overhead, and would hopefully mitigate the choppiness problem when working with a lot of elements. Of course doing a lot of complex animation would cause choppiness no matter what you did, but a stylesheet rules based approach might stave off the threshold between an acceptible level and unacceptible level to a considerably higher level. What do you think? Can something like this be done in a future version of jQuery? Would it be possible/practical? Would the elimated DOM overhead be worth it?
[jQuery] attaching events to large table
I have a table that has 1,000 rows and I'm trying to bind a function to the click event of each row. This can be quite slow the way I'm currently doing it. Here is an example my my current process: this.find(settings.selector).click(function(){selectRow(this);}); function selectRow(row){ if(row !jQuery(row).is(.+settings.selectedClass)){ table.find(settings.selector +.+settings.selectedClass).removeClass(settings.selectedClass); jQuery(row).addClass(settings.selectedClass); if(settings.selectFunction) settings.selectFunction(row); } } settings.selector = tbody tr, this=table = $(#test), settings.selectedClass=selected, settings.selectFunction =null This can take 8 seconds or more and will cause IE to display the long running script dialog on my test machine. So, now my question. Since I need to do an action on the click event of each row, is it best to bind a function to each row separately, or is there someway to bind a function to the click event of tbody and then figure out the row somehow? Also, does anybody see anything stupid with the code above that would invoke such a slowdown? Thank you in advance Josh
[jQuery] Re: Form submit problem when dealing with more than 1 form
I've replaced options = jQuery.extend(options); with options = options || {}; and it works now. Thanx Mike ! On Jul 5, 5:00 pm, Mike Alsup [EMAIL PROTECTED] wrote: Most likely the problem occurs because you're using the extend method incorrectly. If you only pass a single arg to extend it extends the jQuery object. I'm not really sure what you're trying to accomplish with this line anyway: options = jQuery.extend(options); Did you mean to use something like this instead? options = options || {}; Mike On 7/5/07, Catalin [EMAIL PROTECTED] wrote: http://groups.google.com/group/jquery-en/browse_thread/thread/0d8bdb2... So, is no one interested in this 2 forms on one page thing?
[jQuery] Re: Problem with a possible race condition
Bump. Can anyone shed some light on this? Thanks heaps, Chris On Jul 4, 3:42 pm, Christopher Jordan [EMAIL PROTECTED] wrote: Okay, just an update for anyone thinking of helping. I ran the dialog page by itself (sans thickbox) and the focus gets set just fine. So this is somehow related to thickbox. I would greatly appreciate any help. Cheers, Chris Christopher Jordan wrote: Hi folks, I'm having a problem that I hope someone out here can help me solve. I'm using thickbox to popup a dialog that asks a user for one piece of information in a text box. I want to set focus to that text box once the dialog is on screen, but I seem to be running into arace condition(*I think*). As the dialog is popping up I get an error that says focus cannot be set because the item is either invisible or not of the type that accepts focus. I've got the instruction in the $(function(){}); section of my code, but no matter where in there I put the focus instruction, it seems to be running before the element is rendered on screen. Is this because I'm using thickbox? Or is there something else I may have missed? If example code is needed, I'll post it. Thanks heaps everyone! Chris --http://cjordan.us
[jQuery] Re: Need help with JQuery + Prototype integration
glad u finally figured it out.. -GTG On 7/5/07, sprak [EMAIL PROTECTED] wrote: On Jul 3, 12:31 pm, Ganeshji Marwaha [EMAIL PROTECTED] wrote: wow... keep us in the loop if u find a way out. The developer who wrote the JQuery portion found the answer; apparently, the toggle attribute the JQuery code was applying to elements was conflicting with something in Prototype that was using the same variable name. Renaming toggle to jqtoggle cleared up that issue. e.g., var menu = $jq(this).find(+ [EMAIL PROTECTED]'up']); becomes var menu = $jq(this).find(+ [EMAIL PROTECTED]'up']); Got to love those subtle name collisions... Cheers. - luis
[jQuery] Re: Feature suggestion: animating through stylesheets
Gordon, So you are saying that if you have a class: .theAnimateClass{ position:absolute; left:0px; } That the class params should change, not the inline params to that particular element: ie, you want to move the element with the class name of theAnimateClass for current position (0px) to 100px left: This: .theAnimateClass{ position:absolute; left:0px; } would change to: .theAnimateClass{ position:absolute; left:100px; } But incrementally, stepping 1px at a time to 100px, depending on the speed. If that is what you are saying, that is an interesting idea, not sure how that would be achieved though. On 7/5/07, Gordon [EMAIL PROTECTED] wrote: That wasn't quite what I was getting at. While the ability to morph between one class and another is quite nifty, as far as I can tell, it stil works by modifying the style attribute of the target elements. What I'm suggesting is a speed optimization, where animation is achieved by modifying a rule in a stylesheet instead of modifying the style attribute of the target elements. On Jul 5, 4:19 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Gordon, There is an extension to the .animate() method in Interface that allows you to animate classes. Perhaps it's more in line with what you're looking for? See the demo here: http://interface.eyecon.ro/demos/animate.html --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 5, 2007, at 10:38 AM, Gordon wrote: It has been my observation that, when animating a lot of elements, jQuery does so by manipulating the style attribute of each element to be animated directly. Accessign DOM attributes tends to be relitively slow in most browsers, and if you're applying an effect to a large number of elements, this can really tell as animations that were smooth for small numbers of elements grow increasingly choppy. An idea occured to me, maybe it would be possible to use stylesheet rules for animating elements instead of manipulating the DOM style attribute directly. Of course this wouldn't be practical in all circumstances, but it could lead to dramatic speedups in the circumstances where it could be applied. Foe example: Consider $('.someclass').fadeOut ('slow') as an example. In current versions of jQuery all elements that match the selector get an opacity value attached to their style attribute, which is then decremented down to 0 to produce the fadeout effect. This is fine when dealign with 10 or 20 elements, but when you're dealing with more than 100 the results are choppy enough that in some circumstances it can appear as if no animation took place at all and the elements were simply hidden. now suppose that instead of doing that the jQuery library minipulated the .someclass rule directly (or created one if it didn't exist), now there would only be 1 value that would have to be decremented for the fadeout to happen instead of (number of elements) values. This would eliminate a lot of DOM access overhead, and would hopefully mitigate the choppiness problem when working with a lot of elements. Of course doing a lot of complex animation would cause choppiness no matter what you did, but a stylesheet rules based approach might stave off the threshold between an acceptible level and unacceptible level to a considerably higher level. What do you think? Can something like this be done in a future version of jQuery? Would it be possible/practical? Would the elimated DOM overhead be worth it? -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: Multiple-select-box: set multiple to false
Try: $([EMAIL PROTECTED])[0].multiple = false; You need to actually reference the actual DOM object, not the jQuery array of objects that gets returned. Thanks a lot for your help! I just wanted to reply that wouldn't work either but there was another problem: When I'm hiding some elements of the form BEFORE I set multiple to false, it doesn't work: $(#field2).hide(); $(#field3).hide(); $(#field6).hide(); $([EMAIL PROTECTED])[0].multiple = false; Like this it works: $([EMAIL PROTECTED])[0].multiple = false; $(#field2).hide(); $(#field3).hide(); $(#field6).hide(); Why that?
[jQuery] Re: Problem with .text() ??
Yes, I figured it had to do with the type of variable it was and you are correct, that worked. However, it still doesn't make sense to me that it would work for .html() but not for .text(). Why would the two operate differently? It just seems inconsistent to me. I agree. You should file a bug. Here's the source: text: function(e) { if ( typeof e == string ) return this.empty().append( document.createTextNode( e ) ); var t = ; jQuery.each( e || this, function(){ jQuery.each( this.childNodes, function(){ if ( this.nodeType != 8 ) t += this.nodeType != 1 ? this.nodeValue : jQuery.fn.text([ this ]); }); }); return t; }, The logic is assuming the only simple type value would be a string. -Dan
[jQuery] Re: Feature suggestion: animating through stylesheets
Yes, that's what I'm getting at. Like I said, I noticed with my jQuery coding and script optimization efforts that DOM access has quite a significant overhead, and that jQuery animates by manipulating the DOM style attribute for all elements being animated. If it were possible to manipulate the stylesheet rules incrementally then you could avoid that overhead. I have no idea if it's possible, but it might be worth looking into. On Jul 5, 4:52 pm, Benjamin Sterling [EMAIL PROTECTED] wrote: Gordon, So you are saying that if you have a class: .theAnimateClass{ position:absolute; left:0px; } That the class params should change, not the inline params to that particular element: ie, you want to move the element with the class name of theAnimateClass for current position (0px) to 100px left: This: .theAnimateClass{ position:absolute; left:0px; } would change to: .theAnimateClass{ position:absolute; left:100px; } But incrementally, stepping 1px at a time to 100px, depending on the speed. If that is what you are saying, that is an interesting idea, not sure how that would be achieved though. On 7/5/07, Gordon [EMAIL PROTECTED] wrote: That wasn't quite what I was getting at. While the ability to morph between one class and another is quite nifty, as far as I can tell, it stil works by modifying the style attribute of the target elements. What I'm suggesting is a speed optimization, where animation is achieved by modifying a rule in a stylesheet instead of modifying the style attribute of the target elements. On Jul 5, 4:19 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Gordon, There is an extension to the .animate() method in Interface that allows you to animate classes. Perhaps it's more in line with what you're looking for? See the demo here: http://interface.eyecon.ro/demos/animate.html --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 5, 2007, at 10:38 AM, Gordon wrote: It has been my observation that, when animating a lot of elements, jQuery does so by manipulating the style attribute of each element to be animated directly. Accessign DOM attributes tends to be relitively slow in most browsers, and if you're applying an effect to a large number of elements, this can really tell as animations that were smooth for small numbers of elements grow increasingly choppy. An idea occured to me, maybe it would be possible to use stylesheet rules for animating elements instead of manipulating the DOM style attribute directly. Of course this wouldn't be practical in all circumstances, but it could lead to dramatic speedups in the circumstances where it could be applied. Foe example: Consider $('.someclass').fadeOut ('slow') as an example. In current versions of jQuery all elements that match the selector get an opacity value attached to their style attribute, which is then decremented down to 0 to produce the fadeout effect. This is fine when dealign with 10 or 20 elements, but when you're dealing with more than 100 the results are choppy enough that in some circumstances it can appear as if no animation took place at all and the elements were simply hidden. now suppose that instead of doing that the jQuery library minipulated the .someclass rule directly (or created one if it didn't exist), now there would only be 1 value that would have to be decremented for the fadeout to happen instead of (number of elements) values. This would eliminate a lot of DOM access overhead, and would hopefully mitigate the choppiness problem when working with a lot of elements. Of course doing a lot of complex animation would cause choppiness no matter what you did, but a stylesheet rules based approach might stave off the threshold between an acceptible level and unacceptible level to a considerably higher level. What do you think? Can something like this be done in a future version of jQuery? Would it be possible/practical? Would the elimated DOM overhead be worth it? -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com
[jQuery] Re: Problems with jCarouselLite and hide divs
hi jean, i think u are using version 0.2.0. Last week 0.3.0. A few bugs were fixed as well... To start with, u might want to try that version. You can download it at http://www.gmarwaha.com/jquery/jcarousellite/index.php This should mostly fix your problem. If it doesn't try adding the following css to the div representing ur carousel. /* Needed for rendering without flicker */ position: relative; visibility: hidden; left: -5000px; Lemme know how it goes... -GTG On 7/5/07, Jean [EMAIL PROTECTED] wrote: I was making my defense for my university´s project and I´m trying hide divs only to show when i click in some tab but if i hide de divs with jcarousel it dont works, but the same code without the hide divs works, i have 2 examples´s pages. with hide http://www.interalfa.com.br/sisdent/apresentacao/index1.php without hide http://www.interalfa.com.br/sisdent/apresentacao/index2.php Someone can help me? -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com
[jQuery] Re: attaching events to large table
Josh, I have a table that has 1,000 rows and I'm trying to bind a function to the click event of each row. This can be quite slow the way I'm currently doing it. Here is an example my my current process: this.find(settings.selector).click(function(){selectRow(this);}); function selectRow(row){ if(row !jQuery(row).is(.+settings.selectedClass)){ table.find(settings.selector +.+settings.selectedClass).removeClass(settings.selectedClass); jQuery(row).addClass(settings.selectedClass); if(settings.selectFunction) settings.selectFunction(row); } } settings.selector = tbody tr, this=table = $(#test), settings.selectedClass=selected, settings.selectFunction =null This can take 8 seconds or more and will cause IE to display the long running script dialog on my test machine. So, now my question. Since I need to do an action on the click event of each row, is it best to bind a function to each row separately, or is there someway to bind a function to the click event of tbody and then figure out the row somehow? Also, does anybody see anything stupid with the code above that would invoke such a slowdown? It's definitely faster to bind the click behavior to the entire table and use the event object passed to your callback to determine whether or not to perform the behavior. // bind an onclick event to the entire table $(#table).bind( click, function (e){ alert(e.target); } ); The above function will tell you which element got click on in your table. The one gotcha is you need to do some parsing to actually find the parent element you want. I've used something like: /* if the current element is not the one we wants, search the parent nodes for a match */ function findTarget(el, selector){ var jel = $(el); return (jel.is(selector)) ? jel : jel.parents(selector); } Now you can use something like: // bind an onclick event to the entire table $(#table).bind( click, function (e){ // alert the parent tr / element alert(findTarget(e.target, tr)); } ); -Dan PS - The findTarget could easily be re-written into a jQuery plug-in.
[jQuery] Re: Multiple-select-box: set multiple to false
I just wanted to reply that wouldn't work either but there was another problem: When I'm hiding some elements of the form BEFORE I set multiple to false, it doesn't work: $(#field2).hide(); $(#field3).hide(); $(#field6).hide(); $([EMAIL PROTECTED])[0].multiple = false; Like this it works: $([EMAIL PROTECTED])[0].multiple = false; $(#field2).hide(); $(#field3).hide(); $(#field6).hide(); Why that? Are you sure you're not getting an error somewhere in the execution path? I've never tried toggling a select element between a multiple select and a single select. Quite frankly, this just feels wrong. Is there a reason you're doing this? -Dan
[jQuery] Re: What's happened to $.expr['@'] in jQuery 1.1.3?
I would like to help but you've lost me there Aaron... Is it possible to attach an else to the if statement that replaced it[1] that checks in [EMAIL PROTECTED] On 05/07/07, Aaron Heimlich [EMAIL PROTECTED] wrote: On 7/5/07, John Resig [EMAIL PROTECTED] wrote: Yeah, this was a really unfortunate change that had to be made. We really wanted to keep the extensible functionality of [EMAIL PROTECTED] but it ended up being just to incredibly slow. Moving all of the code internal was the only way to receive any sort of speed up. Sorry about that guys. --John Is it possible to attach an else to the if statement that replaced it[1] that checks in [EMAIL PROTECTED] [1] http://dev.jquery.com/browser/tags/1.1.3.1/src/selector/selector.js#L345 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Multiple-select-box: set multiple to false
Quite frankly, this just feels wrong. Is there a reason you're doing this? :-) I was thinking the same thing, Dan. In fact, I'd be surprised if this works at all. multiple may be an attribute but I think the element type (select-multiple) is the key to the actual gui component style used. If you absolutely must make this type of change in JavaScript then you're probably better off replacing the entire element with one of type select-multiple. Mike
[jQuery] Re: What's happened to $.expr['@'] in jQuery 1.1.3?
Basically, I'm wondering if something like this is feasible: if ( (type == !!z || type == = z == m[5] || type == != z != m[5] || type == ^= z !z.indexOf(m[5]) || type == $= z.substr(z.length - m[5].length) == m[5] || (type == *= || type == ~=) z.indexOf(m[5]) = 0) ^ not ) { tmp.push( a ); } else { // Check jQuery.expr[@] for custom attribute selectors } On 7/5/07, Diego A. [EMAIL PROTECTED] wrote: I would like to help but you've lost me there Aaron... Is it possible to attach an else to the if statement that replaced it[1] that checks in [EMAIL PROTECTED] On 05/07/07, Aaron Heimlich [EMAIL PROTECTED] wrote: On 7/5/07, John Resig [EMAIL PROTECTED] wrote: Yeah, this was a really unfortunate change that had to be made. We really wanted to keep the extensible functionality of [EMAIL PROTECTED] but it ended up being just to incredibly slow. Moving all of the code internal was the only way to receive any sort of speed up. Sorry about that guys. --John Is it possible to attach an else to the if statement that replaced it[1] that checks in [EMAIL PROTECTED] [1] http://dev.jquery.com/browser/tags/1.1.3.1/src/selector/selector.js#L345 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: question about Firebug...
http://www.getfirebug.com/console.html The function documented here can be called from anywhere in your JS. On 7/5/07, Andy Matthews [EMAIL PROTECTED] wrote: I see that FB has a console...is it possible to print variables to this console as my JS code progresses? * Andy Matthews *Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com inline: dealerskinslogo.bmp
[jQuery] Re: question about Firebug...
Console can be used to run functions or write functions against your page. I think you should be able to just log your variables to the logger. On 7/5/07, Andy Matthews [EMAIL PROTECTED] wrote: I see that FB has a console...is it possible to print variables to this console as my JS code progresses? * Andy Matthews *Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com inline: dealerskinslogo.bmp
[jQuery] Re: Feature suggestion: animating through stylesheets
Gordon, I put together a very quick example, although it does not run in ie6 (which I am sure there is a fix for) it looks OK in FF. http://www.benjaminsterling.com/experiments/jqAnimatedStyles/ The functions are from: http://www.hunlock.com/blogs/Totally_Pwn_CSS_with_Javascript On 7/5/07, Gordon [EMAIL PROTECTED] wrote: Yes, that's what I'm getting at. Like I said, I noticed with my jQuery coding and script optimization efforts that DOM access has quite a significant overhead, and that jQuery animates by manipulating the DOM style attribute for all elements being animated. If it were possible to manipulate the stylesheet rules incrementally then you could avoid that overhead. I have no idea if it's possible, but it might be worth looking into. On Jul 5, 4:52 pm, Benjamin Sterling [EMAIL PROTECTED] wrote: Gordon, So you are saying that if you have a class: .theAnimateClass{ position:absolute; left:0px; } That the class params should change, not the inline params to that particular element: ie, you want to move the element with the class name of theAnimateClass for current position (0px) to 100px left: This: .theAnimateClass{ position:absolute; left:0px; } would change to: .theAnimateClass{ position:absolute; left:100px; } But incrementally, stepping 1px at a time to 100px, depending on the speed. If that is what you are saying, that is an interesting idea, not sure how that would be achieved though. On 7/5/07, Gordon [EMAIL PROTECTED] wrote: That wasn't quite what I was getting at. While the ability to morph between one class and another is quite nifty, as far as I can tell, it stil works by modifying the style attribute of the target elements. What I'm suggesting is a speed optimization, where animation is achieved by modifying a rule in a stylesheet instead of modifying the style attribute of the target elements. On Jul 5, 4:19 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Gordon, There is an extension to the .animate() method in Interface that allows you to animate classes. Perhaps it's more in line with what you're looking for? See the demo here: http://interface.eyecon.ro/demos/animate.html --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 5, 2007, at 10:38 AM, Gordon wrote: It has been my observation that, when animating a lot of elements, jQuery does so by manipulating the style attribute of each element to be animated directly. Accessign DOM attributes tends to be relitively slow in most browsers, and if you're applying an effect to a large number of elements, this can really tell as animations that were smooth for small numbers of elements grow increasingly choppy. An idea occured to me, maybe it would be possible to use stylesheet rules for animating elements instead of manipulating the DOM style attribute directly. Of course this wouldn't be practical in all circumstances, but it could lead to dramatic speedups in the circumstances where it could be applied. Foe example: Consider $('.someclass').fadeOut ('slow') as an example. In current versions of jQuery all elements that match the selector get an opacity value attached to their style attribute, which is then decremented down to 0 to produce the fadeout effect. This is fine when dealign with 10 or 20 elements, but when you're dealing with more than 100 the results are choppy enough that in some circumstances it can appear as if no animation took place at all and the elements were simply hidden. now suppose that instead of doing that the jQuery library minipulated the .someclass rule directly (or created one if it didn't exist), now there would only be 1 value that would have to be decremented for the fadeout to happen instead of (number of elements) values. This would eliminate a lot of DOM access overhead, and would hopefully mitigate the choppiness problem when working with a lot of elements. Of course doing a lot of complex animation would cause choppiness no matter what you did, but a stylesheet rules based approach might stave off the threshold between an acceptible level and unacceptible level to a considerably higher level. What do you think? Can something like this be done in a future version of jQuery? Would it be possible/practical? Would the elimated DOM overhead be worth it? -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: Problem with a possible race condition
Chris Jordan wrote: Bump. Can anyone shed some light on this? Thanks heaps, Chris On Jul 4, 3:42 pm, Christopher Jordan [EMAIL PROTECTED] wrote: Okay, just an update for anyone thinking of helping. I ran the dialog page by itself (sans thickbox) and the focus gets set just fine. So this is somehow related to thickbox. I would greatly appreciate any help. Cheers, Chris Chris, which browser did that error occur in? I had a similiar one in IE when trying to focus (accidently) a form control that was hidden (in another tab for example). I filtered hidden ones and that worked out. So maybe you're trying to access that element just a little too early. Try a little timeout or maybe Thickbox also has an onShow callback (Thickbox Reloaded has ;-)). Another thing to look for (I also ran into this): Make sure your selector to fetch the input to get focus accidently matches an hidden input... --Klaus
[jQuery] Zebra table with hidden rows
I'm using the following code to style a table: $(table.xy tr:nth-child(odd)).addClass(odd); But before doing that I'm hiding some rows: $(tr#xy).hide(); Now the zebra pattern isn't working any more (it's an abnormal zebra), of course. How to apply the zebra-stuff just to the visible rows? -- View this message in context: http://www.nabble.com/Zebra-table-with-hidden-rows-tf4030892s15494.html#a11450217 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: Multiple-select-box: set multiple to false
Are you sure you're not getting an error somewhere in the execution path? I've never tried toggling a select element between a multiple select and a single select. It seems it just doesn't work in Safari if the .hide()-stuff is before the multiple = false. Well, whatever. Quite frankly, this just feels wrong. Is there a reason you're doing this? It's just 'cosmetics'. In my CMS there is a select-element for connections between elements of the menu. If it's an element of the mainmenu, you can choose multiple elements as a child, if it's an element of the submenu you can choose just one element as a parent.
[jQuery] Re: attaching events to large table
Thank you kind sir. You just made my day. There was two similar calls in that plugin one for click and the other for double click. It was taking 16+ seconds and is now a respectable 300ms. Josh On Jul 5, 11:03 am, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Josh, I have a table that has 1,000 rows and I'm trying to bind a function to the click event of each row. This can be quite slow the way I'm currently doing it. Here is an example my my current process: this.find(settings.selector).click(function(){selectRow(this);}); function selectRow(row){ if(row !jQuery(row).is(.+settings.selectedClass)){ table.find(settings.selector +.+settings.selectedClass).removeClass(settings.selectedClass); jQuery(row).addClass(settings.selectedClass); if(settings.selectFunction) settings.selectFunction(row); } } settings.selector = tbody tr, this=table = $(#test), settings.selectedClass=selected, settings.selectFunction =null This can take 8 seconds or more and will cause IE to display the long running script dialog on my test machine. So, now my question. Since I need to do an action on the click event of each row, is it best to bind a function to each row separately, or is there someway to bind a function to the click event of tbody and then figure out the row somehow? Also, does anybody see anything stupid with the code above that would invoke such a slowdown? It's definitely faster to bind the click behavior to the entire table and use the event object passed to your callback to determine whether or not to perform the behavior. // bind an onclick event to the entire table $(#table).bind( click, function (e){ alert(e.target); } ); The above function will tell you which element got click on in your table. The one gotcha is you need to do some parsing to actually find the parent element you want. I've used something like: /* if the current element is not the one we wants, search the parent nodes for a match */ function findTarget(el, selector){ var jel = $(el); return (jel.is(selector)) ? jel : jel.parents(selector); } Now you can use something like: // bind an onclick event to the entire table $(#table).bind( click, function (e){ // alert the parent tr / element alert(findTarget(e.target, tr)); } ); -Dan PS - The findTarget could easily be re-written into a jQuery plug-in.
[jQuery] question about Firebug...
I see that FB has a console...is it possible to print variables to this console as my JS code progresses? Andy Matthews Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/ dealerskinslogo.bmp
[jQuery] Re: Zebra table with hidden rows
This is not tested, but something like this might do it: $(table.xy tr:visible).each(function(index) { if (index %2 == 1) { $(this).addClass(odd); } }); It's perfect, thank you!
[jQuery] Load Google Analytics from jQuery
Hello! I guess if any of you have tried to load Google Analytics from JQuery. What I want to do is as simple as this: My original footer: footer.php div id=footersomething/div /body /html /footer.php Instead of put the Google Analytics on the footer, I want to include the coce before DOM is loaded: header.php [...] script type=text/javascript src=/media/js/jquery.js/script script type=text/javascript $(document).ready(function(){ // analytics code (end of page) $('div#footer').after(\n\nscript src='http://www.google- analytics.com/urchin.js' type='text/javascript'/script\n + script type='text/javascript'\n + \t_uacct = 'UA-2158413-2'\n + \turchinTracker();\n + / script); });/script header.php That way, when the DOM is loaded, my footer should look like this: mywebsite [...] div id=footersomething/div script style=display: none; src=http://www.google-analytics.com/ urchin.js type=text/javascript/script script type=text/javascript _uacct = 'UA-2158413-2' urchinTracker(); /script /body /html /mywebsite I have tried, but google doesn't seem to understand that the JS it's been loaded, even it's not on the page. Thanks for reading!! Skullman
[jQuery] Re: Problem with a possible race condition
Klaus, Thanks for responding. This is happening in both IE and FF. I hadn't thought of ThickBox having an onShow Callback. That may be my best bet. I thought that putting code in the $(function(){}); section was supposed to prevent this sort of thing. For what it's worth, here's my code for the dialog page that gets loaded into the thickbox: cfsetting showdebugoutput=false !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/ TR/html4/strict.dtd html head titleCottonwood Financial Title Loans/title style type=text/css@import url(CSS/Main.css);/style style type=text/css@import url(CSS/thickbox.css);/style !--[if IE] style type=text/css@import url(CSS/Main.ie.css);/style ![endif]-- cfscript ShowLog4JS = false; JSIncludeList = ; JSIncludeList = ListAppend(JSIncludeList, jquery.dump); JSIncludeList = ListAppend(JSIncludeList, jquery.block); JSIncludeList = ListAppend(JSIncludeList, jquery.json); JSIncludeList = ListAppend(JSIncludeList, jquery.cfjs); JSIncludeList = ListAppend(JSIncludeList, jquery.thickbox); JSIncludeList = ListAppend(JSIncludeList, jquery.dimensions); JSIncludeList = ListAppend(JSIncludeList, json); if(ShowLog4JS){ JSIncludeList = ListAppend(JSIncludeList, log4j); } /cfscript script type=text/javascript src=Include/js/jquery.js/script script type=text/javascript src=Include/js/wddx.js/script script type=text/javascript src=Include/js/jquery.AjaxCFC.js/ script CFOutputscript type=text/javascript $.AjaxCFC({require:'#JSIncludeList#'});/script/CFOutput script $(function(){ var v; var $this; var $SSN = $(#SSNID); var charCode; var keyList = 8,36,37,39,46,48,49,50,51,52,53,54,55,56,57; $SSN[0].focus(); $SSN.bind(keypress,function(e){ $this = $(this); v = $this.val(); charCode = (e.which) ? e.which : e.keyCode; //alert(charCode); if(!$.ListFind(keyList,charCode)){ alert(charCode); return false; } else if($.Len(v) 10 !$.ListFind(keyList,charCode)){ return false; } else{ //alert($.Len(v)); if(($.Len(v) == 3 || $.Len(v) == 6) charCode != 8){ $this.val(v + -); } } }); }); var CloseButtonImage = img src=\images/closebtn.gif\ style= \margin:0px; padding:0px; border:0px;\; function doSearch(){ var ssn = $(#SSNID).val(); var _ssn = ssn.replace(/[\(\)\- ]/g, ); var elmLastName, elmFirstName, elmCustomerNumber; if(_ssn.length === 9 $.IsNumeric(_ssn)){ _ssn = $.Insert(-, _ssn, 3); _ssn = $.Insert(-, _ssn, 6); $.AjaxCFC({ url: CFC/Customer.cfc, method: new, data: {SSN:_ssn}, unnamedargs: false, serialization: json, success: function(data) { //$.dump(data); if(!data.FOUNDONE){ //alert(Sorry, I was unable to locate a customer with that Social Security Number.\nCheck the number and try
[jQuery] Re: question about Firebug...
Andy, Make sure to read the docs: http://www.getfirebug.com/docs.html Lots of stuff you can do. (That link can be gotten to via the little Firebug icon next to the Inspect menu option.) To output data to the console, I usually use: console.log(); -Dan _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andy Matthews Sent: Thursday, July 05, 2007 12:55 PM To: [jQuery] Subject: [jQuery] question about Firebug... I see that FB has a console...is it possible to print variables to this console as my JS code progresses? Andy Matthews Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/ image001.gif
[jQuery] Re: question about Firebug...
Beautiful guys... Found this: http://ajax.phpmagazine.net/2006/05/firebug_the_future_of_javascri.html as soon as I sent my email. Thanks for the quick response. _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Benjamin Sterling Sent: Thursday, July 05, 2007 11:58 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: question about Firebug... Console can be used to run functions or write functions against your page. I think you should be able to just log your variables to the logger. On 7/5/07, Andy Matthews [EMAIL PROTECTED] wrote: I see that FB has a console...is it possible to print variables to this console as my JS code progresses? Andy Matthews Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/ -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com dealerskinslogo.bmp
[jQuery] Re: What's happened to $.expr['@'] in jQuery 1.1.3?
Possibly. While that would, functionally, work - it would provide a serious speed hit (requiring that each available [@] expression be parsed for every element that isn't matched. Although, that would only be in the case of when you include [@] checks. Aaron - you should file a ticket for this and I'll consider it. --John On 7/5/07, Aaron Heimlich [EMAIL PROTECTED] wrote: Basically, I'm wondering if something like this is feasible: if ( (type == !!z || type == = z == m[5] || type == != z != m[5] || type == ^= z !z.indexOf(m[5]) || type == $= z.substr(z.length - m[5].length) == m[5] || (type == *= || type == ~=) z.indexOf(m[5]) = 0) ^ not ) { tmp.push( a ); } else { // Check jQuery.expr[@] for custom attribute selectors } On 7/5/07, Diego A. [EMAIL PROTECTED] wrote: I would like to help but you've lost me there Aaron... Is it possible to attach an else to the if statement that replaced it[1] that checks in [EMAIL PROTECTED] On 05/07/07, Aaron Heimlich [EMAIL PROTECTED] wrote: On 7/5/07, John Resig [EMAIL PROTECTED] wrote: Yeah, this was a really unfortunate change that had to be made. We really wanted to keep the extensible functionality of [EMAIL PROTECTED] but it ended up being just to incredibly slow. Moving all of the code internal was the only way to receive any sort of speed up. Sorry about that guys. --John Is it possible to attach an else to the if statement that replaced it[1] that checks in [EMAIL PROTECTED] [1] http://dev.jquery.com/browser/tags/1.1.3.1/src/selector/selector.js#L345 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: question about Firebug...
I see that FB has a console...is it possible to print variables to this console as my JS code progresses? Yes, just do this: console.log('the message'); -Nicolas -- Nicolas Brush HOIZEY Clever Age : http://www.clever-age.com/ Gastero Prod : http://www.gasteroprod.com/ Photos : http://www.flickr.com/gp/[EMAIL PROTECTED]/M1c002
[jQuery] mootools accordion, all items closed at page load?
Hi! I need to use mootools accordion, but just with 1 item... so, it would be nice to have it closed when pages loads... Do you have any idea about how to achieve this? (I am stupid using javascript... :( ) TIA, and sorry for the bad english :) luciano
[jQuery] Re: Zebra table with hidden rows
backflip wrote: I'm using the following code to style a table: $(table.xy tr:nth-child(odd)).addClass(odd); But before doing that I'm hiding some rows: $(tr#xy).hide(); Now the zebra pattern isn't working any more (it's an abnormal zebra), of course. How to apply the zebra-stuff just to the visible rows? This is not tested, but something like this might do it: $(table.xy tr:visible).each(function(index) { if (index %2 == 1) { $(this).addClass(odd); } }); But if rows are being dynamically hidden and shown, you will need an else and some removeClass() calls after each change to the rows' visibility. Cheers, -- Scott
[jQuery] Re: mootools accordion, all items closed at page load?
Are you using jQuery, MooTools or both? Rey Luciano A. Ferrer wrote: Hi! I need to use mootools accordion, but just with 1 item... so, it would be nice to have it closed when pages loads... Do you have any idea about how to achieve this? (I am stupid using javascript... :( ) TIA, and sorry for the bad english :) luciano -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com
[jQuery] Re: question about redirecting url after post using jquery
You might wanna use firebug and make sure your getting a correct response. It might be making an error because what you are assigning isnt a url. On 7/5/07, Mike Fern [EMAIL PROTECTED] wrote: hi devs, i'm new to this group. i recently play with jquery and feel happy with the features and simplicity offered. however, i stumble upon a problem with redirecting url using jquery. this is my code: //Start the ajax call var $vc = jQuery.noConflict(); $vc(document).ready(function() { $vc(#vcform).submit(function() { var inputs = []; $vc(':input', this).each(function() { inputs.push(this.name + '=' + escape(this.value)); }) $vc.ajax({ type: 'GET', data: inputs.join(''), url: http://localhost:8282/rpc.php;, timeout: 1000, error: function() { alert(Failed to submit or response error); }, success: function(r) { //redirUrl = r; location.href=r; } }); return false; }); }); the ajax call is used to get url from rpc.php and then redirect the page according to response url given by rpc.php. whenever i submit my form, i always get the alert message. i have done investigation that the error is caused by this line location.href=r; anybody ever experienced this issue? in native ajax call, i can do this by just simply using this code: function createRequestObject() { var ro; var browser = navigator.appName; if(browser == Microsoft Internet Explorer){ ro = new ActiveXObject(Microsoft.XMLHTTP); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sendVcRequest() { var param = 'vctype=' + document.getElementById('vctype').value + 'vcnations=' + document.getElementById('vcnations').value; http.open('get', 'http://localhost:8282/rpc.php?' + param); http.onreadystatechange = redirectUser; http.send(null); } function redirectUser() { if(http.readyState == 4){ var res = http.responseText; location.href= res; } } thanks before
[jQuery] Re: Problems with jCarouselLite and hide divs
That wouldn't fix ur problem... For now ur best work-around is to hide the div using javascript after the call to jCarouselLite()... This way you are giving the plugin the means to construct itself before u hide it... In the mean-time, i will work on a fix for the same and keep u posted. Lemme know if the work-around works. -GTG On 7/5/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: hi jean, i think u are using version 0.2.0. Last week 0.3.0. A few bugs were fixed as well... To start with, u might want to try that version. You can download it at http://www.gmarwaha.com/jquery/jcarousellite/index.php This should mostly fix your problem. If it doesn't try adding the following css to the div representing ur carousel. /* Needed for rendering without flicker */ position: relative; visibility: hidden; left: -5000px; Lemme know how it goes... -GTG On 7/5/07, Jean [EMAIL PROTECTED] wrote: I was making my defense for my university´s project and I´m trying hide divs only to show when i click in some tab but if i hide de divs with jcarousel it dont works, but the same code without the hide divs works, i have 2 examples´s pages. with hide http://www.interalfa.com.br/sisdent/apresentacao/index1.php without hide http://www.interalfa.com.br/sisdent/apresentacao/index2.php Someone can help me? -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com
[jQuery] Re: Need to put-in web trends tracking using SmartSource data collector
Hi Nik, WebTrends is a commercial application that must be paid for. If you (or your client) do not have a paid license from WebTrends, then there is no way to use it. WebTrends sells versions of its software that they host for you and also versions that you can install on your own web server(s). As far as I know, WebTrends has no free version. You may have seen the SmartSource code I pasted in an earlier thread. That code is of no use to anyone else (except my client) since it has been customized (slightly) to work with my client's WebTrends installation. As an alternative, for free website statistics and user tracking, I recommend you look at Google Analytics. It works a little differently, but it does basically everything WebTrends does (probably more). Other, more simple user tracking software (for a small, monthly fee) include Mint and CrazyEgg. Take care, -THEO- On Jul 5, 2:41 am, nik [EMAIL PROTECTED] wrote: Dear All, I need to use web trends tracking for a web-site...can anybody suggest me how to perform the taskdo i need to use webtrends software for that or placing smartsource data code on all webpages would workas i'm working on this for the first timecan anyone of u volunteer to tell me what all i need to dostarting from step one (though i do could find the complete smartsource data collection code in the forum).shall be grateful to u guys. Thanx regards Niks
[jQuery] Re: Problems with jCarouselLite and hide divs
I will try, i think this will fix On 7/5/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: That wouldn't fix ur problem... For now ur best work-around is to hide the div using javascript after the call to jCarouselLite()... This way you are giving the plugin the means to construct itself before u hide it... In the mean-time, i will work on a fix for the same and keep u posted. Lemme know if the work-around works. -GTG On 7/5/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: hi jean, i think u are using version 0.2.0. Last week 0.3.0. A few bugs were fixed as well... To start with, u might want to try that version. You can download it at http://www.gmarwaha.com/jquery/jcarousellite/index.php This should mostly fix your problem. If it doesn't try adding the following css to the div representing ur carousel. /* Needed for rendering without flicker */ position: relative; visibility: hidden; left: -5000px; Lemme know how it goes... -GTG On 7/5/07, Jean [EMAIL PROTECTED] wrote: I was making my defense for my university´s project and I´m trying hide divs only to show when i click in some tab but if i hide de divs with jcarousel it dont works, but the same code without the hide divs works, i have 2 examples´s pages. with hide http://www.interalfa.com.br/sisdent/apresentacao/index1.php without hide http://www.interalfa.com.br/sisdent/apresentacao/index2.php Someone can help me? -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com
[jQuery] Re: Zebra table with hidden rows
This should work, too* : $(table.xy tr:visible:odd).addClass(odd) * Might not work after first table if more than one table class=xy exists on the same page. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 5, 2007, at 1:03 PM, Scott Sauyet wrote: backflip wrote: I'm using the following code to style a table: $(table.xy tr:nth-child(odd)).addClass(odd); But before doing that I'm hiding some rows: $(tr#xy).hide(); Now the zebra pattern isn't working any more (it's an abnormal zebra), of course. How to apply the zebra-stuff just to the visible rows? This is not tested, but something like this might do it: $(table.xy tr:visible).each(function(index) { if (index %2 == 1) { $(this).addClass(odd); } }); But if rows are being dynamically hidden and shown, you will need an else and some removeClass() calls after each change to the rows' visibility. Cheers, -- Scott
[jQuery] Re: tableSorter - problems with changing the number of rows
On Jul 5, 4:22 am, Christian Bach [EMAIL PROTECTED] wrote: set useCache: false then trigger this after the update. $('#bodytable').trigger(updateColumnData); Thanks, Christian; that did the trick. When I rebuild the table with more rows, sorting isn't working. If I was sorting on a particular column, the new column contents don't always come out in sorted order. Is there another trigger to force a sort update? Thanks again, Phil
[jQuery] Re: mootools accordion, all items closed at page load?
On 7/5/07, Rey Bango [EMAIL PROTECTED] wrote: Are you using jQuery, MooTools or both? Rey only jquery... I have solved it! changed the line $(dd:not(:first)).hide(); to $(dd:first).hide(); This is the right way? luciano Luciano A. Ferrer wrote: Hi! I need to use mootools accordion, but just with 1 item... so, it would be nice to have it closed when pages loads... Do you have any idea about how to achieve this? (I am stupid using javascript... :( ) TIA, and sorry for the bad english :) luciano -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com