RE: [jQuery] Re: Why mootools animations is more smooth than jquery?
They seem about the same to me as well, FF3.5.6 on Win7 -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Scott Sauyet Sent: Wednesday, January 06, 2010 1:29 PM To: jQuery (English) Subject: [jQuery] Re: Why mootools animations is more smooth than jquery? On Jan 6, 3:44 pm, Acaz Souza acazso...@gmail.com wrote: MooTools:http://www.jsfiddle.net/4vnya/ jQuery:http://www.jsfiddle.net/eFbwJ/36/ (Compare the code, the effects. You decide.) Why mootools is more smooth than jquery? It's not, at least not in my FF3.5.6 on Win XP. Haven't you been here asking this question before? Are you trying to get information or prove some obscure point? -- Scott
RE: [jQuery] Re: Does anybody know when jquery 1.3.3 or 1.4 will be released?
Have you tested the 1.4 nightly with your code? Any issues with it? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Bruce Sent: Monday, January 04, 2010 1:28 PM To: jQuery (English) Subject: [jQuery] Re: Does anybody know when jquery 1.3.3 or 1.4 will be released? January 14th is only 10 days away. Hope it will be on time. On Dec 31 2009, 4:13 pm, Šime Vidas sime.vi...@gmail.com wrote: I read somewhere, on January 14th
RE: [jQuery] Re: Create PDF from js
The jsPDF project, while interesting, has a long way to go. Their demo page at http://jspdf.googlecode.com/svn/trunk/examples/basic.htm Worked fine in Safari for iPhone and Safari for Windows, but broke in Chrome and Firefox 3. And no IE support at this time. Seems a bit tricky to use a product that will only support a small percentage of internet browsers. Is there any downside for you in using server-side technology? There are many many solutions available. JK -Original Message- From: m.ugues [mailto:m.ug...@gmail.com] Sent: Monday, November 09, 2009 8:48 AM To: jQuery (English) Subject: [jQuery] Re: Create PDF from js I prefer to make the job client-side if is possible. My idea is to intercept the window.print command (where the layout is correct through the css print) and not to send it to the printer but to send it in some way to the constructor of this library http://code.google.com/p/jspdf/ Am I completely wrong? Or may it works? Kind regards Massimo On 9 Nov, 13:19, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: I'd look into something server-side if I was you:http://code.google.com/p/wkhtmltopdf/is a good option, if you have a way of running custom binaries on your server. Jonathan m.ugues wrote: Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
RE: [jQuery] Re: Create PDF from js
Can you do something like this: 1. General Java class that accepts a URL and converts it into a PDF. 2. Link on all pages that will fire the Java program passing its own url as a parameter. 3. Java program reads the contents of the url as HTML, parses it as PDF. 4. Outputs PDF stream back to browser. JK -Original Message- From: m.ugues [mailto:m.ug...@gmail.com] Sent: Monday, November 09, 2009 9:30 AM To: jQuery (English) Subject: [jQuery] Re: Create PDF from js The problem using server side option is that I have a web site with a lot of pages. For every page I need to generate a PDF; so I need to create a Java class for every html page where I reproduce the html layout (since the PDF must be the same as the html shown on the screen). Another problem is that I got a lot of form: printing a form with some text with a client side option is easy: in the server side option I need to send keep in mind all the data the user has insert. I know is a strange user requirement to save every page as PDF... I wonder if is techincally possible. Thanks a lot. Massimo On 9 Nov, 18:15, Jeffrey Kretz jeffkr...@hotmail.com wrote: The jsPDF project, while interesting, has a long way to go. Their demo page at http://jspdf.googlecode.com/svn/trunk/examples/basic.htm Worked fine in Safari for iPhone and Safari for Windows, but broke in Chrome and Firefox 3. And no IE support at this time. Seems a bit tricky to use a product that will only support a small percentage of internet browsers. Is there any downside for you in using server-side technology? There are many many solutions available. JK -Original Message- From: m.ugues [mailto:m.ug...@gmail.com] Sent: Monday, November 09, 2009 8:48 AM To: jQuery (English) Subject: [jQuery] Re: Create PDF from js I prefer to make the job client-side if is possible. My idea is to intercept the window.print command (where the layout is correct through the css print) and not to send it to the printer but to send it in some way to the constructor of this libraryhttp://code.google.com/p/jspdf/ Am I completely wrong? Or may it works? Kind regards Massimo On 9 Nov, 13:19, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: I'd look into something server-side if I was you:http://code.google.com/p/wkhtmltopdf/isa good option, if you have a way of running custom binaries on your server. Jonathan m.ugues wrote: Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
RE: [jQuery] support for IE 5.*
I concur. Recent stats have put IE 5.5 usage at less than 0.1 % of web traffic. That is a tremendous minority to worry about. From: Michel Belleville [mailto:michel.bellevi...@gmail.com] Sent: Thursday, November 05, 2009 11:27 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] support for IE 5.* Well, don't expect much to work on IE 5, and remember IE6 handles most CSS like sh... Just a question : why bother trying to be compliant to a product that's been obsolete for something like 8 years already and that no-one bothers to use anymore ? Michel Belleville 2009/11/6 ljw linne...@gmail.com jquery works with IE 6+ and three other major current browsers. Is it generally expected to work with older browsers such as IE 5.*, just not tested? If not, what generally is expected to go wrong?
RE: [jQuery] Preventing form submit
I agree, although I would add one thing to that. If you're going to PREVENT the form from submitting, bind to the form's submit event. If you're trying to SUBMIT the form, and which button you clicked is important (for example, firing a .NET server-side event), then bind to the click event of the button. JK From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: Thursday, October 29, 2009 9:28 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Preventing form submit On Thu, Oct 29, 2009 at 9:21 AM, SamCKayak s...@elearningcorner.com wrote: I've added a jQuery .onClick to a form submit. Is there a way to prevent the form from submitting? return false in the click handler. $('#myFormSubmit').click(function() { do stuff; return false; }); Altho, I'm wondering if it'd be better handled (understanding that better is subjective) to use the form's submit method rather than the submit button's click method. e.g.: $('#myFormID').submit(function() { do stuff; return false; } I can't elaborate on why, other than I've been told way back in the day that it's better to not use an onclick on a submit button, but rather the onsubmit on the form itself. Maybe somebody on the list can elaborate on that... but either way should give you the results that you're looking for. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
RE: [jQuery] jQuery minified
A common solution is to use the minified version and then gzip that file to the client. There are many gzip solutions, depending on the server you have. JSP, PHP, ASP, etc. The idea is that it compresses the minified file (sort of light a lightweight ZIP or RAR) and it is downloaded in this compressed form. The browser unzips the file when it downloads it. So that 120kb file turns into 19kb download. JK From: Ziling Zhao [mailto:zilingz...@gmail.com] Sent: Thursday, October 29, 2009 5:17 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] jQuery minified 1. The minified version is exactly the same as the full version, it is just compacted. There should no difference in functionality between the two. 2. This is not a question. On Thu, Oct 29, 2009 at 5:05 PM, Mike tombaha...@gmail.com wrote: Hey guys, i've got two questions for you: 1. What/Where i cand find are the differences between the minified and complete jQuery version?? what kind of things i can't use with minified version?? 2. the first question was because i'm developping a big web site, we want it to be visited for many users, so i'm worried about performance and loading time, and i think 120K (complete jQuery version) could be a bit too much. I must confess i'm a noob with this loading time stuff :/, so any advice you can give me is welcome. Thanks
[jQuery] Re: How to address elements (id? name? class?)
I suppose the solution depends largely on what you're trying to accomplish, as well as the event handlers. If you have an object on the page that performs search-type functions, and you need to bind events to it, you could use a class-based solution: div class=searchgrid ... Content /div $(.searchgrid).do_something(); If you had a series of special links that would open a popup window based on it's href: a class=popuplink href=page.phpLink/a $(a.popuplink).click(function(e){ do_something($(this).attr('href')); return false; }); Note that you can use the live event binding to apply to existing AND future elements. http://docs.jquery.com/Events/live Hope this helps. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of André Hänsel Sent: Monday, October 26, 2009 7:48 PM To: jQuery (English) Subject: [jQuery] How to address elements (id? name? class?) Hi, I am wondering how one should mark elements to find them later, for example to attach event handlers to them. It is clear, that id certainly IS a way to do it, but having to use unique ids is quite uncomfortable, because it requires setting up some kind of id namespace plan. As a common example, imagine there is a global search functionality in the header of every page. If I call it #search I get a problem when I later add a local search form on one of the pages. So how do you handle this? Just go ahead and set up an id plan? Using class, so both search fields have the class search and I address them using $(#header input.search) and $(#content input.search)? Or, because the aforementioned method mixes CSS-required classes with JS-required classes, use another attribute, possibly name? Regards, André
[jQuery] Re: Change row colors of table based on content
Put together a hashtable of colors based on the customer name. Something like this (untested): var hash = {}; $('#tableid tr').each(function(i){ var tr = $(this); var customer = $.trim(tr.children('td:eq(1)').html()); var color = hash[customer]; if (!color) { hash[customer] = color = getNextColor(customer); } tr.css({color:color}); }); function getNextColor(customer) { // Do something. return color; } From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Gewton Jhames Sent: Monday, October 19, 2009 1:21 PM To: jquery-en@googlegroups.com Subject: [jQuery] Change row colors of table based on content Anybody want to discuss a way to change row colors of table based on content, for example: +-|---+ |acess|COSTUMER | |-| | 1 | joseph | | 2 | mary| | 3 | john| | 4 | joseph | | 5 | joseph | | 6 | guile | | 7 | mary| | 8 | craig | +-+ in this table, the name Joseph and Mary are repeated, so, every joseph or mary row must have the same color (picked randomly or not). so as every craig, guile or john row. I don't want to use css class names based on the name of the costumers because I don't know how many costumers are and how many times they appear or repeat. thanks
[jQuery] Re: XMLHttpRequest in jQuery
This would be one way of doing that with jQuery: $.ajax({ url:https://ondemand.abc.com/xyz/sessionServlet;, success:function(results){$(#time).val(results);} }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Nits Sent: Friday, October 09, 2009 12:56 PM To: jQuery (English) Subject: [jQuery] XMLHttpRequest in jQuery I have the following piece of code for XMLHttpRequest. I want to write the jQuery equivalent for the same. Since I am new to jQuery, any help would be great!! body script type=text/javascript function ajaxFunction() { var xmlhttp; xmlhttp=new XMLHttpRequest(); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { document.form1.time.value=xmlhttp.responseText; } } xmlhttp.open(GET, https://ondemand.abc.com/xyz/sessionServlet ,true); xmlhttp.send(null); } /script form id=form1 runat=server div Name: input type=text name=username onkeyup=ajaxFunction(); / Time: input type=text name=time / /div /form /body And when I run my application and type something in the textbox, i get the following value in the adjacent ones' htmlscript window.location = 'http://localhost/sso/signonServlet? sessionID=643267726466939704344537951412a2a';/script/html
[jQuery] Re: XMLHttpRequest in jQuery
The code you have below looks, fine. I'll break it down for you. // When the document is ready. $(document).ready(function(){ // Find ALL anchor tags on the page, and bind the click event. $(a).click(function(event){ // Do not fire the default click event. event.preventDefault(); // Call the ajax method $.ajax({ url:https://ondemand.abc.com/xyz/sessionServlet;, // To this url. success:function(results) { // Fire this when done. // Look for the control with an ID of time and assign the value. $(#time).val(results); } }); }); }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Nits Sent: Friday, October 09, 2009 3:23 PM To: jQuery (English) Subject: [jQuery] Re: XMLHttpRequest in jQuery I just did this with following code: $(document).ready(function(){ $(a).click(function(event){ event.preventDefault(); $.ajax({ url:https://ondemand.abc.com/xyz/sessionServlet;, success:function(results) { $(#time).val(results); } }); }); }); What you say on this? On Oct 9, 4:11 pm, Nits nitesh.ja...@gmail.com wrote: Also I have to invoke this script on click of the link on the page...how can I do it... On Oct 9, 3:35 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote: This would be one way of doing that with jQuery: $.ajax({ url:https://ondemand.abc.com/xyz/sessionServlet;, success:function(results){$(#time).val(results);} }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Nits Sent: Friday, October 09, 2009 12:56 PM To: jQuery (English) Subject: [jQuery] XMLHttpRequest in jQuery I have the following piece of code for XMLHttpRequest. I want to write the jQuery equivalent for the same. Since I am new to jQuery, any help would be great!! body script type=text/javascript function ajaxFunction() { var xmlhttp; xmlhttp=new XMLHttpRequest(); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { document.form1.time.value=xmlhttp.responseText; } } xmlhttp.open(GET,https://ondemand.abc.com/xyz/sessionServlet ,true); xmlhttp.send(null); } /script form id=form1 runat=server div Name: input type=text name=username onkeyup=ajaxFunction(); / Time: input type=text name=time / /div /form /body And when I run my application and type something in the textbox, i get the following value in the adjacent ones' htmlscript window.location = 'http://localhost/sso/signonServlet? sessionID=643267726466939704344537951412a2a';/script/html- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Accessing functions inside $(document).ready()
It isn't necessary to define the functions inside the document.ready. Just code which is being executed. Example: function Do_Something() { /// } function Do_Something_Else() { /// } $(document).ready(function(){ Do_Something(); }); JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Matthew Sent: Monday, September 21, 2009 4:11 PM To: jQuery (English) Subject: [jQuery] Accessing functions inside $(document).ready() Hi all I've got a js file where all the functions are wrapped inside $ (document).ready(). I want to call one of the function from within the HTML but it says that the function is not defined. Any ideas? Cheers Matthew
[jQuery] Re: jQuery PDF Viewer?
Are you trying to have the browser render a PDF document WITHOUT the client having the PDF reader installed? It seems to me you would need to rely on some sort of server-side technology that would convert the PDF document into straight HTML or perhaps a SWF. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of benji++ Sent: Wednesday, September 16, 2009 3:37 PM To: jQuery (English) Subject: [jQuery] Re: jQuery PDF Viewer? On Sep 16, 5:21 am, Geert Baven geertba...@gmail.com wrote: Bumpbox works in all modern browsers. based on mootools Here's a list in which browsers it has been successfully tested: - *Firefox 3 - 3.5* - *Internet Explorer 6 | 7 | 8* - *Google Chrome* - *Apple Safari 3 | 4* - *Opera 9.04* This one too only works if the browser has the Adobe Reader plugin, otherwise you just get the browser's default behavior. So it's a lot of showbiz with all that boingy window for no result. I tried it in Firefox and the window boinged open, but then I just got the usual Firefox dialog asking if I wanted to download the PDF. Thanks anyway for the suggestion though. The plugin looks good otherwise, I just wouldn't say that it supports PDF, really.
[jQuery] Re: IE8 Selector Bug?
My guess is its related to a problem I ran into with the Sizzle child selectors in 1.3.x I opened a ticket about a month ago http://dev.jquery.com/ticket/4917 But it hasn't been reviewed yet. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of gentry Sent: Wednesday, August 12, 2009 10:26 AM To: jQuery (English) Subject: [jQuery] IE8 Selector Bug? Anybody know why this doesn't work in IE8 with jQuery version 1.2.6? It works in the latest jQuery version but I can't move to it yet because of some other issues. I'm trying to clear all the textboxes in a table row but only the 1st textbox gets cleared in IE8. $('#Row_1 input[type=text]').each(function() { $(this).val(''); });
[jQuery] Re: Get vars from one event function to another
If both events are bound to the same object, you can use the .data method: var obj = $('#element') .data('info',val) .bind('click',do_something) .bind('blur',something_else); function do_something(e) { var el = $(this); var info = el.data('info'); ... el.data('results',val2); } function something_else(e) { var el = $(this); var info = el.data('info'); var results = el.data('results'); ... } -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Nic Hubbard Sent: Wednesday, August 12, 2009 5:05 PM To: jQuery (English) Subject: [jQuery] Re: Get vars from one event function to another Thanks James for that tip. Still looking for how to pass a var from one event function to another... On Aug 12, 4:28 pm, James james.gp@gmail.com wrote: I'm not sure I understand what you're trying to do with the change() function... You know you can get the value of a select just with val(). You don't have to loop through each option to find which is selected. select id=mySelect option value=11/option option value=22/option /select var myVal = $(#mySelect).val(); // 1 or 2 On Aug 12, 1:18 pm, Nic Hubbard nnhubb...@gmail.com wrote: I am confused about how to do this the right way. I have a change event which grabs the value of the selected option list and sets that as a var. But, I would like to add that to the end of my post string when I submit the form, how would I do this? $('select').change(function() { $('select option:selected').each(function() { var my_val = $(this).val(); });//end each });//end change $('#my_submit').submit(function() { var action = $('form').attr('action'); // How do I get my_val variable into here?? $('form').attr('action', action + 'new_parm=' + my_val); });
[jQuery] Re: $.browser returning 'wrong' browser version - anyone seen this UA string before?
Firstly, your original UA is probably IE7/Vista. This is a proper msie6 browser detection script: $.browser.msie6 = $.browser.msie /MSIE 6\.0/i.test(window.navigator.userAgent) !/MSIE 7\.0/i.test(window.navigator.userAgent); Secondly, the whole idea behind feature detection is to remove the need for browser support. Are you trying to do a browser detection for CSS reasons? What is the problem you're trying to solve with browser detection? Maybe there's a better way. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of w1ntermut3 Sent: Wednesday, July 15, 2009 4:24 AM To: jQuery (English) Subject: [jQuery] Re: $.browser returning 'wrong' browser version - anyone seen this UA string before? Thanks, although it doesn't appear to be working for me. script type=text/javascript $(document).ready(function(){ sHTML = ; sHTML += boxModel: + $.support.boxModel sHTML += br/cssFloat: + $.support.cssFloat sHTML += br/hrefNormalized: + $.support.hrefNormalized sHTML += br/htmlSerialize: + $.support.htmlSerialize sHTML += br/leadingWhitespace: + $.support.leadingWhitespace sHTML += br/noCloneEvent: + $.support.noCloneEvent sHTML += br/objectAll: + $.support.objectAll sHTML += br/opacity: + $.support.opacity sHTML += br/scriptEval: + $.support.scriptEval sHTML += br/style: + $.support.style sHTML += br/tbody: + $.support.tbody $('#ie6').html(sHTML); }); Every one of those properties is currently returning false for me in both IE6 and IE7. I have no way of telling them apart. What am I doing wrong?
[jQuery] Re: Calling ASMX from JQuery
Correct. Try visiting your asmx page in a browser. http: //localhost/BoATransformation/Survey.asmx?op=GetSurvey You will be shown the exact format needed to make your request. JK From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Joseph Le Brech Sent: Monday, May 18, 2009 1:47 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Calling ASMX from JQuery doesn't asmx wrap the json in a soap object? Date: Mon, 18 May 2009 12:51:05 -0700 Subject: [jQuery] Re: Calling ASMX from JQuery From: brakes...@gmail.com To: jquery-en@googlegroups.com Check in Firebug if the service returns data or a 501 error. Its under CONSOLE. You should allow it to Show XMLHTTPRequests Also, 1. The URL part seems to have an extra space after HTTP.. or maybe its just a typo: url: http: //localhost/BoATransformation/Survey.asmx/ GetSurvey 2. Or try removing http://localhost totally On May 18, 3:30 pm, ebeworld ebewo...@gmail.com wrote: Hi, I am trying to call ASMX method from JQuery without success. Following is my code and don't understand what i am missing. Thanks, Ebe ///Something.js function setQuestion() { $.ajax({ type: POST, data: {}, dataType: json, url: http: //localhost/BoATransformation/Survey.asmx/ GetSurvey, contentType: application/json; charset=utf-8, success: onSuccess }); } function onSuccess(msg) { $(#questionCxt).append(msg); } ///SomethingElse.cs [WebService(Namespace = http://tempuri.org/;)] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService] public class Survey : System.Web.Services.WebService { public Survey () { } [WebMethod] [ScriptMethod(UseHttpGet = true)] public string GetSurvey() { return Question: Who is Snoopy?; } } _ Upgrade to Internet Explorer 8 Optimised for MSN. Download Now http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U
[jQuery] Re: regex backreference with text()?
Untested, but you may need to use the non-greedy form of .* to make this work: /.*?(\d+).*/ JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ricardo Sent: Monday, May 11, 2009 1:09 PM To: jQuery (English) Subject: [jQuery] Re: regex backreference with text()? On May 11, 2:23 pm, waseem sabjee waseemsab...@gmail.com wrote: var t = $(#myid).text(); $ (#myid).text(t.replace(' left in stock',''); t = $(#myid).text(); if(t == 1) { $ (#myid).text(t.replace(t,'only '+t+' item remain');} else { $ (#myid).text(t.replace(t,t+' items remaining'); } There are simpler and more robust ways to do that than replacing the exact phrase: Doing a regex replace using a back-reference: var $stock = $('#myel'); $stock.text( $stock.text().replace(/.*(\d+).*/, 'Only $1 remaining') ); // $1 is a back reference to the (last) digit matched in the string, in between parenthesis Or simply grabbing the number: var $stock = $('#myel'); var num = /\d+/.exec( $stock.text() )[0]; $stock.text('Only '+num+' remaining'); cheers -- ricardo
[jQuery] Re: Selector help needed
You can also create a closure: $(document).ready(function(){ $('#menulinks a').hover(function(){ var fn = function(el){ return function(){ $(el).stop().animate({ top : '40px', paddingTop : '40px' }); el = null; }; }(this); setTimeout(fn,1000); }); }); The double-function pattern above will create a closure with its own scope, having a variable named el with a reference to that specific element. Nulling out that variable helps prevent memory leaks that can be caused by just such a closure. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Tuesday, April 28, 2009 7:35 PM To: jQuery (English) Subject: [jQuery] Re: Selector help needed You'll have to build up the selector as a string when you call setTimeout, that function is run out of the context of being within that .each statement so you'll have to do something like (and there's many ways of doing this, i'll just show quick and easy), and yeah, the a's will have to have IDs on them $(document).ready(function(){ $('#menulinks a').hover(function(){ setTimeout('$(#' + this.id + ').stop().animate({ top : 40px, paddingTop : 40px });', 1000); }); }); On Apr 28, 10:21 pm, Warfang warfang...@gmail.com wrote: Here's my code: $(document).ready(function(){ $('#menulinks a').hover(function(){ setTimeout(function(){ $(this).stop().animate({ top : '40px', paddingTop : '40px' }); }, 1000); }); }); Before I added a timeout, (this) sufficed. With the timeout set, (this) did not select the hovered link. I tried another selector and it worked fine. How can I specify (this) for this situation? -- View this message in context:http://www.nabble.com/Selector-help-needed-tp23289341s27240p23289341 ... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: With IE8 out, how do you test for IE6?
+1. I found Multiple IE to be inaccurate for certain types of CSS and Javascript. I've used VPC for my compatibility testing for some time now and swear by it. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Dhana Sent: Monday, March 23, 2009 8:04 PM To: jQuery (English) Subject: [jQuery] Re: With IE8 out, how do you test for IE6? The best way if you use Windows is to install virtual PC. Get the Virtual PC for free from Microsoft here http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3- AFA2-2DC0B40A73B6displaylang=en Then, download the VHD images here. They usually expire after a few months, but Microsoft normally puts new ones up. http://www.microsoft.com/downloads/details.aspx?displaylang=enFamilyID=7c2b 5317-a40f-4e86-8835-d37170c5923e On Mar 23, 2:53 pm, KathyW kat...@home.albury.net.au wrote: On Mar 23, 11:59 pm, Eridius bas...@gmail.com wrote: However, after i installed IE8, Multiple IE stopped render correctly (I use Multiple IE to test for IE6 and this is only at work since I have yet to find a way to run IE6 on Vista at home). I'd read of issues with ie8 install *after* MultipleIE, so when I set up an XP test box last week I installed the ie8 rc1 *before* installing MultipleIE and it all works fine. Perhaps you should remove and re-install MultipleIE ? ie8 probably clobbered some of the dlls ... Good luck, KathyW.
[jQuery] Re: Implementing a Knob Control
If I could second this from a usability perspective. I've used a flash-based interface that had a rotating knob. Moving that with a mouse was counter-intuitive. Dragging a straight slider (horizontal or vertical) just felt a lot better. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Eric Garside Sent: Monday, January 26, 2009 11:41 AM To: jQuery (English) Subject: [jQuery] Re: Implementing a Knob Control Canvas is probably the most elegant way to go, especially given the type of knobs you want. My suggestion is to find a decent resolution image of the knob you want, then use jquery and canvas to move the knob, and just keep track of the position. Be aware though, the mouse isn't really well designed for a knob kind of motion. On Jan 26, 1:56 pm, legofish pen...@gmail.com wrote: by the way by this approach I meant the second example on that page. On Jan 26, 1:54 pm, legofish pen...@gmail.com wrote: James, yes I mean a rotary control. Eric, here's a real-world example of what I'm trying to implement: http://www.niji.or.jp/home/k-nisi/sa-9900-h.jpg I'm looking for control knobs such as those found on a stereo; both continuous ones such as a volume knob, and n-step knobs such as the function knob in that picture, where the knob can only be rotated in n steps. I found some leads which I was going to try. I was going to mix this approach:http://blog.circlecube.com/2008/03/tutorial/interactive-spin-action sc... with the jquery rotate plugin:http://stackoverflow.com/questions/365820/howto-rotate-image-using-jq ... Still, your help would be immensely appreciated. Of course I would want the knob image to look like it's rotating, but I also want the control to return a value depending on its position, similar to how a slider returns a value. Thanks again On Jan 26, 10:20 am, Eric Garside gars...@gmail.com wrote: Legofish, I've got a couple ideas which might get the job done, but they all depend on what style of knob you want. Take a look around a google image search, and see if you can find a good representation of the type of knob you want. Then we can go from there. :) On Jan 26, 10:03 am, James Hughes j.hug...@kainos.com wrote: Do you mean a gague control? IE some sort of rotary control vs a slider? From: jquery-en@googlegroups.com on behalf of legofish Sent: Mon 26/01/2009 14:49 To: jQuery (English) Subject: [jQuery] Implementing a Knob Control Hi, I need to implement a knob control for one of my projects (eg. a volume knob). Ideally I would like to use jquery. I have spent some time searching for any resources to get started. Not only I can't find anything in jquery, I can't find anything even resembling a knob implementation in javascript in general. I did find a few sites who sell VB or .net knob controls, but nothing in js. anyway, not sure if anyone can help, but any hints towards a resource or starting point would be much appreciated. This e-mail is intended solely for the addressee and is strictly confidential; if you are not the addressee please destroy the message and all copies. Any opinion or information contained in this email or its attachments that does not relate to the business of Kainos is personal to the sender and is not given by or endorsed by Kainos. Kainos is the trading name of Kainos Software Limited, registered in Northern Ireland under company number: NI19370, having its registered offices at: Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland. Registered in the UK for VAT under number: 454598802 and registered in Ireland for VAT under number: 9950340E. This email has been scanned for all known viruses by MessageLabs but is not guaranteed to be virus free; further terms and conditions may be found on our website -www.kainos.com
[jQuery] Re: Is there a problem with Child selectors in Safari with 1.3?
One question, if you're referring to your elements by id, can't you just do: $('#elmId'); Directly? Rather than by a parent/child relationship? If the problem is that you have multiple elements on the same page with the same id (which is NOT recommended HTML), then I suggest using a class based solution instead: $('.container .elm') And see if that helps. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of andrew Sent: Thursday, January 22, 2009 12:24 PM To: jQuery (English) Subject: [jQuery] Is there a problem with Child selectors in Safari with 1.3? Hi I've got an application that has a pop up div which has controls that submit an ajax post before which I'm getting some hidden variables from within the popup div, I'm using 'live' with the popup div controls. I'm referencing the elements by their parent id then their specific Id, eg $(#container #elmId).val(). This works fine in firefox but not in Safari, I get an undefined if I alert the variables. It also works fine in both browsers using jquery 1.2.6 but not with 1.3. Has anyone else has similar problems?
[jQuery] Re: In a pickle -- JavaScript Pagination vs. PHP/MySQL Pagination
I solved this for my own project in this way: 1. Server-side code renders the first page of the grid, also passing a value of total results. 2. If the total results are few enough (season to taste), fire an ajax call that immediately loads the entire result set into memory. 3. As the user re-sorts the results, re-sort in memory and display the correctly sorted/paged results. 4. If the total results are too large to make this feasible, do an ajax call for each paged/sorted result set. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of ripcurlksm Sent: Tuesday, January 06, 2009 6:48 PM To: jquery-en@googlegroups.com Subject: [jQuery] In a pickle -- JavaScript Pagination vs. PHP/MySQL Pagination --- here is a picture of me I have a jQuery sortable table with jQuery pagination, which is being fed from PHP/MySQL-- and now that I have it setup, I am in a pickle. It appears I can only have cake or eat it. I want a table that loads fast from MySQL, that I can paginate (for performance) AND i can sort, however when you break the SQL rows returned, you can only sort the table based on the limited results (ie- sorting a table based on 40 returned results, instead of sorting based on the 800 total rows that the query yields) [B]Javascript Pro:[/B] Sexy sortable tables pagination [B]Javascript Con:[/B] Must load entire MySQL result to allow proper sorting, however the database query is taking ~12 seconds to load To demonstrate, take a set of results broken up on two pages. 1 2 3 ---new page--- 4 5 6 My problem is that when I sort this column (highest to lowest), it only sorts whats loaded (in this case 3 rows): 3 2 1 When I want this: 6 5 4 Possible solutions: 1) Static Output -- Everything is working fine, except for my 12 second wait for my table to load from MySQL. So I could create a hack to load a static HTML file instead of querying the database. The issue I see with this, is when a user does complex searches, I will have to output multiple static files. 2) Ajax-ish output -- I have the tablesorter and pagination currently loading from an Ajax-ish file, which does the SQL query, handles the MySQL offset and returns the proper rows to the page without doing a refresh. Now, if there is some way to modify this ajax script, so that it can also ORDER BY the SQL query (in addition to its current offset function), however there would need to be some sort of callback when a column header is clicked in the javascript, to the ajax script, to add the ORDER BY clause and return the results... eh. So Im in a pickle, keep in mind I have everything working, sortable table, pagination, but my 800 row query is jsut taking too long to load (its joining several other tables as it loads.) Here is my current code to contain the table results, and ajax file to load the SQL and dynamically handle the results without needing a page refresh. results.php ?php include('include/scripts.inc.php'); include('conn/conn.inc.php'); dbConnect(); $sql = 'SELECT COUNT(*) FROM company'; $res = mysql_query($sql); $total = mysql_result( $res, 0 ); ? html head script type=text/javascript src=include/jquery-latest.js/script script type=text/javascript src=include/tablesorter/addons/pagination/jquery.pagination.js/script script type=text/javascript function pageselectCallback(page_id, jq){ var first = (page_id*10)+1, second = (page_id*10)+40; $('#Searchresult').text(Showing search results + first + '-' + second); $.ajax({ type:'GET', url:'test-ajax.php', data:'offset=' + first + 'limit=40', success:function(msg) { $('#ajaxContent').html(msg); } }); } $(document).ready(function(){ $(#pagination).pagination( ?php echo $total;?, { num_edge_entries: 2, num_display_entries: 8, callback: pageselectCallback }); pageselectCallback(0); }); /script titledatabase/title /head body div class=pagination id=pagination/divbr clear=all/ div id=Searchresult/divbr / div id=ajaxContent/div /body /html test-ajax.php (to load the next page of MySQL results) ?php $offset = $_GET['offset']; $limit = $_GET['limit']; $conn = mysql_connect( 'localhost', 'root', 'mypass'); if ( is_resource( $conn ) ) { if ( !mysql_select_db('foo', $conn) ) { echo 'pCan not select db./p'; } $result = mysql_query('SELECT * from company LIMIT ' . $offset . ',' . $limit); if ( is_resource( $result ) ) { while ( $row = mysql_fetch_assoc( $result ) ) { echo $row['story']; } } } ? Any thoughts on how to allow sorting of tables with pagination and not make the user
[jQuery] Re: Hovering the mouse through multiple div's that intersect?
You could put all 4 boxes inside a containing div, and apply the hover event to that parent div. When you move from one child div to another, it will not fire the mouseleave event. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Janmansilver Sent: Monday, December 15, 2008 4:09 PM To: jQuery (English) Subject: [jQuery] Hovering the mouse through multiple div's that intersect? I have 4 div boxes that intersect with each other. They are all supposed to fade in if the mouse is hovering over any of them and not fade out when the mouse hovers from from one div box to another directly, only when the mouse leaves the area that all the divs cover, are they supposed to fade out. How do I solve this? (to make it a bit more complicated I would also like to make 2 of the divs fade slower than the rest.) $('.wPictures,#wInfo').hover( function () { $('.wPictures,#wInfo').animate({opacity: 1.0,}, 1); $('#wLeft,#wRight').show(); }, function () { $('.wPictures,#wInfo').animate({opacity: 0.0,}, 250); $('#wLeft,#wRight').hide(); } ); });
[jQuery] Re: Trouble setting Select object in browsers != IE 7
There shouldn't be an issue, so long as existingCase.records.Spin_Off__c has a correct value. Do your option elements have explicitly defined values? Like this: option value=YesYes/option option value=NoNo/option option value=nbsp;/option If not, try changing your markup and see if that helps. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of raskren Sent: Sunday, December 14, 2008 6:05 PM To: jQuery (English) Subject: [jQuery] Trouble setting Select object in browsers != IE 7 Hi, I have a form with a few select objects in it. Each select is given 3 options: Yes, No, and . I am trying to set the select value using jQuery but running into trouble in Firefox 3.0.4 and Safari 3 - both in Windows. My code does seem to run properly in IE7. Some code: $(#00N8002fnHx).val(existingCase.records.Spin_Off__c); Is this a known issue in these browsers? Am I doing anything obviously wrong?
[jQuery] Re: Trouble setting Select object in browsers != IE 7
Well, if you are able to post a test case online, I'd be happy to step through the code and see if I can see what's up. If you do want to do this, an unminified copy of jquery would be preferable. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of raskren Sent: Sunday, December 14, 2008 7:21 PM To: jQuery (English) Subject: [jQuery] Re: Trouble setting Select object in browsers != IE 7 I also wanted to mention that all the IDs on the page I am working on begin with numbers. I do realize that this is against HTML guidelines. Could this be the potential issue? None of my other jQuery script is failing. ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), colons (:), and periods (.). Taken from: http://www.w3.org/TR/html4/types.html
[jQuery] Re: [treeview] Brief flash of expanded tree
AFAIK, no SEO bots will ever execute javascript or read hidden (display:none, visibility:hidden, etc.) HTML for SEO purposes. This is as a result of some developers front loading hidden content that was not really part of the website to fool the search engine to giving it higher rankings. Consequently, the bots were changed to reflect this. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of neokio Sent: Sunday, December 14, 2008 9:51 PM To: jQuery (English) Subject: [jQuery] Re: [treeview] Brief flash of expanded tree I'm not sure if it's the best solution, but a friend of mine helped me overcome the issue i was experiencing. We added a line of CSS to hidetreeviewon load, and then set it to display in the demo.js file once everything was loaded $(#browser).treeview({ animated: fast, persist: cookie, collapsed: true }).css('display','block'); Hey Andrew, nice patch. I've been bothered by that flash for a while now. I wonder how that will effect SEO .. I'm using treeview for my main content navigation. Do you think the bots and crawlers will trigger the display:block call, or will the hidden treeview remain hidden? And what about visitors with js disabled? The nav will be hidden completely. Anyone know of another way to stop the expanded flash glitch? Thanks, Niko
[jQuery] Re: passing args to a delegate
Mike's suggestion involves creating a javascript closure. There are a number of good articles on closues. http://www.google.com/search?hl=enq=javascript+closuresrlz=1W1GGLL_en But essentially, when you create a function that has a reference to a value outside of its scope, that function is created as a closure, with its own context that has access to those variables, even when they've been changed on the global scope. Try this: var x = 25; var fn = function(val){ return function(){ alert(val); }; }(x); x = 30; fn(); The alert will be for 25, rather than 30, as the closure has its own context now for the x variable. The downside to closures is that handled incorrectly, they can cause memory leaks. But review of the many articles on the subject will help keep that from happening. JK -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jan Limpens Sent: Saturday, December 13, 2008 2:28 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: passing args to a delegate while this might keep the browser from crashing, I wonder what values these parameters will have, when the event finally occurs. The ones I have passed the very first time? I thought they would have been destroyed by then, as we left this scope long ago ... But I'll try it out :), thanks! On Sat, Dec 13, 2008 at 3:22 AM, Mike Nichols nichols.mik...@gmail.com wrote: Try this: success: function() { registerImageForms(id,key,type); } On Dec 12, 5:13 pm, Jan Limpens jan.limp...@gmail.com wrote: Hello, I have the following code: var registerImageForms = function(id, key, type) { var sizes = ['small', 'medium', 'large']; $('#panel-images fieldset:visible').remove(); $.each(sizes, function(i, item) { var $clonedForm = $('#panel-images fieldset:hidden').clone(); $(legend, $clonedForm).text(item); $([name='id'], $clonedForm).val(id); $([name='key'], $clonedForm).val(key); $([name='type'], $clonedForm).val(type); $([name='size'], $clonedForm).val(item); $(img, $clonedForm).attr('src', /imagem/article/ + key + / + item + .png); $(#panel-images).append($clonedForm); $(form, $clonedForm).ajaxForm({ success: registerImageForms }); $clonedForm.show(); }); }; Success has no args, so everything is rendered empty, after posting the form. If I pass arguments as success: registerImageForms(id, key, type) The browser crashes and it makes sense, because at the time this fires, these identifiers mean nothing. But how do I pass them? -- Jan -- Jan
[jQuery] Re: Very weird and frustrating IE problems
It is unfortunately the default behavior for IE. There are different ways you can handle this, depending on what you're trying to accomplish. You can do a lot of stuff with regex, such as stripping out the domain, making the path relative to the current page, etc. What is it that you want to do with the path once you read it with javascript? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of yellow1912 Sent: Monday, December 08, 2008 11:04 PM To: jQuery (English) Subject: [jQuery] Very weird and frustrating IE problems I have encountered a really annoying problem with ie6 and 7: When I append an img like this img src=relative/path / The src is automatically changed to the http:// form It doesnt happen on FF though. Anyone knows why this happens? Regards
[jQuery] Re: IE 7 Issue with Tab with left: -10000px
Is there any reason why you aren't just hiding the tab with a display:none? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ashish Sent: Saturday, December 06, 2008 3:47 PM To: jQuery (English) Subject: [jQuery] IE 7 Issue with Tab with left: -1px Following works strange in IE when using Jquery Tabs: .ui-tabs-hide { position: absolute; left: -1px; } When I do the above, on IE 7, the width of the pages in tabs become huge and goes out of page on left and right both. These tab pages have tables. And I do NOT have table width set to 100%. It works fine on firefox and safari. Any clues what could be wrong?
[jQuery] Re: IE 7 Issue with Tab with left: -10000px
You could post a test case page and I could take a look at it, but if there is any way so do the same layout with divs and CSS instead of tables, you are likely to have the different browsers play a bit more friendly. There is a whole host of nasty issues that disappear once you can move away from a table-based layout. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ashish Sent: Saturday, December 06, 2008 4:30 PM To: jQuery (English) Subject: [jQuery] Re: IE 7 Issue with Tab with left: -1px I am using Yui data table in some tabs and YUI data table column sizes go all weird with display: none any solutions? On Dec 6, 4:03 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: Is there any reason why you aren't just hiding the tab with a display:none? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ashish Sent: Saturday, December 06, 2008 3:47 PM To: jQuery (English) Subject: [jQuery] IE 7 Issue with Tab with left: -1px Following works strange in IE when using Jquery Tabs: .ui-tabs-hide { position: absolute; left: -1px; } When I do the above, on IE 7, the width of the pages in tabs become huge and goes out of page on left and right both. These tab pages have tables. And I do NOT have table width set to 100%. It works fine on firefox and safari. Any clues what could be wrong?
[jQuery] Re: IE 7 Issue with Tab with left: -10000px
Understood. There are a number of resources that will help you do a CSS based layout that will accomplish exactly that. Here are a couple I just found on Google: http://www.glish.com/css/ http://www.yourhtmlsource.com/stylesheets/csslayout.html JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ashish Sent: Saturday, December 06, 2008 7:23 PM To: jQuery (English) Subject: [jQuery] Re: IE 7 Issue with Tab with left: -1px Thanks i will try that, the reason I moved to table based layout was because, when I resize the browser (say by dragging the bottom right corner of browser) the content in tables resize very nicely in browser window. could not get the same without tables. On Dec 6, 5:29 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: You could post a test case page and I could take a look at it, but if there is any way so do the same layout with divs and CSS instead of tables, you are likely to have the different browsers play a bit more friendly. There is a whole host of nasty issues that disappear once you can move away from a table-based layout. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ashish Sent: Saturday, December 06, 2008 4:30 PM To: jQuery (English) Subject: [jQuery] Re: IE 7 Issue with Tab with left: -1px I am using Yui data table in some tabs and YUI data table column sizes go all weird with display: none any solutions? On Dec 6, 4:03 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: Is there any reason why you aren't just hiding the tab with a display:none? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ashish Sent: Saturday, December 06, 2008 3:47 PM To: jQuery (English) Subject: [jQuery] IE 7 Issue with Tab with left: -1px Following works strange in IE when using Jquery Tabs: .ui-tabs-hide { position: absolute; left: -1px; } When I do the above, on IE 7, the width of the pages in tabs become huge and goes out of page on left and right both. These tab pages have tables. And I do NOT have table width set to 100%. It works fine on firefox and safari. Any clues what could be wrong?
[jQuery] Re: How to animate frameset properties?
I'm going to toss this out there, though you may not want the effort. You could sort of roll your own animation that uses the attribute, rather than the CSS. It would involve a setTimeout, and use the $(el).attr('cols',val); Again, that's a lot of plumbing to tackle, but any attribute that can be set by jQuery.attr can be animated. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of andriscs Sent: Thursday, December 04, 2008 1:35 PM To: jQuery (English) Subject: [jQuery] Re: How to animate frameset properties? I tried it, believe me. :) Yet I had to use frames due to close deadlines as divs that I used were placed abnormally everwhere depending on which browser were presented in. I have to create a navigation side on the left and a content area on the right. The menu should always be visible while the content should be scrollable. The menu should become hidden on click and the splitting between the sides should be adjustable. Tell me, is there div-based jQuery code that accomplishes this? I use jTree for the navigation menu and I tried jSplitter for creating the splitter but I couldn't create an always visible yet scrollable layout :) So I reverted back to frames and it works well in major browsers, I can adjust splitter, I can scroll content, I just lost the possibility of creating a smooth animation ( I animate the disappearing of the navigation menu). If you have better ideas, tell me. On dec. 4, 02:28, ricardobeat [EMAIL PROTECTED] wrote: You can only animate CSS properties, the col width is not one of them. Get rid of the frames and use some clean code :) On Dec 3, 9:40 pm, andriscs [EMAIL PROTECTED] wrote: Hi, I know it's kinda lame, but I should animate the setting of a frameset's cols property. So far I managed to learn that html properties can be animated using anime({prop:value},duration) I created for example a font size changer using that code. As I work now with frames, I tried to modify a framesets properties: first I used the following code: top.$(#main_frame).attr(cols,0%,*); It worked fine, the left frame disappeared. I just wanted to make it with animation, so I tried the following: top.$(#main_frame).animate({cols:0%,*},600); but nothing happened. Is it because attribute cols cannot be animated by jQuerys inner mechanism? Honestly, I dont feel much difference between animating width property and cols property. Do you have any idea of how to animate that kind of operation? If not possbile what else solution would you suggest me to hide a left sided navigation menu that resides in a frame?
[jQuery] Re: How beneficial is chaining methods?
That is half correct. Obj.method1().method2().method3() method1 return the modified original object, not a brand-new object. You could do this: var obj = $('#elementid'); obj.method1(); obj.method2(); obj.method3(); And it would be the same (with the same performance) of: $('#elementid').method1().method2().method3(); Personally, I like chaining because it makes for tighter code. You can also do something like this: $('#elementid').addClass('someclass') .children('div') .addClass('someclass') .end() .find('ul') .show(); That will find the element, add the class, then find the child divs and add the class, then revert to the original element (#elementid) and then find any ULs and show them. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of SLR Sent: Wednesday, December 03, 2008 12:21 PM To: jQuery (English) Subject: [jQuery] Re: How beneficial is chaining methods? One advantage to doing this $(#Results).html(Some Text).show(); over this $(#Results).html(Some Text); $(#Results).show(); would be that the script doesn't have to retrieve that wrapped set a second time That's a good point. In this case, chaining would reduce overhead. A chainable method, in jQuery, is written: $.fn.newMethod = function() { // Function body... return $(this); } As you can see, all that's happening is this is being converted to a jQuery object (defined by jQuery and its alias $) and returned. Just a quick clarification on this. The this keyword within the newMethod plugin you just made is already the jQuery object. All you need to do is return this; So if I understand this correctly, essentially the line is execute from left to right and returns the current object after each method completes? For Example: Obj.method1().method2().method3() This would do the following: 1) Calls method 1 for the orignal Obj 2) Calls method 2 for the obj that is returned from method 1 3) Calls method 3 for the obj returned from method 2 4) etc... Is this correct?
[jQuery] Re: Targetting .class-0 .class-1 .class-2 .class-3
I would recommend your elements having two classes. One which stays the same, and the second one which changes. e.g. div class=jcalendar calendar0/div div class=jcalendar calendar1/div div class=jcalendar calendar2/div div class=jcalendar calendar3/div Then you could grab it with $('div.jcalendar'); JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of light-blue Sent: Wednesday, December 03, 2008 5:40 PM To: jQuery (English) Subject: [jQuery] Targetting .class-0 .class-1 .class-2 .class-3 This is a beginner question. Does anyone know how to target $('.jquery-calendar-0') $('.jquery-calendar-1') $('.jquery-calendar-2') $('.jquery-calendar-3') etc... I need to run the following, where X is the number, but I don't know how many X exist until after the page renders. $('.jquery-calendar-X').calendar( {stuff} ) I can't find the solution in Learning Jquery (Chaffer and Swedberg), at least not in Chapter 2 How to Get Anything You Want. ;-) Thanks!
[jQuery] Re: Is there a createElement equivalent in jQuery?
You can do it this way: var div = $('div/div') .appendTo(document.body) .attr('property',value) .css({prop:val}) .bind('click',fn); JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Yansky Sent: Wednesday, December 03, 2008 9:21 PM To: jquery-en@googlegroups.com Subject: [jQuery] Is there a createElement equivalent in jQuery? Hi, I was just wondering if there was a createElement equivalent in jQuery. e.g. var el = document.createElement('div'); I know I can create it with the inbuilt innerHTML way in jQuery - $('div id=foo /'); But I like to add event handlers to the element I've just created without having to traverse the dom to find it and then assign an event listener. e.g. This is how I like to do it: var altPlayerControlsA3 = document.createElement('a'); altPlayerControlsA3.href='#'; altPlayerControlsA3.setAttribute('style','margin:5px;'); altPlayerControlsA3.id=myytplayerControlsMute; altPlayerControlsA3.textContent=Mute; altPlayerControlsA3.addEventListener('click', function(e){ e.preventDefault(); //do stuff }, false); document.body.appendChild(altPlayerControlsA3); but with jQuery I seem to have to do it like this: $('body').append(lt;a href=# id=myytplayerControlsMute' style=margin:5px;Mute); $('#myytplayerControlsMute').click(function(){... Is jQuery able to create elements not using innerHTML? -- View this message in context: http://www.nabble.com/Is-there-a-createElement-equivalent-in-jQuery--tp20827 512s27240p20827512.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Is there a createElement equivalent in jQuery?
That represent the element inside a jquery object. If you did this: var div = $(document.body).find('div'); You would get an object with a number of jquery specific properties. Inside it would be an array of the actual DOM objects it fount. The same as when you create a new object. var div = $('div/div').appendTo(document.body); You can do jquery stuff like div.hide(), but you can also access the underlying DOM element: div[0] JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Yansky Sent: Wednesday, December 03, 2008 10:20 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Is there a createElement equivalent in jQuery? Thanks, I didn't know that you could bind an event handler like that. :) BTW, does the var div now reference the new element, or does it represent the event handler? Jeffrey Kretz wrote: You can do it this way: var div = $('div/div') .appendTo(document.body) .attr('property',value) .css({prop:val}) .bind('click',fn); JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Yansky Sent: Wednesday, December 03, 2008 9:21 PM To: jquery-en@googlegroups.com Subject: [jQuery] Is there a createElement equivalent in jQuery? Hi, I was just wondering if there was a createElement equivalent in jQuery. e.g. var el = document.createElement('div'); I know I can create it with the inbuilt innerHTML way in jQuery - $('div id=foo /'); But I like to add event handlers to the element I've just created without having to traverse the dom to find it and then assign an event listener. e.g. This is how I like to do it: var altPlayerControlsA3 = document.createElement('a'); altPlayerControlsA3.href='#'; altPlayerControlsA3.setAttribute('style','margin:5px;'); altPlayerControlsA3.id=myytplayerControlsMute; altPlayerControlsA3.textContent=Mute; altPlayerControlsA3.addEventListener('click', function(e){ e.preventDefault(); //do stuff }, false); document.body.appendChild(altPlayerControlsA3); but with jQuery I seem to have to do it like this: $('body').append(lt;a href=# id=myytplayerControlsMute' style=margin:5px;Mute); $('#myytplayerControlsMute').click(function(){... Is jQuery able to create elements not using innerHTML? -- View this message in context: http://www.nabble.com/Is-there-a-createElement-equivalent-in-jQuery--tp20827 512s27240p20827512.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Is-there-a-createElement-equivalent-in-jQuery--tp20827 512s27240p20828020.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: finding script tags in remote HTML
geek Before I answer, I've gotta ask (I've been wondering for MONTHS), have you read the Starrigger series? /geek Now that that's out of the way, I can think of a couple of approaches. #1. Parse the links with regex $.get(link,{},function(html){ var r_links = /a\b[^]*?href\s*=\s*[']([^']+)[^]*/gi; var m; while (m=r_links.exec(html)) { makeRequest(m[1]); } }); #2. Remove the script tags and inline events with regex, then grab the HTML. var makeRequest = function(link) { $.get(link, {}, function(html){ html = html.replace(/script\b[\s\S]*?\/script/gi,'').replace(/on\w+\s*=\s*([']) [^']+\1/gi,''); $(a, html).each(function(){ makeRequest($(this).attr(href)); }); }); } -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jake McGraw Sent: Tuesday, December 02, 2008 7:09 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: finding script tags in remote HTML I'm using jQuery AJAX to recursively spider a website to build a sitemap.xml file. I'll acknowledge that this is an ass backwards method for building a sitemap, but let's put aside that issue. My issue is that I'd like to be able to parse anchors in each page, but not execute the JavaScript on the page. The pseudo code looks something like: var makeRequest = function(link) { $.get(link, {}, function(html){ $(a, html).each(function(){ makeRequest($(this).attr(href)); }); }); } $(a).each(function(){ makeRequest($(this).attr(href)); }); My problem is that when I do $(a, html), the html is executed (DOM?) and IE complains about JavaScript errors. My question is can I prevent the JS from being executed, external resources from being loaded (img, css) but still get the anchors for each page? - jake On Thu, Nov 6, 2008 at 1:01 PM, axemonkey [EMAIL PROTECTED] wrote: Hi all. I'm having an amazing amount of pain trying to parse and execute JS script blocks in remote HTML (in IE, typically). Here's the code in question: $.ajax({ type: POST, url:checkFilename, dataType: text, success:function(src){ var wtf = $(src).find(script).each(function(){ eval( $(this).text() ); }); } }); http://www.pastie.org/308878 checkFilename is just an HTML file, so src comes back with the entire source of that page. What I want to do then is use find() to get all inline script tags inside the body of the page, and use eval()* to run them. Elsewhere before this happens a large chunk of HTML from checkFilename is loaded and displayed, and now I need to run any inline JS that was in the page. The above function works perfectly in FF2 and FF3, but IE completely fails to find any instances of script tags in src. Any ideas? I can't extract the inline JS blocks in question, as they are dynamic and inserted by a CMS that I have no control over. Thanks in advance, --Clive. * I know it's evil, but I need it in this instance...
[jQuery] Re: Has jQuery development halted?
Ariel, I'm sure this isn't said enough, but I wanted to thank you for the work you've done on the system. I've been working overtime (like 90 hour a week) for the last 2 months on a major project with a killer deadline, and I would be completely screwed without the work you (and the rest of the team) has done on jQuery and jQuery UI. Working on an open-source project can sometimes be a thankless job, but on behalf of everyone here on my team: YOU ARE A GODSEND. Thanks for all of your hard work. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ariel Flesler Sent: Monday, December 01, 2008 5:40 AM To: jQuery (English) Subject: [jQuery] Re: Has jQuery development halted? I'd simply check the trac to see if development halted, instead of asking it publicly in such a challenging way. http://dev.jquery.com/report/28 I've been working pretty hard all this time, closing millions of tickets (sadly most of them invalid). And while I do understand your request, I don't think you used the right place and words to ask it. Needless to say, I'm considerably offended by your post, I think it reduces the hard work to nothing. IMO, it'd had been appropriate to post this to the jquery-dev group, or even ask a core member by email. Finally, if you're really into improving jQuery, this is how: http://dev.jquery.com/newticket -- Ariel Flesler http://flesler.blogspot.com/ On Nov 26, 12:53 pm, Bob den Otter [EMAIL PROTECTED] wrote: Hi all, There hasn't been a jQuery update in what seems like ages, and jQuery UI 1.6 will be released 'in the next few days' since somewhere in september. I know John has been really busy with a lot of great things, but it seems to me like the development of jquery has seriously lagged the last few months. As a small example: there isn't even a way to detect chrome in the official jquery builds yet, and chrome has been out for several months now. I'm afraid that the lack of updates will eventually have a negative impact on the great Query community, causing people to leave for other js frameworks. I sincerely hope not, but i _am_ worried about it. Best, Bob.
[jQuery] Re: Using jquery to construct menus like nbc.com
Here's what I believe is happening. You have an LI that is a certain height, about 21px. This LI is inside a div that is larger, 36px. The floating DIVs are positioned underneath the larger DIV. --- MENU DIV LI - Empty space -- Floating Div There is an empty space between the LI and its child DIV. So when you move the mouse there, it is no longer inside the LI or its children, and it fires the mouseleave event. You could set the height of the LI to expand to the size of the menu DIV. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of serpicolugnut Sent: Monday, December 01, 2008 4:52 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Using jquery to construct menus like nbc.com I used your mouseenter and mouseleave function, but I'm still having issues with the menus disappearing when the user mouses off the top level item, and in to the lower level list items (containing the div menus). Here's a link to a more fleshed out example: http://dl.getdropbox.com/u/21984/menu_test_case/menu_test_case.html Any clues on why it's inconsistent in it's sticky-ness? Thanks - Ted Jeffrey Kretz wrote: I made a few changes and reposted it here: http://test1.scorpiondesign.com/LocalTest7.htm Changes: menu1 through menu5 were moved underneath their respective LIs. When the menus were NOT children of the LIs, the mouseenter mouseleave kept firing. #nav { position:relative; } This allows the absolute positioning of child elements relative to itself. #menu1, #menu2, #menu3, #menu4, #menu5 { display:none; left: 0px; Rather than hiding the menus with javascript, I set the CSS to display none. The first toggle called will turn them on. The left:0px aligns the menus with the first relatively positioned element, in this case #nav. $(li.main-nav).bind(mouseenter mouseleave, function(){ $(this).children('div').toggle(); return false; }); So it's a class based selector (less code), and it only binds the parent element (rather than the parent and child). Cheers, JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of serpicolugnut Sent: Tuesday, November 25, 2008 11:04 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Using jquery to construct menus like nbc.com Here's a link to a simplified version of the code. The mouseenter/mouseleave events helped, but I'm seeing some strangeness on the first menu item, and then some flickering on the others. http://dl.getdropbox.com/u/21984/menu_test.html Jeffrey Kretz wrote: If you have a sample url of your code, that would be helpful. But at a guess, the flyout div is probably not a child of the main menu element, so the mouseenter and mouseleave won't work properly. If this is the case, it will require a minor change to the hover plumbing. The z-index with flash in IE6/7 can usually be solved by doing two things: 1. Add the wmode=transparent attribute to the flash movie. 2. Wrap the tag in a div set for the same width and height, with its z-index set for 0. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of serpicolugnut Sent: Tuesday, November 25, 2008 7:08 AM To: jquery-en@googlegroups.com Subject: [jQuery] Using jquery to construct menus like nbc.com I'm trying to utilize jquery to construct a menu structure that is similar to what you see at fox.com and nbc.com. Basically I have a menu that is a ul list, with each li selector given it's own id. Below I have a div container for each menu item, which are set to be hidden by jquery upon load. I've been the mousever/mouseout actions to trigger turning each div container on/off, but the problems I'm encountering with this are 1) it works when hovering over the main menu selection, but not when the mouse is inside the div, making selecting sub items difficult/ impossible, and 2) for some reason in IE6/IE7, the divs don't show when they are over a Flash object. Does anybody have any ideas on how to take items #1 and #2? -- View this message in context: http://www.nabble.com/Using-jquery-to-construct-menus-like-nbc.com-tp2068217 1s27240p20682171.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Using-jquery-to-construct-menus-like-nbc.com-tp2068217 1s27240p20687612.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Using-jquery-to-construct-menus-like-nbc.com-tp2068217 1s27240p20783951.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Simple way to suppress display of title attribute on hover?
A CSS-compliant browser will render the title attribute -- it's probably not the best way to store data. You can use the jQuery.data method instead: http://docs.jquery.com/Core/data#name JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of René Sent: Monday, December 01, 2008 3:53 PM To: jQuery (English) Subject: [jQuery] Simple way to suppress display of title attribute on hover? I sometimes use the title attribute in DIVs to store data. Normally, it displays on mouseover. Just wondering what a best practice to suppress that. ...Rene
[jQuery] Re: Problem with prev() in IE
It isn't possible to have an LI sibing right before a UL. That would mean markup like this: ul liList Item #1/li-- LI Sibling ul -- UL liList Item #2/li liList Item #3/li /ul /ul That is illegal markup. Your markup actually looks like this: h1Get to know Trinity/h1 -- H1 sibling ul -- UL li a href=...About Us/a -- A sibling ul -- UL lia href=...History/a/li These are the elements you are getting with a $('ul').prev() There ARE no LI siblings just before a UL. So which elements are you actually trying to get? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flycast Sent: Sunday, November 30, 2008 8:42 AM To: jQuery (English) Subject: [jQuery] Re: Problem with prev() in IE No. I am definitely looking for the li sibling right before any ul.../ul. I am building menus and submenus. Any ul...ul that appears below a li.../li is a submenu. I know that I could add a name or class to either the head or subhead. I wouod rather have jQuery find these so that I don't have any markup in the HTML necessary to make this work. On Nov 29, 11:21 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: Okay, so I stepped through the code. I'm going to hazard a guess that you didn't want the previous element but the parent element. $('#LHNav ul').prev() returns an H1 and an array of A elements. This is because prev looks for the sibling element just in front of the current one. $('#LHNav ul').parent('li') will, I believe, return the results you are looking for. JK P.S. IMO, the really odd thing is why FF worked when I believe it should have returned an empty set. Anyone else have any ideas? -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flycast Sent: Saturday, November 29, 2008 8:29 PM To: jQuery (English) Subject: [jQuery] Re: Problem with prev() in IE Yes...http://www.trinityacademy.org/testNavigation/ On Nov 29, 6:22 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I've used something very similar to that in IE6 without any problems. Could you post a demo page? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flycast Sent: Saturday, November 29, 2008 3:57 PM To: jQuery (English) Subject: [jQuery] Problem with prev() in IE This code works fine in FF and Safari but (surprise, surprise) not in IE6. $(#LHNav ul).prev('li').each(function(){ alert(Loop); }); I have narrowed it down to giving prev() some value to filter by. IF I try it like this: (notice the missing li) $(#LHNav ul).prev().each(function(){ alert(Loop); }); It works fine. Why does IE always have to be so buggy and particular?
[jQuery] Re: Double right-click, anyone?
If I might make a suggestion. Right-click context menus are inherently not cross-platform compatible, as Opera will not cancel the default right click popup. Any any Mac users without a right mouse button are screwed. I personally suggest using CTRL-Click. This works on a Mac testing for the e.MetaKey property on the click event (CTRL-Click and Option-Click) And instead of a double-right-click, you could just bind to the standard dblclick event, and test for e.MetaKey==true. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ricardobeat Sent: Sunday, November 30, 2008 9:24 AM To: jQuery (English) Subject: [jQuery] Re: Double right-click, anyone? I didn't test it in IE... no cookie. Apparently the 'mousedown' event was at random not carrying the property that tells us what button was clicked, a triple click was needed. I switched to mouseup and it seems to work fine, I also had forgotten to clear the timeout and set the var to false when the double click happened. Check out the new version: http://jsbin.com/iyegu/ cheers, - ricardo On Nov 30, 8:32 am, TheBlueSky [EMAIL PROTECTED] wrote: I forgot to mention also that I disabled the context menu with the code $('html').bind(contextmenu, function(e) {return false;}); and if I didn't do that, the context menu will appear and every right- click then will fire the double-click event in IE. I guess that's because in IE the double-click event won't fire until the time out duration finishes and in FF it's the opposite, i.e. the event won't fire after the time out duration! On Nov 30, 2:10 pm, TheBlueSky [EMAIL PROTECTED] wrote: Thanks for the code... but I couldn't manage to make it work at all in IE and in FF the only time it worked is if I replaced $('body') with $ ('html)! Any idea how to make it work with a specific element; e.g. and image with id=myImage, because when I tried $('#myImage') it didn't work as well. By the way, for IE I replaced console.log() with alert(), but no success. On Nov 29, 10:58 pm, ricardobeat [EMAIL PROTECTED] wrote: A quick implementation: $('body').unbind('mousedown').mousedown(function(e){ var rightclick = (e.which) ? (e.which == 3) : (e.button == 2); var t = $(this); if (rightclick) { console.log('rightclick'); if (t.data('rightclicked')) { console.log('double click!'); } else { t.data('rightclicked',true); setTimeout((function(t){ return function(){ t.data ('rightclicked',false); } })(t), 300); }; }; }); - ricardo On Nov 29, 10:20 am, TheBlueSky [EMAIL PROTECTED] wrote: Hi everyone, Does anyone has code, implementation, plug-in or whatever to detect double right-click? I'm searching and trying for couple of days now without any result. Appreciate any help.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: [autocomplete] Problem with Scrolling IE 7
Not sure what's happening on the javascript end, but CSS-wise, the FF list has an attribute of overflow:auto and the same list has an attribute of overflow:hidden. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Code Daemon Sent: Sunday, November 30, 2008 5:08 AM To: jQuery (English) Subject: [jQuery] [autocomplete] Problem with Scrolling IE 7 Konqueror and FF2 work just fine but the side scrollbar doesn't appear when I try this basic test in IE 7.0.5730.13. The scrollbar does not work here: http://kittyslayer.ucdavis.edu/jquerytest/system/application/views/jquerytes t.php However, the demo site actually works: http://kittyslayer.ucdavis.edu/jquerytest/js/jquery-autocomplete/demo/ I swear I'm doing the same thing in both. What am I doing wrong?
[jQuery] Re: jQuery loop help
One way you could do this is have give the links in question a specific ID, class or attribute. For example: div id=myLinks a href=# id=link1link 1/a a href=# id=link2link 2/a a href=# id=link3link 3/a /div $('#myLinks a').click(doSomething); function doSomething(e){ switch ($(this).attr('id')) { case link1: // Some code. break; case link2: // Some code. Break; case link3: // Some code. break; } } JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of SLR Sent: Sunday, November 30, 2008 3:12 PM To: jQuery (English) Subject: [jQuery] Re: jQuery loop help No question is too noobie. Welcome aboard! :-) I appreciate the warm welcome = ) That code won't work at all. I would suggest reading the doc page on .each(): Definitely on my to-do list... If you just want the loop index, it's passed to the .each() callback as the first parameter: $('a').each( function( i ){ // 'i' is the loop index $(this).click(function(){ // You can use 'i' directly in this code }); }); Thanks for the info here, I'll definitely play around with it and see what I can do. But is the loop index that useful here? I'm trying to picture what you might do with it. There may be a better way to do this - if you could say more about your application, someone may have a suggestion. To give you a brief rundown. Imagine having a generic function with a nested switch statment. function myFunction(param) { switch(param) { case 1: // some code break; case 2: // some code break; case 3: // some code break; } } Now, imagine you have the following html items div id=myLinks a href=#link 1/a a href=#link 2/a a href=#link 3/a /div Basically, I want to do is have jQuery make each link call myFunction when clicked and pass its index so the the correct switch statement is fired...
[jQuery] Re: Double right-click, anyone?
Have you ever tried capturing the right-click event in Opera? It has an additional level of security whereby each client must expressly set the user preferences allowing a website to capture the right-click event and stop the right-click bubble. The project I worked on last year had a right-click requirement which would not play well with Opera. There is a user-friendly aspect of this too, as some users don't WANT their browser-specific context menus to be taken away. This is why I recommended the CTRL-Click. As regards the Mac, I haven't tested that. Are you sure a Mac option-click is interpreted as button 2? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ricardobeat Sent: Sunday, November 30, 2008 6:31 PM To: jQuery (English) Subject: [jQuery] Re: Double right-click, anyone? returning false from the handler should cancel the context menu on Opera and other browsers. And apparently on Macs the event for a Ctrl +click carries the 'right-click' identifier (e.button = 2). cheers, - ricardo On Nov 30, 4:07 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: If I might make a suggestion. Right-click context menus are inherently not cross-platform compatible, as Opera will not cancel the default right click popup. Any any Mac users without a right mouse button are screwed. I personally suggest using CTRL-Click. This works on a Mac testing for the e.MetaKey property on the click event (CTRL-Click and Option-Click) And instead of a double-right-click, you could just bind to the standard dblclick event, and test for e.MetaKey==true. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ricardobeat Sent: Sunday, November 30, 2008 9:24 AM To: jQuery (English) Subject: [jQuery] Re: Double right-click, anyone? I didn't test it in IE... no cookie. Apparently the 'mousedown' event was at random not carrying the property that tells us what button was clicked, a triple click was needed. I switched to mouseup and it seems to work fine, I also had forgotten to clear the timeout and set the var to false when the double click happened. Check out the new version: http://jsbin.com/iyegu/ cheers, - ricardo On Nov 30, 8:32 am, TheBlueSky [EMAIL PROTECTED] wrote: I forgot to mention also that I disabled the context menu with the code $('html').bind(contextmenu, function(e) {return false;}); and if I didn't do that, the context menu will appear and every right- click then will fire the double-click event in IE. I guess that's because in IE the double-click event won't fire until the time out duration finishes and in FF it's the opposite, i.e. the event won't fire after the time out duration! On Nov 30, 2:10 pm, TheBlueSky [EMAIL PROTECTED] wrote: Thanks for the code... but I couldn't manage to make it work at all in IE and in FF the only time it worked is if I replaced $('body') with $ ('html)! Any idea how to make it work with a specific element; e.g. and image with id=myImage, because when I tried $('#myImage') it didn't work as well. By the way, for IE I replaced console.log() with alert(), but no success. On Nov 29, 10:58 pm, ricardobeat [EMAIL PROTECTED] wrote: A quick implementation: $('body').unbind('mousedown').mousedown(function(e){ var rightclick = (e.which) ? (e.which == 3) : (e.button == 2); var t = $(this); if (rightclick) { console.log('rightclick'); if (t.data('rightclicked')) { console.log('double click!'); } else { t.data('rightclicked',true); setTimeout((function(t){ return function(){ t.data ('rightclicked',false); } })(t), 300); }; }; }); - ricardo On Nov 29, 10:20 am, TheBlueSky [EMAIL PROTECTED] wrote: Hi everyone, Does anyone has code, implementation, plug-in or whatever to detect double right-click? I'm searching and trying for couple of days now without any result. Appreciate any help.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Problem with prev() in IE
I've used something very similar to that in IE6 without any problems. Could you post a demo page? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flycast Sent: Saturday, November 29, 2008 3:57 PM To: jQuery (English) Subject: [jQuery] Problem with prev() in IE This code works fine in FF and Safari but (surprise, surprise) not in IE6. $(#LHNav ul).prev('li').each(function(){ alert(Loop); }); I have narrowed it down to giving prev() some value to filter by. IF I try it like this: (notice the missing li) $(#LHNav ul).prev().each(function(){ alert(Loop); }); It works fine. Why does IE always have to be so buggy and particular?
[jQuery] Re: .ajax and ie7?
Can you post a sample url? The code below looks fine, don't see why it would fail. It would be easy to step through it with an IE script debugger to see what's up. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David Andrews Sent: Saturday, November 29, 2008 6:31 PM To: jquery-en@googlegroups.com Subject: [jQuery] .ajax and ie7? Hello all, I am using .ajax to populate an array via a PHP generated XML file //snip $.ajax({ url : readimages.php, async : false, data : imagefolder= + folderName + imagePrefix= + imagePrefix, success : function(xml) { $(xml).find('file').each(function() { imageList.push($(this).text()); }); } }); This works perfectly in FF but the success function does not get called when run in IE7... should this code work ok or is IE a lost cause? Cheers Dave
[jQuery] Re: .ajax and ie7?
Well, it was a bit of a pain to step through, as it was minimized jquery -- the full uncompressed version is much better for debugging. But as I stepped through, the success method did actually fire. The problem was that $(xml).find('file') did not return any results. I've never used jQuery to traverse XML nodes, so maybe someone else can help. Here was the XML result I got: ?xml version=1.0 encoding=iso-8859-1? filelist fileonr_fc2.jpg/file fileonr_whd.jpg/file fileonr_lbp.jpg/file fileonr_egwt.jpg/file fileonr_mpr.jpg/file fileonr_fifa.jpg/file fileonr_waw.jpg/file fileonr_main.jpg/file fileonr_r2.jpg/file /filelist But as Mike said, json would be an easier way to do it. The data would look something like this: [{file:'onr_fc2.jpg'},{file:'onr_fc2.jpg'},{file:'onr_fc2.jpg'},{file:'onr_f c2.jpg'}] jQuery would then use eval() to convert that into an array of objects. Your success function would do something like this: success:function(files){ for (var i=0;ifiles.length;i++) { do_something(files[i].file); } } JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David Andrews Sent: Saturday, November 29, 2008 7:25 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: .ajax and ie7? Thanks Mike and JK, A sample url is here.. www.foobar.me.uk/test/example.htm To answer your questions: 1. This does seem to be required as it loads the image names into an array which is then used to populate the image src in the DOM. If I leave async true then I get empty images for the first couple of transitions. 2. Thanks for the tip on JSON - not familiar with it but will do some research - cheers. - If you open the above link in firefox then you will see some image transitions based on an array populated from my ajax request - in IE that array does not get populated as it looks like the ajax request is not getting called. Also - don't get me wrong I'm not anti IE - just asking! ;) Cheers Dave -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Geary Sent: 30 November 2008 03:10 To: jquery-en@googlegroups.com Subject: [jQuery] Re: .ajax and ie7? Of course Ajax works in IE. IE is the browser that invented Ajax (XMLHttpRequest)! Troubleshooting a code snippet is a lost cause. ;-) Can you post a link to a test page? A couple of tips, not directly related to the IE problem... async: false is an extreme measure that should be avoided if possible. It locks up the user interface of all browsers running in the same thread. Do you have to do that? It sounds like you are in control of the PHP code that generates the XML, is that right? If so, you would be better off generating JSON instead of XML. It's easier to work with JSON, and much faster too. -Mike From: David Andrews Hello all, I am using .ajax to populate an array via a PHP generated XML file //snip $.ajax({ url : readimages.php, async : false, data : imagefolder= + folderName + imagePrefix= + imagePrefix, success : function(xml) { $(xml).find('file').each(function() { imageList.push($(this).text()); }); } }); This works perfectly in FF but the success function does not get called when run in IE7... should this code work ok or is IE a lost cause? Cheers Dave
[jQuery] Re: .ajax and ie7?
This may be overkill for your needs, but it is free: http://www.microsoft.com/express/vwd/ It also has jQuery-aware intellisense. Whenever I need to debug an IE script page, I do ALT-V, U, O, pick the VS Debugger and it opens right up with all the scripts available, can set breakpoints, view variables and properties, etc. etc. As much as I adore Firebug and can't live without it, its debugger is FAR eclipsed by the Visual Studio one (IMO). JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David Andrews Sent: Saturday, November 29, 2008 7:50 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: .ajax and ie7? Thanks JK, Sorry to push you through the min jquery but that was the version I have on my live server. Damn it - Embarrassed - I will check why my XML is bad. Sorry guys :( I will also get myself a decent IE js debugger :) Thanks again Dave -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Kretz Sent: 30 November 2008 03:40 To: jquery-en@googlegroups.com Subject: [jQuery] Re: .ajax and ie7? Well, it was a bit of a pain to step through, as it was minimized jquery -- the full uncompressed version is much better for debugging. But as I stepped through, the success method did actually fire. The problem was that $(xml).find('file') did not return any results. I've never used jQuery to traverse XML nodes, so maybe someone else can help. Here was the XML result I got: ?xml version=1.0 encoding=iso-8859-1? filelist fileonr_fc2.jpg/file fileonr_whd.jpg/file fileonr_lbp.jpg/file fileonr_egwt.jpg/file fileonr_mpr.jpg/file fileonr_fifa.jpg/file fileonr_waw.jpg/file fileonr_main.jpg/file fileonr_r2.jpg/file /filelist But as Mike said, json would be an easier way to do it. The data would look something like this: [{file:'onr_fc2.jpg'},{file:'onr_fc2.jpg'},{file:'onr_fc2.jpg'},{file:'onr_f c2.jpg'}] jQuery would then use eval() to convert that into an array of objects. Your success function would do something like this: success:function(files){ for (var i=0;ifiles.length;i++) { do_something(files[i].file); } } JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David Andrews Sent: Saturday, November 29, 2008 7:25 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: .ajax and ie7? Thanks Mike and JK, A sample url is here.. www.foobar.me.uk/test/example.htm To answer your questions: 1. This does seem to be required as it loads the image names into an array which is then used to populate the image src in the DOM. If I leave async true then I get empty images for the first couple of transitions. 2. Thanks for the tip on JSON - not familiar with it but will do some research - cheers. - If you open the above link in firefox then you will see some image transitions based on an array populated from my ajax request - in IE that array does not get populated as it looks like the ajax request is not getting called. Also - don't get me wrong I'm not anti IE - just asking! ;) Cheers Dave -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Geary Sent: 30 November 2008 03:10 To: jquery-en@googlegroups.com Subject: [jQuery] Re: .ajax and ie7? Of course Ajax works in IE. IE is the browser that invented Ajax (XMLHttpRequest)! Troubleshooting a code snippet is a lost cause. ;-) Can you post a link to a test page? A couple of tips, not directly related to the IE problem... async: false is an extreme measure that should be avoided if possible. It locks up the user interface of all browsers running in the same thread. Do you have to do that? It sounds like you are in control of the PHP code that generates the XML, is that right? If so, you would be better off generating JSON instead of XML. It's easier to work with JSON, and much faster too. -Mike From: David Andrews Hello all, I am using .ajax to populate an array via a PHP generated XML file //snip $.ajax({ url : readimages.php, async : false, data : imagefolder= + folderName + imagePrefix= + imagePrefix, success : function(xml) { $(xml).find('file').each(function() { imageList.push($(this).text()); }); } }); This works perfectly in FF but the success function does not get called when run in IE7... should this code work ok or is IE a lost cause? Cheers Dave
[jQuery] Re: .ajax and ie7?
I understand where you're coming from, but I need to support a broader user-base for my software. I have two virtual machines on my main PC with XP and Vista installed, and a separate Macbook Pro, so that I can cross-check compatibility between IE6 XP, IE7 XP, IE7 Vista, FF2, FF3, Opera, Safari Win, Safari Mac, FF Mac and Chrome. The javascript is occasionally an issue, but complex CSS-based layouts can be a pain. At this point my production flow is grooved in enough that I rarely have issues. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Uwe C. Schroeder Sent: Saturday, November 29, 2008 8:04 PM To: jquery-en@googlegroups.com Cc: Jeffrey Kretz Subject: [jQuery] Re: .ajax and ie7? On Saturday 29 November 2008, Jeffrey Kretz wrote: This may be overkill for your needs, but it is free: http://www.microsoft.com/express/vwd/ It also has jQuery-aware intellisense. Whenever I need to debug an IE script page, I do ALT-V, U, O, pick the VS Debugger and it opens right up with all the scripts available, can set breakpoints, view variables and properties, etc. etc. As much as I adore Firebug and can't live without it, its debugger is FAR eclipsed by the Visual Studio one (IMO). Thanks for that link. I was just going to ask if there even is a half way decent debugger for IE. Windows is so unwieldy when it comes to debugging (but that may just be me, as using Windows is a pain for me and I only do when there's absolutely no way around it...) Personally I write my stuff for Firefox (or better standards compliant - where firefox has it's issues every now and then, but far less than IE). Once all that works I start to degrade it to IE7. On all websites where I can make the decision (non-client websites), I don't even support IE6. Hey, if you use that old piece of crap you don't deserve visiting my website. The only thing I do for those guys is give them the download links to IE7, FF,Safari or Chrome.
[jQuery] Re: Problem with prev() in IE
Okay, so I stepped through the code. I'm going to hazard a guess that you didn't want the previous element but the parent element. $('#LHNav ul').prev() returns an H1 and an array of A elements. This is because prev looks for the sibling element just in front of the current one. $('#LHNav ul').parent('li') will, I believe, return the results you are looking for. JK P.S. IMO, the really odd thing is why FF worked when I believe it should have returned an empty set. Anyone else have any ideas? -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flycast Sent: Saturday, November 29, 2008 8:29 PM To: jQuery (English) Subject: [jQuery] Re: Problem with prev() in IE Yes... http://www.trinityacademy.org/testNavigation/ On Nov 29, 6:22 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I've used something very similar to that in IE6 without any problems. Could you post a demo page? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flycast Sent: Saturday, November 29, 2008 3:57 PM To: jQuery (English) Subject: [jQuery] Problem with prev() in IE This code works fine in FF and Safari but (surprise, surprise) not in IE6. $(#LHNav ul).prev('li').each(function(){ alert(Loop); }); I have narrowed it down to giving prev() some value to filter by. IF I try it like this: (notice the missing li) $(#LHNav ul).prev().each(function(){ alert(Loop); }); It works fine. Why does IE always have to be so buggy and particular?
[jQuery] Re: quote standards
Same here. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Geary Sent: Friday, November 28, 2008 2:20 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: quote standards I've posted messages here quite a few times recommending single quotes for the very reason that Josh mentioned. If you use double quotes you have to either escape the double quotes in HTML attributes, or use single quotes for the HTML attributes (which is invalid although it does work), or switch to single quotes for those strings. Easier to just use single quotes routinely. -Mike From: Bill I've wondered about this myself. I seem to go back and forth between the two without any rhyme or reason. Looking forward to more responses on this thread. From: Andy Matthews Yes. I am. Plus single quoting is slightly faster due to its lower case nature. No need to hold down the shift key. From: Josh Powell I've started using a single quote inside of all $() when quotes are needed because it makes creating DOM elements much simpler. $('a href=/path/a') or $('div id=anId/div and for consistency doing $('#anId'). Anyone else doing the same thing?
[jQuery] Re: Adding IMG attributes
Not exactly. The $(document).ready function fires when the DOM has been fully built, so not all the images will be loaded at that time. You could bind to the images load method as well. function fixDimensions() { var img = $(this); img.attr('width',img.width()); img.attr('height',img.height()); } $('img').each(fixDimensions).bind('load',fixDimensions); JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of enchance Sent: Friday, November 28, 2008 5:52 PM To: jQuery (English) Subject: [jQuery] Adding IMG attributes I'm trying to add several attributes to all my img tags but I'm not sure if they're both working. Could you verify if these are correct? $(document).ready(function(){ //add the width and height for each image $('img').each(function(){ $(this).attr('width', $(this).width()); $(this).attr('height', $(this).height()); }); //copy alt to title $('img').attr('title', function(){ $(this).attr('alt'); }); }); Am I doing the right thing?
[jQuery] Re: animate problem with IE7
Well, have you thought of using fixed pixel positions, rather than percentages? When you click prev or next, use the offset() function to grab the exact position, then animate += 245px (or whatever). It's less convenient, but it may be more successful. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Thursday, November 27, 2008 2:49 AM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 The answer for the ticket is: That's a matter of css. Different browser have different whims when it comes to scrolling. Try adding height and width to the containing UL. I tried adding width and height to the UL but nothing changes... to the div wrapping the UL but again, nothing is changed. The LI elements are already fixed... :-| Any other idea?!? On Nov 25, 11:42 pm, ^AndreA^ [EMAIL PROTECTED] wrote: Ticket opened...http://dev.jquery.com/ticket/3650 bye, Andrea On Nov 24, 11:35 pm, ^AndreA^ [EMAIL PROTECTED] wrote: Yesterday I tried to open a ticket but the server (onhttp://dev.jquery.com/) was not responding as it should so I posted a thread also in the jQuery development google group. http://groups.google.com/group/jquery-dev/browse_thread/thread/945f3c... Nobody has replied so far... I wait a couple of days to see if somebody knows something about it and then I'll report it. BTW, Jeffrey, thank you very much for your time!!! Andrea On Nov 24, 6:20 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: Regardless, it is possible that the actual bug may be in the core animate function as regards to animating relative percentages. Don't forget to open a ticket on it (dev.jquery.com) JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Monday, November 24, 2008 3:06 AM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 jQuery cycle plugin is very nice but I have had bad experiences with plugins... Usually they do a lot of things but not exactly what I need, therefore I have to start tweaking them and 'often' it would take less time doing it from scratch... often... ;-) On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote: why don´t you use Jquery Cycle plugin? On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I'm not an expert in the animation sytem -- you should open a ticket (dev.jquery.com) and get some others to take a look at it. When I stepped through the code, I found a potential problem here, line 3043 of jquery.js // We need to compute starting value if ( unit != px ) { self.style[ name ] = (end || 1) + unit; start = ((end || 1) / e.cur(true)) * start; self.style[ name ] = start + unit; } The div in question has a starting position of: left:-50%; The value of end is 50, unit is %. All of the other divs that had a positive percentage were handled correctly. While processing this div the starting position was somehow altered to -4%, leaving the ending position at 46% (-4 + 50). I'm not that familiar with the animation plumbing, so I'm not sure why this is occurring. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 4:26 PM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 Hi Jeffrey, thanks. I deleted the float: left;, i didn't know was useless with position:absolute; Anyway, I noted the strange behaviour of the li elements too. I uploaded jQuery unpacked... if you still want to have a look... ;-) BTW, there could be something wrong with animate('left','+=50%'); but that would mean a bug... :-| Thanks, Andrea On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I watched the animation with the IE developer toolbar, and noticed a couple of oddities. Firstly, the CSS for the divs are set to both position:absolute and float:left. This is not the source of the problem (I overwrite to float:none and tried it), but float:left is unnecessary if with absolute positioning. Anyway, then I monitored the left: position as the animations happened. While going to the right, everything went as usual. Div#0 0% to -50% Div#1 25% to -25% Div#2 50% to 0% Div#3 75% to 25% Div#4 100% to 50% Div#5 125% to 75% All good. Then I refreshed and tried going to the left. Div#0 0% to 50% Div#1 25% to 75% Div#2 50% to 100% Div#3 75% to 125% Div#4 100% to 45% Div#5 125% to 48% As you can see, divs 0-3 were fine. Divs 4 and 5 got WEIRD settings
[jQuery] Re: scope issues in safari
Can you post a test case url showing this issue? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of thesubtledoctor Sent: Wednesday, November 26, 2008 11:37 AM To: jQuery (English) Subject: [jQuery] Re: scope issues in safari Thanks alot for the suggestion. It didn't work though. I'm at a loss. Is this a jQuery bug, or am I doing something wrong? On Nov 25, 3:53 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: You could try this: jQuery('div.clause').each(function(){ var width = 0; var words = jQuery(this).children('div.word'); for (var i=0;iwords.length;i++) { var word = words.eq(i); var thiswidth = word.width(); var padding = word.css('padding-left'); width = width + parseInt(thiswidth) + parseInt(padding); } jQuery(this).width(width+30); }); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of thesubtledoctor Sent: Tuesday, November 25, 2008 10:44 AM To: jQuery (English) Subject: [jQuery] scope issues in safari I need to calculate the widths of the divs of class 'clause' dynamically based on the widths of their contents, divs of class 'word'. The following code works correctly in Firefox: jQuery('div.clause').each(function(){ var width = 0; jQuery(this).children('div.word').each(function(){ var thiswidth = jQuery(this).width(); var padding = jQuery(this).css('padding-left'); width = width + parseInt(thiswidth) + parseInt(padding); }); jQuery(this).width(width+30); }); but in Safari it seems that a) the variable 'width' is calculated by adding the widths of every div.word, not just those within a given div.clause, b) 'width' is not local within the outer .each brackets, so that what would be the total width of the second div.clause but for issue (a) is added on top of the already calculated width for the first div.clause. So in Firefox the calculated widths are 187px, 268px, and 353px, whereas in safari they are 2838px, 8544px, and 34206px. Can anyone suggest a solution?
[jQuery] Re: Using jquery to construct menus like nbc.com
If you have a sample url of your code, that would be helpful. But at a guess, the flyout div is probably not a child of the main menu element, so the mouseenter and mouseleave won't work properly. If this is the case, it will require a minor change to the hover plumbing. The z-index with flash in IE6/7 can usually be solved by doing two things: 1. Add the wmode=transparent attribute to the flash movie. 2. Wrap the object tag in a div set for the same width and height, with its z-index set for 0. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of serpicolugnut Sent: Tuesday, November 25, 2008 7:08 AM To: jquery-en@googlegroups.com Subject: [jQuery] Using jquery to construct menus like nbc.com I'm trying to utilize jquery to construct a menu structure that is similar to what you see at fox.com and nbc.com. Basically I have a menu that is a ul list, with each li selector given it's own id. Below I have a div container for each menu item, which are set to be hidden by jquery upon load. I've been the mousever/mouseout actions to trigger turning each div container on/off, but the problems I'm encountering with this are 1) it works when hovering over the main menu selection, but not when the mouse is inside the div, making selecting sub items difficult/ impossible, and 2) for some reason in IE6/IE7, the divs don't show when they are over a Flash object. Does anybody have any ideas on how to take items #1 and #2? -- View this message in context: http://www.nabble.com/Using-jquery-to-construct-menus-like-nbc.com-tp2068217 1s27240p20682171.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Using jquery to construct menus like nbc.com
I made a few changes and reposted it here: http://test1.scorpiondesign.com/LocalTest7.htm Changes: menu1 through menu5 were moved underneath their respective LIs. When the menus were NOT children of the LIs, the mouseenter mouseleave kept firing. #nav { position:relative; } This allows the absolute positioning of child elements relative to itself. #menu1, #menu2, #menu3, #menu4, #menu5 { display:none; left: 0px; Rather than hiding the menus with javascript, I set the CSS to display none. The first toggle called will turn them on. The left:0px aligns the menus with the first relatively positioned element, in this case #nav. $(li.main-nav).bind(mouseenter mouseleave, function(){ $(this).children('div').toggle(); return false; }); So it's a class based selector (less code), and it only binds the parent element (rather than the parent and child). Cheers, JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of serpicolugnut Sent: Tuesday, November 25, 2008 11:04 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Using jquery to construct menus like nbc.com Here's a link to a simplified version of the code. The mouseenter/mouseleave events helped, but I'm seeing some strangeness on the first menu item, and then some flickering on the others. http://dl.getdropbox.com/u/21984/menu_test.html Jeffrey Kretz wrote: If you have a sample url of your code, that would be helpful. But at a guess, the flyout div is probably not a child of the main menu element, so the mouseenter and mouseleave won't work properly. If this is the case, it will require a minor change to the hover plumbing. The z-index with flash in IE6/7 can usually be solved by doing two things: 1. Add the wmode=transparent attribute to the flash movie. 2. Wrap the tag in a div set for the same width and height, with its z-index set for 0. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of serpicolugnut Sent: Tuesday, November 25, 2008 7:08 AM To: jquery-en@googlegroups.com Subject: [jQuery] Using jquery to construct menus like nbc.com I'm trying to utilize jquery to construct a menu structure that is similar to what you see at fox.com and nbc.com. Basically I have a menu that is a ul list, with each li selector given it's own id. Below I have a div container for each menu item, which are set to be hidden by jquery upon load. I've been the mousever/mouseout actions to trigger turning each div container on/off, but the problems I'm encountering with this are 1) it works when hovering over the main menu selection, but not when the mouse is inside the div, making selecting sub items difficult/ impossible, and 2) for some reason in IE6/IE7, the divs don't show when they are over a Flash object. Does anybody have any ideas on how to take items #1 and #2? -- View this message in context: http://www.nabble.com/Using-jquery-to-construct-menus-like-nbc.com-tp2068217 1s27240p20682171.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Using-jquery-to-construct-menus-like-nbc.com-tp2068217 1s27240p20687612.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: dynamic tree / treeview
Unfortunately, I'm not familiar with Action class Is this a JSP thing? When the user saves the new page with an ajax call, is it recorded in a database? If so, when the user then refreshes, shouldn't the server output the new page nodes correctly during the HTML render? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Bhavin Sent: Tuesday, November 25, 2008 11:53 AM To: jQuery (English) Subject: [jQuery] Re: dynamic tree / treeview Thanks Jeffrey. I solved issue# 1 almost similar way you suggested. But I am more concern about issue # 2. I am not sure about the flow. I want something like: 1) Click on Create Page link. I want to allow users to create data which will be internally displayed in ulli elements and user can dragdrop and save the sequence. 2) Open dialog, enter data Save. Here I am using $.ajax(). Bringing data from Action class in JSON datatype. 3) I will get data in success of $.ajax(). I can manipulate DOM, insert ulli elements with data and similar way I can create child, subchild of the nodes. The problem here is: When I create children dynamically, I want to make sure if user clicks on Refresh button then also data should be retained on the page. In above case, it is not retaining because I am not sure how to go ahead with that. Should I capture Refresh event, fire event to the Action class, bring the data and show it on the page? Or is there any other alternative? How can I make sure that whatever data I am showing on the page is updated one and latest? Please advice. Thanks, Bhavin On Nov 22, 3:29 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I'm not 100% I understood your question, but I'll give it a shot. I have a dynamically rendered TreeView that is showing a page hierarchy, parent and child. There is an option to add/remove pages, as well as drag them around. Because I need the id of the page and its parent, I render it in the HTML as an attribute. li _pageid=132 PageName1 ul li _pageid=543PageName2/li li _pageid=565PageName3/li /ul /li Database updates are handled as such: var li = $(this); var pageid = parseInt(li.attr('_pageid')); var parentid = parseInt(li.parents('li:first').attr('_pageid')); If I have a new set of child pages to render after an ajax call: var li =tree.find('li[_pageid='+pageid+']'); if (li.length) { var ul = li.children('ul'); if (!ul.length) ul = $('ul/ul').appendTo(li); ul.html(newchildnodes); } Does this help? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Bhavin Sent: Saturday, November 22, 2008 2:48 PM To: jQuery (English) Subject: [jQuery] Re:dynamictree/ treeview Anybody can guide me on this? On Nov 21, 12:55 am, Bhavin [EMAIL PROTECTED] wrote: Hi I am using jquery to createtreestructure type of functionality dynamically. I have to add nodes by opening dialog and save it into the database. Once response is returned then I need to show it on the page. I have few doubts here: 1) Once node is inserted into the database and response is rendered on the page then how can I fetch id/value of the node. Here, DOM shouldn't be updated automatically? I am not able to fetch parent node id while adding child into it. 2) Once data is rendered on the page and if I refresh it then how should I show thetreewhich was already created dynamically? Do I need to bring all the data from the database by passing parentid? Please guide. Thanks, Bhavin- Hide quoted text - - Show quoted text -
[jQuery] Re: scope issues in safari
You could try this: jQuery('div.clause').each(function(){ var width = 0; var words = jQuery(this).children('div.word'); for (var i=0;iwords.length;i++) { var word = words.eq(i); var thiswidth = word.width(); var padding = word.css('padding-left'); width = width + parseInt(thiswidth) + parseInt(padding); } jQuery(this).width(width+30); }); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of thesubtledoctor Sent: Tuesday, November 25, 2008 10:44 AM To: jQuery (English) Subject: [jQuery] scope issues in safari I need to calculate the widths of the divs of class 'clause' dynamically based on the widths of their contents, divs of class 'word'. The following code works correctly in Firefox: jQuery('div.clause').each(function(){ var width = 0; jQuery(this).children('div.word').each(function(){ var thiswidth = jQuery(this).width(); var padding = jQuery(this).css('padding-left'); width = width + parseInt(thiswidth) + parseInt(padding); }); jQuery(this).width(width+30); }); but in Safari it seems that a) the variable 'width' is calculated by adding the widths of every div.word, not just those within a given div.clause, b) 'width' is not local within the outer .each brackets, so that what would be the total width of the second div.clause but for issue (a) is added on top of the already calculated width for the first div.clause. So in Firefox the calculated widths are 187px, 268px, and 353px, whereas in safari they are 2838px, 8544px, and 34206px. Can anyone suggest a solution?
[jQuery] Re: animate problem with IE7
Regardless, it is possible that the actual bug may be in the core animate function as regards to animating relative percentages. Don't forget to open a ticket on it (dev.jquery.com) JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Monday, November 24, 2008 3:06 AM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 jQuery cycle plugin is very nice but I have had bad experiences with plugins... Usually they do a lot of things but not exactly what I need, therefore I have to start tweaking them and 'often' it would take less time doing it from scratch... often... ;-) On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote: why don´t you use Jquery Cycle plugin? On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I'm not an expert in the animation sytem -- you should open a ticket (dev.jquery.com) and get some others to take a look at it. When I stepped through the code, I found a potential problem here, line 3043 of jquery.js // We need to compute starting value if ( unit != px ) { self.style[ name ] = (end || 1) + unit; start = ((end || 1) / e.cur(true)) * start; self.style[ name ] = start + unit; } The div in question has a starting position of: left:-50%; The value of end is 50, unit is %. All of the other divs that had a positive percentage were handled correctly. While processing this div the starting position was somehow altered to -4%, leaving the ending position at 46% (-4 + 50). I'm not that familiar with the animation plumbing, so I'm not sure why this is occurring. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 4:26 PM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 Hi Jeffrey, thanks. I deleted the float: left;, i didn't know was useless with position:absolute; Anyway, I noted the strange behaviour of the li elements too. I uploaded jQuery unpacked... if you still want to have a look... ;-) BTW, there could be something wrong with animate('left','+=50%'); but that would mean a bug... :-| Thanks, Andrea On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I watched the animation with the IE developer toolbar, and noticed a couple of oddities. Firstly, the CSS for the divs are set to both position:absolute and float:left. This is not the source of the problem (I overwrite to float:none and tried it), but float:left is unnecessary if with absolute positioning. Anyway, then I monitored the left: position as the animations happened. While going to the right, everything went as usual. Div#0 0% to -50% Div#1 25% to -25% Div#2 50% to 0% Div#3 75% to 25% Div#4 100% to 50% Div#5 125% to 75% All good. Then I refreshed and tried going to the left. Div#0 0% to 50% Div#1 25% to 75% Div#2 50% to 100% Div#3 75% to 125% Div#4 100% to 45% Div#5 125% to 48% As you can see, divs 0-3 were fine. Divs 4 and 5 got WEIRD settings. Now, I tried stepping through the code, but your jQuery is minified. My guess is there is something wrong with the animate('left','+=50%'); Cheers, JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 3:29 PM To: jQuery (English) Subject: [jQuery] animate problem with IE7 Hi all, I'm working on a slideshow/carousel:http://www.lesperimento.netsons.org/various/my_carousel/ It's works fine except than in IE7/6 (basically as usual... ;-) ) It's weird also because the next button/arrow works well under IE but NOT the prev button/arrow; and that's the problem. I explain briefly how the script works. When you click the arrows you call next_f(); and prev_f(); that do exactly the same thing but in different direction. They call three functions: 1) choose_element_to_move(some_params); it's quite clear the meaning, anyway it choose which li elements have to be moved. 2) place_elem_right_pos(some_params); once it knows which elements have to be moved, it moves them in the right position and ready for the animation. 3) move(elem,imgs); it moves the elements... elem: is an array containing all the id of the elements to move imgs: is an int, it's the number of images to move (I need it because via php ,when the page is generated, I can change the number of elements) The problem is in move(elem,imgs), in this part that is the prev_button where sing0: JS: else if(sign0) //prev button { for(var i=imgs-1; i=0;i--) { $('#' + elem[i]).animate({ left
[jQuery] Re: How can i do Image rollover with simple gamma change?
Opacity would fade in the image as a whole, rather than adjusting its brightness/contrast (which is more what gamma would adjust). I don't know how fancy you want to get, but you could absolutely position a div in front of the image, set for white (or black) and adjust its opacity from 0 to some small percentage (10%, maybe?) as a highlight. jQuery.fn.gammaGlow = function(color,opacity){ return this.each(function(i){ var img = $(this); var css = $.extend({ display:'none', position:'absolute', backgroundColor:color, opacity:opacity, width:img.width(), height:img.height() },img.position()) $('div/div') .css(css) .insertAfter(img) .fadeIn() .fadeOut(function(){$(this).remove();}) }); }; -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andy Matthews Sent: Monday, November 24, 2008 1:34 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: How can i do Image rollover with simple gamma change? Yes... You can use the animate method to fade in/out any element by applying opacity. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of expat101 Sent: Monday, November 24, 2008 3:04 PM To: jQuery (English) Subject: [jQuery] How can i do Image rollover with simple gamma change? I would like to have an image rollover with just basic gamma change to highlight an image...can this be done with basic jquery?
[jQuery] Re: how to capture error 500/404 ?
The best way would be to use the $.ajax call directly (both the post and the get function call $.ajax internally). $.ajax({ type:'GET', url:'somepath.php', dataType:'json', success:do_something, error:do_something_else }); function do_something(results) { /// } function do_something_else() { /// } JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Adwin Wijaya Sent: Sunday, November 23, 2008 8:58 PM To: jQuery (English) Subject: [jQuery] how to capture error 500/404 ? Hi, how to capture error that produced by server (err 505 or 404) inside $.post() and $.get() ? thanks !!!
[jQuery] Re: event delegation - great, but how does one trigger the handlers through code?
I pretty sure it won't, because click() will fire trigger(), which will use data() to lookup the bound event of the selected element, and not find anything. Haven't tested this though. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ricardobeat Sent: Saturday, November 22, 2008 7:43 AM To: jQuery (English) Subject: [jQuery] Re: event delegation - great, but how does one trigger the handlers through code? Can't you just $('tbody td:eq(x)').click() ? The event should propagate as normal and reach the tbody. I guess. On Nov 22, 1:11 am, Leeoniya [EMAIL PROTECTED] wrote: During event delegation, handlers are registered higher in the DOM tree and then filtered when the event is triggered. This is great if you have 2000 td/th cells, you can attach a listener to tbody and filter down. But would i trigger the event programatically? Since the handler isnt actually registered on the td cells, i cant figure out a way to do this except maybe construct a fake event with the source element by hand and pass it into the handler somehow?? this is the biggest drawback to delegation that i have run into, it would be great to find a good way to manually trigger these events - if anyone has some advice, please share. thanks, Leon
[jQuery] Re: dynamic tree / treeview
I'm not 100% I understood your question, but I'll give it a shot. I have a dynamically rendered TreeView that is showing a page hierarchy, parent and child. There is an option to add/remove pages, as well as drag them around. Because I need the id of the page and its parent, I render it in the HTML as an attribute. li _pageid=132 PageName1 ul li _pageid=543PageName2/li li _pageid=565PageName3/li /ul /li Database updates are handled as such: var li = $(this); var pageid = parseInt(li.attr('_pageid')); var parentid = parseInt(li.parents('li:first').attr('_pageid')); If I have a new set of child pages to render after an ajax call: var li = tree.find('li[_pageid='+pageid+']'); if (li.length) { var ul = li.children('ul'); if (!ul.length) ul = $('ul/ul').appendTo(li); ul.html(newchildnodes); } Does this help? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Bhavin Sent: Saturday, November 22, 2008 2:48 PM To: jQuery (English) Subject: [jQuery] Re: dynamic tree / treeview Anybody can guide me on this? On Nov 21, 12:55 am, Bhavin [EMAIL PROTECTED] wrote: Hi I am using jquery to createtreestructure type of functionality dynamically. I have to add nodes by opening dialog and save it into the database. Once response is returned then I need to show it on the page. I have few doubts here: 1) Once node is inserted into the database and response is rendered on the page then how can I fetch id/value of the node. Here, DOM shouldn't be updated automatically? I am not able to fetch parent node id while adding child into it. 2) Once data is rendered on the page and if I refresh it then how should I show thetreewhich was already created dynamically? Do I need to bring all the data from the database by passing parentid? Please guide. Thanks, Bhavin
[jQuery] Re: animate problem with IE7
I watched the animation with the IE developer toolbar, and noticed a couple of oddities. Firstly, the CSS for the divs are set to both position:absolute and float:left. This is not the source of the problem (I overwrite to float:none and tried it), but float:left is unnecessary if with absolute positioning. Anyway, then I monitored the left: position as the animations happened. While going to the right, everything went as usual. Div#00% to -50% Div#1 25% to -25% Div#2 50% to 0% Div#3 75% to 25% Div#4 100% to 50% Div#5 125% to 75% All good. Then I refreshed and tried going to the left. Div#00% to 50% Div#1 25% to 75% Div#2 50% to 100% Div#3 75% to 125% Div#4 100% to 45% Div#5 125% to 48% As you can see, divs 0-3 were fine. Divs 4 and 5 got WEIRD settings. Now, I tried stepping through the code, but your jQuery is minified. My guess is there is something wrong with the animate('left','+=50%'); Cheers, JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 3:29 PM To: jQuery (English) Subject: [jQuery] animate problem with IE7 Hi all, I'm working on a slideshow/carousel: http://www.lesperimento.netsons.org/various/my_carousel/ It's works fine except than in IE7/6 (basically as usual... ;-) ) It's weird also because the next button/arrow works well under IE but NOT the prev button/arrow; and that's the problem. I explain briefly how the script works. When you click the arrows you call next_f(); and prev_f(); that do exactly the same thing but in different direction. They call three functions: 1) choose_element_to_move(some_params); it's quite clear the meaning, anyway it choose which li elements have to be moved. 2) place_elem_right_pos(some_params); once it knows which elements have to be moved, it moves them in the right position and ready for the animation. 3) move(elem,imgs); it moves the elements... elem: is an array containing all the id of the elements to move imgs: is an int, it's the number of images to move (I need it because via php ,when the page is generated, I can change the number of elements) The problem is in move(elem,imgs), in this part that is the prev_button where sing0: JS: else if(sign0) //prev button { for(var i=imgs-1; i=0;i--) { $('#' + elem[i]).animate({ left: '+=' + perc + '%' }, 1000); } } I cut part of the code that was not useful for the purpose... Basically it does not do anything else than taking each element to move e move them, but I don't understand why it does not want to work with IE. arghhh!!! any idea?!? I'm sure the problem is in this part of code because before I was using another function instead of animate (two setTimeout in cascade) and was working also under IE (I'm trying to use animate because is much much smoother). If you are still reading, thanks for your time... hehe...
[jQuery] Re: animate problem with IE7
I'm not an expert in the animation sytem -- you should open a ticket (dev.jquery.com) and get some others to take a look at it. When I stepped through the code, I found a potential problem here, line 3043 of jquery.js // We need to compute starting value if ( unit != px ) { self.style[ name ] = (end || 1) + unit; start = ((end || 1) / e.cur(true)) * start; self.style[ name ] = start + unit; } The div in question has a starting position of: left:-50%; The value of end is 50, unit is %. All of the other divs that had a positive percentage were handled correctly. While processing this div the starting position was somehow altered to -4%, leaving the ending position at 46% (-4 + 50). I'm not that familiar with the animation plumbing, so I'm not sure why this is occurring. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 4:26 PM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 Hi Jeffrey, thanks. I deleted the float: left;, i didn't know was useless with position:absolute; Anyway, I noted the strange behaviour of the li elements too. I uploaded jQuery unpacked... if you still want to have a look... ;-) BTW, there could be something wrong with animate('left','+=50%'); but that would mean a bug... :-| Thanks, Andrea On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I watched the animation with the IE developer toolbar, and noticed a couple of oddities. Firstly, the CSS for the divs are set to both position:absolute and float:left. This is not the source of the problem (I overwrite to float:none and tried it), but float:left is unnecessary if with absolute positioning. Anyway, then I monitored the left: position as the animations happened. While going to the right, everything went as usual. Div#0 0% to -50% Div#1 25% to -25% Div#2 50% to 0% Div#3 75% to 25% Div#4 100% to 50% Div#5 125% to 75% All good. Then I refreshed and tried going to the left. Div#0 0% to 50% Div#1 25% to 75% Div#2 50% to 100% Div#3 75% to 125% Div#4 100% to 45% Div#5 125% to 48% As you can see, divs 0-3 were fine. Divs 4 and 5 got WEIRD settings. Now, I tried stepping through the code, but your jQuery is minified. My guess is there is something wrong with the animate('left','+=50%'); Cheers, JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 3:29 PM To: jQuery (English) Subject: [jQuery] animate problem with IE7 Hi all, I'm working on a slideshow/carousel:http://www.lesperimento.netsons.org/various/my_carousel/ It's works fine except than in IE7/6 (basically as usual... ;-) ) It's weird also because the next button/arrow works well under IE but NOT the prev button/arrow; and that's the problem. I explain briefly how the script works. When you click the arrows you call next_f(); and prev_f(); that do exactly the same thing but in different direction. They call three functions: 1) choose_element_to_move(some_params); it's quite clear the meaning, anyway it choose which li elements have to be moved. 2) place_elem_right_pos(some_params); once it knows which elements have to be moved, it moves them in the right position and ready for the animation. 3) move(elem,imgs); it moves the elements... elem: is an array containing all the id of the elements to move imgs: is an int, it's the number of images to move (I need it because via php ,when the page is generated, I can change the number of elements) The problem is in move(elem,imgs), in this part that is the prev_button where sing0: JS: else if(sign0) //prev button { for(var i=imgs-1; i=0;i--) { $('#' + elem[i]).animate({ left: '+=' + perc + '%' }, 1000); } } I cut part of the code that was not useful for the purpose... Basically it does not do anything else than taking each element to move e move them, but I don't understand why it does not want to work with IE. arghhh!!! any idea?!? I'm sure the problem is in this part of code because before I was using another function instead of animate (two setTimeout in cascade) and was working also under IE (I'm trying to use animate because is much much smoother). If you are still reading, thanks for your time... hehe...
[jQuery] Re: event delegation - great, but how does one trigger the handlers through code?
Do you know if this plays friendly with the jQuery event model? Looking through the source code, it has its own implementation of fix for events, along with its own data storage for event handlers. Without testing it, I would tend to think these two libraries wouldn't jam up and cause a mess. You implement a jquery-based solution using a pattern like this: jQuery.fn.bubble = function(type) { return this.each(function(i){ // Build a fake event, and assign the target==this. var evt = ; evt.target = this; var el = this; while (el) { // Look for a handler of the supplied type. var handler = ; if (handler) { handler.apply(parent,[evt]); break; } else el = el.parentNode; } }); }; -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ricardobeat Sent: Saturday, November 22, 2008 4:44 PM To: jQuery (English) Subject: [jQuery] Re: event delegation - great, but how does one trigger the handlers through code? You're right, it doesn't work. Maybe NW Events could help here: http://code.google.com/p/nwevents/ It's an event manager and it can fire/propagate 'fake' events. - ricardo On Nov 22, 7:32 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I pretty sure it won't, because click() will fire trigger(), which will use data() to lookup the bound event of the selected element, and not find anything. Haven't tested this though. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ricardobeat Sent: Saturday, November 22, 2008 7:43 AM To: jQuery (English) Subject: [jQuery] Re: event delegation - great, but how does one trigger the handlers through code? Can't you just $('tbody td:eq(x)').click() ? The event should propagate as normal and reach the tbody. I guess. On Nov 22, 1:11 am, Leeoniya [EMAIL PROTECTED] wrote: During event delegation, handlers are registered higher in the DOM tree and then filtered when the event is triggered. This is great if you have 2000 td/th cells, you can attach a listener to tbody and filter down. But would i trigger the event programatically? Since the handler isnt actually registered on the td cells, i cant figure out a way to do this except maybe construct a fake event with the source element by hand and pass it into the handler somehow?? this is the biggest drawback to delegation that i have run into, it would be great to find a good way to manually trigger these events - if anyone has some advice, please share. thanks, Leon
[jQuery] Re: event delegation - great, but how does one trigger the handlers through code?
I've used a pattern like this: var table = $('table.class') .bind('click',selectCell); function selectCell(e) { var cell = e.target; do_something(); } var cell = table.find('td.eq(8)'); selectCell.apply(table[0],[{target:cell[0]}]); JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Leeoniya Sent: Friday, November 21, 2008 7:11 PM To: jQuery (English) Subject: [jQuery] event delegation - great, but how does one trigger the handlers through code? During event delegation, handlers are registered higher in the DOM tree and then filtered when the event is triggered. This is great if you have 2000 td/th cells, you can attach a listener to tbody and filter down. But would i trigger the event programatically? Since the handler isnt actually registered on the td cells, i cant figure out a way to do this except maybe construct a fake event with the source element by hand and pass it into the handler somehow?? this is the biggest drawback to delegation that i have run into, it would be great to find a good way to manually trigger these events - if anyone has some advice, please share. thanks, Leon
[jQuery] Re: asp.net and jquery - reactions to this letter
Personally I find debugging jQuery a snap -- even on my current project which is in excess of 25,000 lines of js code. I will say that I stay away from the ASP.NET ajax system completely, all of my hooks between jQuery and .NET are my own and I have had no problems. The original AJAX.NET library struck me as complex and unwieldy so I stayed away from it. MS now says they're going to use jQuery in the MVC platform and ship it with VS. http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ricardobeat Sent: Tuesday, November 18, 2008 11:20 PM To: jQuery (English) Subject: [jQuery] Re: asp.net and jquery - reactions to this letter Judging by this post by the sender of the letter I don't think you should take that argument seriously: http://www.nabble.com/Do-I-really-need-to-do-an-%27eval%27-in-JQuery--td9483 409s27240.html I don't know IntelliSense, but debugging jQuery with firebug is really easy. And there's no reason to check the object's methods when you know they will always be the same... - ricardo On Nov 18, 8:05 pm, Brian Cummiskey [EMAIL PROTECTED] wrote: rolfsf wrote: A friend had sent this rant in to microsoft, regarding jquery, which is published on their developer site. Not being an asp.net developer, I don't know what to make of his points. I'd be interested to hear from some asp.net developers who have embraced jquery - is it truly a monster? http://reddevnews.com/response/response.aspx?rdnid=1189 Thanks! IMO, .net is the monster, not jQuery. -Brian, an ASP code for a living
[jQuery] Re: Pause between each()
Off the top of my head (untested, sorry) var things = $('things'); var index = 0; things.eq(0).doStuff(); var fn = function() { index++; things.eq(index).doStuff(); setTimeout(fn,1000); }; setTimeout(fn,1000); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of d.williams Sent: Wednesday, November 19, 2008 5:05 PM To: jquery-en@googlegroups.com Subject: [jQuery] Pause between each() Hi, all. I was wondering how I insert a pause between moving to the next item in an each function. Pseudo-code: $('things').each(function() { \\ do suff sleep(5000); }); I know I need to use setTimeout, but I'm not sure how to pass setTimeout an iterator so the next item is passed. Any ideas? Thanks, Danny
[jQuery] Re: jQuery css opacity and 2nd level suckerfish menus...
The problem you have is due to the terrible IE implementation of opacity. IE actually uses DirectX 2D filters to render opacity, along with a whole bevy of completely proprietary filters and transitions. See this page for reference: http://msdn.microsoft.com/en-us/library/ms532847(VS.85).aspx HOWEVER, when any DX filter is applied to an element, any child elements that are absolutely positioned outside the boundries are not rendered. You can test this: div.box1 { position:relative; width:100px; height:100px; background-color:red; filter:alpha(opacity=50); opacity:0.5; } div.box2 { position:relative; width:100px; height:100px; left:50px; top:50px; background-color:blue; filter:alpha(opacity=50); opacity:0.5; } div class=box1 div class=box2/div /div And you'll see that box2 is chopped off by the boundaries of box1. The workarounds for this are NOT pretty, and require some custom work. For example, one solution is for both box1 and box2 to be siblings, rather than children. And have a mouseover event on box1 fire visibility on box2. But you can't use the default mouseenter/mouseleave events, because the two elements have no parent/child relationship. So you have to roll your own. Something like this (note this is not cut-and-paste ready code, just trying to give an idea of how this would work) var box1 = $('div.box1'); var box2 = $('div.box2'); box2[0].$parentNode = box1[0]; box1.bind('mouseover',showChild).bind('mouseout',hideChild); function showChild(e) { // Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; // Traverse up the tree while ( parent parent != elem ) try { parent = parent.$parentNode||parent.parentNode; } catch(error) { parent = elem; } // Return true if we actually just moused on to a sub-element if (parent==elem) return false; // Now show the child element. } Note that the code is walking up the tree by checking for $parentNode first, and if it doesn't find it, using the default parentNode property. It sort of fakes the hierarchy, as it makes the code think that box2 is a child of box1, when it really isn't. Again, this is ugly, but one workaround for IE. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jaredh123 Sent: Tuesday, November 18, 2008 4:08 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery css opacity and 2nd level suckerfish menus... ok, i put up two fully functional, self-contained test pages that demonstrate the problem: http://netrivetsandbox.com/jquery/test.html (with jQuery opacity rule) http://netrivetsandbox.com/jquery/test2.html (without jQuery opacity rule) compare in non-IE and IE and see that the first doesn't work in IE and the second does -- View this message in context: http://www.nabble.com/jQuery-css-opacity-and-2nd-level-suckerfish-menus...-t p20568430s27240p20571094.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: flexbox - makes no mention of server-side coding
I might be misunderstanding your question, but javascript plug-ins seldom describe the associated server-side code, as it really depends on your platform. PHP, ColdFusion, PERL/CGI, Java, .NET, all will have very different implementations of server-side solutions, along with their Database backends, MySQL, XML Feed, SQL Server, Oracle, etc, etc. If you have a specific question about how to implement some server-side code, there are many people on these boards that could help you out. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of donb Sent: Tuesday, November 18, 2008 5:53 PM To: jQuery (English) Subject: [jQuery] flexbox - makes no mention of server-side coding While this plugin looks very nice, there not the slightest mention of what the server script is provided. It must convey something about the user input but this is totally undocument as far as I could tell. The one mention is 'The call to results.aspx is ajax, and should return a JSON string ' and then the return structure is explained. OK, but what happens before that?
[jQuery] Re: asp.net and jquery - reactions to this letter
I wish I had some specific developer's blogs/resources to give you, but I can't think of any off the top of my head. However, for the last couple of years, all my software development has been C#/SQL backend with jQuery frontend, and it's been a perfect marriage as far as I'm concerned. If you have any specific questions I'd be happy to answer. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of rolfsf Sent: Tuesday, November 18, 2008 8:52 PM To: jQuery (English) Subject: [jQuery] Re: asp.net and jquery - reactions to this letter Thanks Jack Are there any asp.net + jquery blogs/resources/developer links that are particularly good? It's difficult for me to gauge how good (clean code, solid principles, brilliant thinking) some of the asp.net oriented jquery postings on the web are as I don't know it. Any recommendations I can pass on? - rolfsf On Nov 18, 3:52 pm, Jack Killpatrick [EMAIL PROTECTED] wrote: We've done a number of asp.net projects that use jQuery heavily. We do not use the MS Ajax stuff, because it's not vendor neutral. Many of our apps use C# web services and js-based widgets rendered client-side via Trimpath javascript Templates, with some tie-ins to the asp.net security model. The main hurdles we've found have been relatively easy to workaround and have nothing to do with jquery: 1. asp.net forms by default render the whole page inside a single form, which means we can't nest forms easily unless we override the default asp.net forms behavior, which then introduces some other side-effects. In general, we've been able to work around this limitation pretty easily. 2. asp.net controls render with id's that asp.net creates (so that nested objects can be managed by asp.net's intrernal logic). Because of that, we add a sprinkle of code sometimes that passes the id's of the controls we want to touch into a js init function, then assign those values to our js vars inside our js libraries. That said, we only have to do that when we want the js to be aware of some controls rendered by asp.net. Firebug's our primary js debugging tool and has worked out fine. Sometimes we use the MS script debugger, but only because there's no firebug in IE. - Jack rolfsf wrote:Are any of these clashes with asp.net that you and c.barr refer to anything that could be remedied by the jQuery Core team if they know about it? Or are these due to deeper structural philosophies that are unlikely to be resolved any time soon? On Nov 18, 2:27 pm, Armand Datema[EMAIL PROTECTED]wrote:mm Ive notices some clashes with asp.net but there is plenty info around ( from some of the top .net guys that realy take Jquery and asp.net combo to the edge.) how to make it deal wit this much better. Problem is that a lot of the ajax is hardwired into .net and therefore jquery alternatives take a bit more time but after that its much cleaner and easier to modify. He does have a point wit the debugging but I dont see that as such a big point, if you combine the .net debugging and firebug you can pretty much almost pinpoint your errors. If you are not realy stuck too much into the .net toolkit and dare to step outside of the bounds a bit Jquery in teh end will only save time On Tue, Nov 18, 2008 at 10:52 PM, rolfsf[EMAIL PROTECTED]wrote:A friend had sent this rant in to microsoft, regarding jquery, which is published on their developer site. Not being an asp.net developer, I don't know what to make of his points. I'd be interested to hear from some asp.net developers who have embraced jquery - is it truly a monster?http://reddevnews.com/response/response.aspx?rdnid=1189Thanks!-- Armand Datema CTO SchwingSoft
[jQuery] Re: Visual Studio Intellisense Issues
Here are a couple of articles on it: http://brennan.offwhite.net/blog/2008/02/01/intellisense-for-jquery-in-visua l-studio-2008/ http://blogs.ipona.com/james/archive/2008/02/15/JQuery-IntelliSense-in-Visua l-Studio-2008.aspx http://weblogs.asp.net/scottgu/archive/2007/06/21/vs-2008-javascript-intelli sense.aspx Hope this helps. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fontzter Sent: Wednesday, November 12, 2008 10:14 AM To: jQuery (English) Subject: [jQuery] Visual Studio Intellisense Issues Is anyone else having trouble getting the new VS 2008 intellisense to work? I have downloaded SP1 and the hotfix. I can get it working on the jquery file. However it seems to break on any plugin that uses this syntax: (function($) { ... } )(jQuery); Any thoughts or suggestions would help. This is a great feature that I would love to get working. Thanks, Dave
[jQuery] Re: [ANNOUNCEMENT] jquery.timepickr.js: first official release
I think it’s a great idea --it's a zillion times friendlier than an alert validator in ensuring properly formatted data. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Liam Potter Sent: Tuesday, November 11, 2008 7:16 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: [ANNOUNCEMENT] jquery.timepickr.js: first official release Nice plugin but, how often do you need to input the time into a form? and then, is it really that hard to input the time into a form? Alexandre Plennevaux wrote: impressive, congratz ! On Tue, Nov 11, 2008 at 3:34 PM, h3 [EMAIL PROTECTED] wrote: Hi everyone, Yesterday I released the first public release of my jquery.timepickr plugin. I've posted it on the jQuery plugin page: http://plugins.jquery.com/project/jquery-timepickr Home page: http://haineault.com/media/jquery/ui-timepickr/page/
[jQuery] Re: [ANNOUNCEMENT] jquery.timepickr.js: first official release
Look terrific in FF, but it's seriously broken in IE7. I get a script error on line 8007 whenever I click on the page, which seems to prevent anything from working. // hide all levels hide: function() { self = this; Right here. setTimeout(function() { self.wrapper.find('ol').hide(); }, self.options.hideDelay); }, It needs to say var self = this; It's trying to assign the global scope (window) object itself, and in IE, window.self is a read-only value, so it breaks. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of h3 Sent: Tuesday, November 11, 2008 6:35 AM To: jQuery (English) Subject: [jQuery] [ANNOUNCEMENT] jquery.timepickr.js: first official release Hi everyone, Yesterday I released the first public release of my jquery.timepickr plugin. I've posted it on the jQuery plugin page: http://plugins.jquery.com/project/jquery-timepickr Home page: http://haineault.com/media/jquery/ui-timepickr/page/
[jQuery] Re: get the class that starts with ...
Try $('[class^=rate]'); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of debussy007 Sent: Tuesday, November 11, 2008 3:15 PM To: jquery-en@googlegroups.com Subject: [jQuery] get the class that starts with ... Hi, How is it possible to get the class that starts with 'rate' of an element ? the class could be rate1, rate5, rateXYZ. I don't know what follows the substring 'rate'. I need to get the number that follows rate. Thank you for any help ! -- View this message in context: http://www.nabble.com/get-the-class-that-starts-with-...-tp20450061s27240p20 450061.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: JSON parser?
Is there a problem with using the eval function? I'm curious why you would need an alternative that would add overhead. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Alsup Sent: Monday, November 10, 2008 9:05 AM To: jQuery (English) Subject: [jQuery] Re: JSON parser? Really? I thought it had because jQuery evaluates JSON internally (e.g.: getJSON method). Correct, it 'evals' json, it does not parse it. From the httpData function: if ( type == json ) data = eval(( + data + ));
[jQuery] Re: JSON parser?
I just answered my own question. Are you trying to parse JSON provided from another source? I.e. not one of your own server pages? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Alsup Sent: Monday, November 10, 2008 9:05 AM To: jQuery (English) Subject: [jQuery] Re: JSON parser? Really? I thought it had because jQuery evaluates JSON internally (e.g.: getJSON method). Correct, it 'evals' json, it does not parse it. From the httpData function: if ( type == json ) data = eval(( + data + ));
[jQuery] Re: Is anyone from London?
Well I never been to England But I kinda like the Beatles Well I headed for Las Vegas Only made it out to Needles -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of weepy Sent: Saturday, November 08, 2008 8:45 AM To: jQuery (English) Subject: [jQuery] Re: Is anyone from London? I live in london On 8 Nov, 12:38, nmiddleweek [EMAIL PROTECTED] wrote: Hello, Sorry for the off-topic message but does anyone on the list work or live in London? I've recently started working for myself and thought it'd be a good idea to meet others working with similar tools and in general just have a few beers. Cheers, N
[jQuery] Re: Scrolling inside a div with mousemove
Yeah. There is some personal tastes too, like do you want it to constantly move around, or only move when you mouse to the edge, etc. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dan Sent: Friday, November 07, 2008 1:53 AM To: jQuery (English) Subject: [jQuery] Re: Scrolling inside a div with mousemove Ah ok, So does that mean I need to calctulate how far up or down it can scroll? On Nov 7, 7:34 am, Jeffrey Kretz [EMAIL PROTECTED] wrote: Ah, This part of the code: // Use the e.clientX and e.clientY vs this.tempPosition // to determine how much to move the scrollbars according // to your tastes. Was intended to be replaced by math that calculated the setTop and setLeft values. I didn't do that part. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dan Sent: Thursday, November 06, 2008 8:27 PM To: jQuery (English) Subject: [jQuery] Re: Scrolling inside a div with mousemove Hi Jeffrey, Thank you for your reply, however I can't seem to get your code to work. I'm getting an error that says setTop is not defined Any idea why this is? On Nov 6, 1:15 am, Jeffrey Kretz [EMAIL PROTECTED] wrote: Well, you could do something like this (completely untested, sorry). The hover events bind and unbind the mousemove to prevent resource drain. $('#thisdiv').hover(startScroll,stopScroll); function startScroll(e) { var div = $(this).bind('mousemove',scrollThis); var o = div.offset(); this.tempPosition = { left:o.left, top:o.top, right:o.left+div.width(), bottom:o.top+div.height(), scrollOffsetX:this.scrollWidth-this.clientWidth, scrollOffsetY:this.scrollHeight-this.clientHeight, }; } function stopScroll(e) { $(this).unbind('mousemove').removeAttr('tempPosition'); } function scrollThis(e) { // Use the e.clientX and e.clientY vs this.tempPosition // to determine how much to move the scrollbars according // to your tastes. this.scrollTop = setTop; this.scrollLeft = setLeft; } -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dan Sent: Wednesday, November 05, 2008 2:56 PM To: jQuery (English) Subject: [jQuery] Scrolling inside a div with mousemove Hello, I'm trying to move from MooTools over the jQuery as it seems to be a much reliable and user friendly framework. However I need to recreate something that I currently have MooTools doing but am having trouble figuring out how it would work. I'm trying to replicate the effect seen in the 'mousemove' example of this MooTools pagehttp://demos111.mootools.net/Scroller. It doesn't need to scroll left and right but it's fine if it does, I'm quite comfortable using JavaScript but just to warn you I'm very new to jQuery :) Thank you very much for any help.
[jQuery] Re: animated robot cartoon with jquery
It's actually workable to use Flash as a basis for the sound. It's easier with ActionScript 3.0, but it can still be done in earlier versions. You have to bind a flash method to an external interface (look up ExternalInterface in the docs). Then you can find the object by ID, and call the method on it directly. $('#swffile')[0].playSound(); JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of CodingCyborg Sent: Friday, November 07, 2008 9:04 PM To: jQuery (English) Subject: [jQuery] Re: animated robot cartoon with jquery I am sad to report that finding cross browser audio playing javascript is pretty tough stuff... I found one plug-in that used flash, but couldn't get it implemented correctly. I may try again tomorrow, but don't count on it too much, if somebody else could implement some squeaky wheel sounds for when it's moving that would be nice :) Best of luck. On Nov 7, 10:12 pm, CodingCyborg [EMAIL PROTECTED] wrote: I found the edge of the cliff while allowing the robot to roll multiple times without resetting the backgrounds. From there I thought it would be fun to have him fall :) Now I'm looking into adding some fun sound effects :) I'll let ya know how that goes in a couple hours... On Nov 7, 8:58 pm, anthony.calzadilla [EMAIL PROTECTED] wrote: Thats incredible! How did you do that?! I'm going to dig into your code and try to figure it out... AWESOME! -A On Nov 7, 8:50 pm, CodingCyborg [EMAIL PROTECTED] wrote: Well, I decided to add some more fun stuff :) http://codingcyborg.com/jQueryFun/Robot/robotHumor.html There are now some movement images on the wheels. And I added an old school off the cliff cartoon style ending :) On Nov 7, 11:58 am, anthony.calzadilla [EMAIL PROTECTED] wrote: Hi, I changed the 'bounceHim' function a bit so that the different pieces of the robot look like they are separated and bouncing individually: function bounceHim(){ $(#sec-content,#branding).animate({top:-=5px}, 150).animate({top:+=5px},150); $(#content).animate({top:-=8px},150).animate({top:+=8px},150); setTimeout(bounceHim(),300); } http://robot.anthonycalzadilla.com/ Once again thanks for your insight. I really am a complete novice at programming in general. I'm really scrutinizing your code so as to learn from it. -Anthony On Nov 7, 8:34 am, CodingCyborg [EMAIL PROTECTED] wrote: I just noticed, after looking over the code again, that since you have all three pieces of the robot that are bouncing bounce at the same time the line of code can be condensed into one. As well as the two that bounce together at the beginning. This: $(#content).animate({top:-=+num+px},150).animate({top:+=+num +px},150); $(#branding).animate({top:-=+num+px},150).animate({top:+=+num +px},150); Becomes this: $(#content,#branding).animate({top:-=+num+px}, 150).animate({top:+=+num+px},150); And in the next function this: $(#sec-content).animate({top:-=5px},150).animate({top:+=5px}, 150); $(#content).animate({top:-=5px},150).animate({top:+=5px},150); $(#branding).animate({top:-=5px},150).animate({top:+=5px},150); Becomes this: $(#sec-content,#content,#branding).animate({top:-=5px}, 150).animate({top:+=5px},150); Of course, if you wished to have each part bounce a different amount or at different rates you would need to set up different timeouts with different functions if they couldn't be set with the current 300 ms function. But if you wanted something to go at half speed or a whole number multiple speed you could just changed how much code was in the function and the numbers associated with it. (If any of that makes sense.) But that saves more code, and again, makes the file a bit (Quite seriously only a few bits :P) smaller. On Nov 7, 12:44 am, anthony.calzadilla [EMAIL PROTECTED] wrote: Wow! Thank you CodingCyborg! Thank You! I'm going to study and learn from your code example and implement it into mine. -Anthony On Nov 7, 12:24 am, CodingCyborg [EMAIL PROTECTED] wrote: I made a few more modifications such that the robot doesn't keep bouncing and the sky keep moving when the ground has stopped. Though I did the cheap way, in the sense that I just made it a short clip rather than a full length repeat. http://codingcyborg.com/jQueryFun/Robot/robot.html That has the same basic directory set up, but with the modified script.js file for viewing. On Nov 6, 11:07 pm, CodingCyborg [EMAIL PROTECTED] wrote: This is Beautiful! To save yourself from the copy/paste to create the repeated bounce, and to make the file smaller, you can
[jQuery] Re: How to solve this
Mostly like your last question just got overlooked, as it came in at 4:30am. ;-) There are two types of progress bar indicators you can use. The first is a fake one, with an animated picture that doesn't really mean anything. However, when you post the page most browsers will pause gif animations once the POST is started. The workaround for this is to have the form submission (or the progress bar) in a separate iframe so one doesn't affect the other. Or submit the form with an ajax (e.g. jquery.form plugin). The second, more sophisticated solution requires some server-side code monitors the request as it is being processed and records the state in a static memory variable. Then the page can do periodic ajax calls (setInterval) to obtain the status of the upload and update the progress bar with accurate figures. There are others here who will have a PHP-based solution, but if you are interested I have a .NET one I wrote. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Johny Sent: Wednesday, November 05, 2008 10:57 PM To: jQuery (English) Subject: [jQuery] Re: How to solve this Nobody knows the answer to my question ? :-(
[jQuery] Re: Scrolling inside a div with mousemove
Ah, This part of the code: // Use the e.clientX and e.clientY vs this.tempPosition // to determine how much to move the scrollbars according // to your tastes. Was intended to be replaced by math that calculated the setTop and setLeft values. I didn't do that part. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dan Sent: Thursday, November 06, 2008 8:27 PM To: jQuery (English) Subject: [jQuery] Re: Scrolling inside a div with mousemove Hi Jeffrey, Thank you for your reply, however I can't seem to get your code to work. I'm getting an error that says setTop is not defined Any idea why this is? On Nov 6, 1:15 am, Jeffrey Kretz [EMAIL PROTECTED] wrote: Well, you could do something like this (completely untested, sorry). The hover events bind and unbind the mousemove to prevent resource drain. $('#thisdiv').hover(startScroll,stopScroll); function startScroll(e) { var div = $(this).bind('mousemove',scrollThis); var o = div.offset(); this.tempPosition = { left:o.left, top:o.top, right:o.left+div.width(), bottom:o.top+div.height(), scrollOffsetX:this.scrollWidth-this.clientWidth, scrollOffsetY:this.scrollHeight-this.clientHeight, }; } function stopScroll(e) { $(this).unbind('mousemove').removeAttr('tempPosition'); } function scrollThis(e) { // Use the e.clientX and e.clientY vs this.tempPosition // to determine how much to move the scrollbars according // to your tastes. this.scrollTop = setTop; this.scrollLeft = setLeft; } -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dan Sent: Wednesday, November 05, 2008 2:56 PM To: jQuery (English) Subject: [jQuery] Scrolling inside a div with mousemove Hello, I'm trying to move from MooTools over the jQuery as it seems to be a much reliable and user friendly framework. However I need to recreate something that I currently have MooTools doing but am having trouble figuring out how it would work. I'm trying to replicate the effect seen in the 'mousemove' example of this MooTools pagehttp://demos111.mootools.net/Scroller. It doesn't need to scroll left and right but it's fine if it does, I'm quite comfortable using JavaScript but just to warn you I'm very new to jQuery :) Thank you very much for any help.
[jQuery] Re: Can I make jquery not fail silently??
Richard is exactly correct IMO. The separation of HTML and Javascript allows you do write more general javascript in attached scripts that can be applied to any page. $('img.ihover').hover( /* Do stuff */ ); Any pages with image class=ihover will get the hover function. Nothing will happen on pages with NO images that fit that criteria. At any time you MUST have a result, you can do something like this: var imgs = $('img.ihover'); if (!imgs.length) { alert('No hover images found!'); } It leaves it up to the developer to decide which selections are required and which arent. This isn't a flaw at all, it is part-and-parcel to the jquery philosophy: 1. Grab some elements 2. Do something to them. JK From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Richard D. Worth Sent: Wednesday, November 05, 2008 8:22 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Can I make jquery not fail silently?? On Wed, Nov 5, 2008 at 10:08 AM, brian [EMAIL PROTECTED] wrote: It's not a failure to run a query and find nothing - that's a perfectly valid use case. I understand where you are coming from on the querying side, but shouldn't calling a method on an empty object fail? How can I fade in...nothing? The same way you can write a for-loop to loop over every item in an array of integers and sum their values all together. If the array you provide to the loop has a length 0, your sum is zero. Does that mean your loop should fail because it went through 0 iterations? You can read it as Fade in any elements that match this query at this time. I'm going to still think of this as a huge design flaw. I have to disagree on this being a design flaw. This is one of my favorite design features of jQuery. I often think of it like SQL. You might construct a SQL statement like DELETE FROM tblUsers WHERE userid = 18 or UPDATE tblUsers SET age=5 WHERE age=4 If no records match the query, nothing happens. But that doesn't make the query or the statement invalid. Neither do you get an exception/warning. So the $(selector) part of jQuery is like the WHERE clause, and the method you call is like the DELETE, or UPDATE, SET. Wouldn't the alternative be that you would have to check the length of the jQuery object before every single method call? - Richard
[jQuery] Re: Trying to grasp basics of scrolling a TBODY
Cool, Glad you got it sorted out. JK From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Downs Sent: Wednesday, November 05, 2008 5:06 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Trying to grasp basics of scrolling a TBODY Jeffrey Kretz wrote: Ken, Do you have a test case page online somewhere I could take a look at? I've successfully implemented a scrollTo-type function using offsets and rows, and if I can see the page you're working with I might be able to suggest something. Jeffrey, thanks but I actually figured it out. I made up a simple test, which I'll be happy to post probably tomorrow. What I realized is that there were a few more steps than I thought. I had figured that a TR would get an offset() automatically with respect to its TBODY. Instead I found I had to get the offset() (or position, I forget which one) for several items, and do a little arithmetic to get the position of the TR relative to its TBODY. Once I figured that out the remaining arithmetic was fairly straightforward. Also I realized I had to take into account the height of the TR, otherwise I would scroll to the top of it and it would still be invisible :) JK From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Downs Sent: Sunday, November 02, 2008 3:58 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Trying to grasp basics of scrolling a TBODY Dan Switzer wrote: Ken, I'm trying to grasp the basics of scrolling to a particular row in a TABLE. Let's say you've got a TABLE, with a TBODY that has a fixed height and overflow: scroll. It appears I ought to be able to use core functions like offset() and scrollTop() to work out where a row is and scroll the TBODY to that position, but lots of trial and error has left me lost on why these things don't seem to work as I expect. The particular case I am looking at involves the user using arrow keys to navigate up and down. Its easy enough to use .next() to highlight the next row, but if a user keeps doing it, and the next row is below the viewable scroll region, I need to be able to slide up the display to show the highlighted row. This is an educational venture, not a practical one, I'd like to understand it myself, not find and use a plugin that does it already. Scrolling with the TBODY tag is spotty. IE6 doesn't support it at all--you need to place your table in a DIV that has a fixed height and overflow set to scroll. Thankfully I have no interest in IE 6 :) I currently have the DIV system you describe. My best construction of why it does not work is this: 1) There is a div that represents TBODY. It has clear:both as a CSS row 2) Each row is a div inside of the TBODY div 3) Each cells must be a div, firefox does not support widths on spans (don't know about IE, doesn't matter if firefox won't do it) 4) The cells must be float: left 5) ...and at the end I get .offset() returning meaningless numbers for the row divs. All divs in the body return 0 as the offset. 6) For good measure, the .scrollTo() extension does not work at all on this simulated TABLE, which I suspect is related to these bogus numbers. 7) I *think* the clear:both on the tbody div is causing this, but I really don't know So I monkeyed up a TABLE by hand and found all of the .offset() and related functions appear to be giving real results, I just can't quite connect the dots on how to put it all together. FWIW, the only reason I used the entire simulated TABLE was because IE 7 does not support onclick() on a TR. But I can just as well put the onclick on TD elements and get where I need to go using a TABLE, if only I could connect the dots on the scrolling stuff. I'm not sure what browsers you're targeting, but if IE6 was one you were having problems with, this is why. -Dan -- Kenneth Downs Secure Data Software, Inc. www.secdat.comwww.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -- Kenneth Downs Secure Data Software, Inc. www.secdat.comwww.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010
[jQuery] Re: Advice on sIEve/Drip?
Thanks a bunch for that link, also Josh for your advice. After running this leak detector, nothing found as well. Also, the 300MB leak hasn't recurred since that one time. My current best guess is that the leaks occurred while I was debugging javascript code and refreshing the page -- so the leaks were probably due to bad code since fixed. But since it was the same browser session refreshed again and again, leaked DOM memory wasn't reclaimed until I closed and re-opened the browser. Anyway, I'll keep an eye on it, but I've got some good tools to help, and jQuery is itself excellent at GC anyway so I hopefully won't run into a problem. Thanks again, JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of trixta Sent: Wednesday, November 05, 2008 6:15 AM To: jQuery (English) Subject: [jQuery] Re: Advice on sIEve/Drip? On Nov 4, 12:20 am, Jeffrey Kretz [EMAIL PROTECTED] wrote: OUCH. With over 25,000 lines of javascript code (full featured CMS) that's a nightmare to track down. Am I out of luck? Are there no other alternative tools like sIEve that are still in development? Hi, there is another tool by microsoft, you can try: http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx but this tool doesn´t find all memory leaks. this jquery-related info could be helpfull, too: http://groups.google.com/group/jquery-dev/browse_thread/thread/4a99f6e9b2e33 057/30099a04db7f87b9 http://www.outsidethediv.com/2008/10/removechild-vs-the-garbage-bin/ One last advice. You don´t have to fix all memory leaks in IE6. It really depends on the cost-benefit-ratio (hard effort/work to fix it vs. noticeable advancement for the enduser). regards alex
[jQuery] Re: Can I make jquery not fail silently??
Heh. I like that -- the Code Jihad. I agree 100% about failing silently being a BAD THING(tm). However, our disagreement involves what constitutes a fail. The only thing we've been trying to say is, an empty result set is only a fail under certain circumstances. To define an empty result set is a fail EVERY TIME is to limit the underlying system. Going back to the SQL analogy -- I have a data layer that performs a delete like this: DELETE FROM Table WHERE PrimaryKey = @KeyValue SELECT @RowCount = @@ROWCOUNT The app that calls the delete function will get a return value of how many rows were deleted. Maybe 0 rows is a fail, maybe it isn't. It depends on what I'm trying to do. I have a choice to fail the program after the delete. It would be wrong to require a SQL Exception thrown on every case of 0 rows deleted. Savvy? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: Wednesday, November 05, 2008 11:24 AM To: jQuery (English) Subject: [jQuery] Re: Can I make jquery not fail silently?? I have a personal jihad against apps that fail silently. My jihad listens to no reason. Sure, they have valid points that make sense from the viewpoints they hold. I don't share their viewpoints. OK? Can we lighten up now? On Nov 5, 1:13 pm, ricardobeat [EMAIL PROTECTED] wrote: That 'religious' bit is a bit offensive don't you think? There are good reasons for failing silently as Mike, Richard and Jeffrey have pointed out. The fact you don't accept/understand them doesn't make their (and mine) opinions less empirical. - ricardo On Nov 5, 5:10 pm, brian [EMAIL PROTECTED] wrote: Now $('#non-existing-id').fail().toggle() will fail, but will work if it's not empty. That's actually right on the money. Thanks. //Still thinks fail silently on id queries is insane, but knows a religious argument when he sees one.
[jQuery] Re: Problems with the JSON return from the jQuery.ajax() method
Your second documentos array (the empty one), has a comma after it, which is not followed by another property. When I tried to eval your original json, I got an error. After removing that comma, it eval'ed correctly. Hope this helps. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Augusto TMW Sent: Wednesday, November 05, 2008 1:56 PM To: jQuery (English) Subject: [jQuery] Re: Problems with the JSON return from the jQuery.ajax() method Hi, thanks about your answer. This is a example of my JSON: {mes:{ numero:11, ano:2008, reunioes: [ { dia:27, horario:15:50, local:lorem ipsum, titulo:Reunião 03, documentos:[ {nome:teste5,arquivo:../institucional/downloads/ teste5.pdf}, {nome:teste6,arquivo:../institucional/downloads/ teste6.pdf} ] }, { dia:23, horario:10:20, local:lorem ipsum, titulo:Reunião 04, documentos:[], } ], visitas:[ { dia:1, horario:21:15, local:lorem ipsum, titulo:Visita 01, documentos:[ {nome:teste4,arquivo:../institucional/downloads/teste4.pdf} ] }, { dia:25, horario:21:15, local:lorem ipsum, titulo:Visita 02, documentos:[ {nome:teste5,arquivo:../institucional/downloads/teste5.pdf} ] } ] }} Where I've to put the comma? Thanks very much for your help! =D Augusto TMW On Nov 5, 12:46 pm, Choan Gálvez [EMAIL PROTECTED] wrote: Hi. On Nov 4, 2008, at 10:48 PM, Augusto TMW wrote: Hi, I'm trying do return a JSON with a $.ajax() method. here is my entire function: function carregaMes(d){ if(!(_reunioes[reg+d.month+d.year])){ $.ajax({ url: reunioes.jsp, data: mes=+d.month+ano=+d.year, async: false, dataType: json, success: function(a){ _reunioes[reg+d.month+d.year] = a; } }); return _reunioes[reg+d.month+d.year]; } else { return _reunioes[reg+d.month+d.year]; } } Where _reunioes is an array in window object. In FF its ok, but in IE its return undefined. I tried to call a normal ajax and use the jQuery.httpData() method to covert my xhr into a JSON, but my IE tell me that in line where jQuery tries to convert ( data = eval((+data+)); ) has an error Indentifier, sequency or number expected. I'd bet the input is not valid JSON. Check for extra commas at the end of your JSON array definition. Best. -- Choan
[jQuery] Re: Scrolling inside a div with mousemove
Well, you could do something like this (completely untested, sorry). The hover events bind and unbind the mousemove to prevent resource drain. $('#thisdiv').hover(startScroll,stopScroll); function startScroll(e) { var div = $(this).bind('mousemove',scrollThis); var o = div.offset(); this.tempPosition = { left:o.left, top:o.top, right:o.left+div.width(), bottom:o.top+div.height(), scrollOffsetX:this.scrollWidth-this.clientWidth, scrollOffsetY:this.scrollHeight-this.clientHeight, }; } function stopScroll(e) { $(this).unbind('mousemove').removeAttr('tempPosition'); } function scrollThis(e) { // Use the e.clientX and e.clientY vs this.tempPosition // to determine how much to move the scrollbars according // to your tastes. this.scrollTop = setTop; this.scrollLeft = setLeft; } -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dan Sent: Wednesday, November 05, 2008 2:56 PM To: jQuery (English) Subject: [jQuery] Scrolling inside a div with mousemove Hello, I'm trying to move from MooTools over the jQuery as it seems to be a much reliable and user friendly framework. However I need to recreate something that I currently have MooTools doing but am having trouble figuring out how it would work. I'm trying to replicate the effect seen in the 'mousemove' example of this MooTools page http://demos111.mootools.net/Scroller. It doesn't need to scroll left and right but it's fine if it does, I'm quite comfortable using JavaScript but just to warn you I'm very new to jQuery :) Thank you very much for any help.
[jQuery] Re: Check if remote file exists.
That's pretty interesting -- I never thought of that. So I imagine an $.ajax({url:'somefile.dat',type:'HEAD',error:do_something}) would be enough to check for a 404. Nifty. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Karl Rudd Sent: Wednesday, November 05, 2008 4:33 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Check if remote file exists. What you want is a HEAD request. See the following for details: http://www.jibbering.com/2002/4/httprequest.html http://www-128.ibm.com/developerworks/web/library/wa-ajaxintro3/ Karl Rudd On Thu, Nov 6, 2008 at 5:54 AM, Genu [EMAIL PROTECTED] wrote: Is it possible to use jquery to check of remote file (url) exists or not. For example, I have this url: http://www.myserver.com/media/test.mp3 can I use a jquery http request to see if the url is valid or not?
[jQuery] Re: Slide out sidebars
Try something like this: div.toolbox{ position:absolute; top:0px; right:0px; width:220px; height:99%; border-left:solid 1px #00; overflow:hidden overflow-x:hidden; overflow-y:hidden; } Monitor the resize event. window.lastWidth = $(window).bind('resize',adjustToolbox).width(); function adjustToolbox(e) { var width = $(window).width(); if (width1024 window.lastWidth=1024) { $('div.toolbox') .animate({width:6}) .hover(slideTool,unslideTool); } else if (width=1024 window.lastWidth1024) { $('div.toolbox') .animate({width:220}) .unbind('mouseenter') .unbind('mouseleave'); } window.lastWidth = width; } function slideTool(e) { $(this).animate({width:220}); } function unslideTool(e) { $(this).animate({width:6}); } You can use the blockUI plugin to grey out the screen while the tool is out. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Taco Sent: Wednesday, November 05, 2008 3:38 PM To: jQuery (English) Subject: [jQuery] Slide out sidebars I am attempting to design a site with a central liquid area, and two side areas that provide auxiliary information. When the browser window is made smaller and the viewport is reduced below 1024 px, I want these side areas to slide into a minimized position showing different xhtml files. when they are moused over, I'd like them to slide out to their original size OVER the main area, and graying out the main area. How would I get started? I am not a complete newbie at javascript, but this will be my first experience with jQuery. Can someone point me in the right direction? I appreciate it. Ty Underwood
[jQuery] Re: order of script not right (explained inside)
My guess is it's an absolutely positioned element, which won't respond well to auto margins. If this is the case, one option would be to measure the width of the window at the time of drop-down, calculate and set the css left appropriately. If it is a static/relatively positioned element, and auto margin isn't working, I'm not sure what the problem might be. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of FastNOC Sent: Wednesday, November 05, 2008 9:06 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: order of script not right (explained inside) OK hopefull this is the last question. I need this to be smaller. the script takes up the whole width because the css specifies 100%. So i shortened it to 980, the width of my page. But I want it centered. it aligns left. text-align:center centeres the text within the div, not the whole panel, and margin-right:auto;margin-left:auto does nothing. Any thought on how to center this? -- View this message in context: http://www.nabble.com/order-of-script-not-right-%28explained-inside%29-tp203 35896s27240p20355237.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Bug in IE7 - Complains about Opera bindReady code in jquery
Fair enough. If you have a test case online, I'd be happy to step through the code in debug mode. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gregoriusness Sent: Wednesday, November 05, 2008 7:17 PM To: jQuery (English) Subject: [jQuery] Re: Bug in IE7 - Complains about Opera bindReady code in jquery IE7 is failing when that code block is not commented out. Whether or not IE is trying to execute the code (and the browser detection failing) i'm not quite sure about... I haven't had the time to look into it any further, just flagging it as a potential issue. On Nov 4, 10:25 am, Jeffrey Kretz [EMAIL PROTECTED] wrote: This is a bit confusing. Is IE7 running that block of code, even though its earmarked for Opera? Like is the browser detection is failing? Or is IE7 failing when that code is there even though it never runs it? Meaning, the bug went away when you commented out code that is never reached? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gregoriusness Sent: Monday, November 03, 2008 2:31 PM To: jQuery (English) Subject: [jQuery] Bug in IE7 - Complains about Opera bindReady code in jquery hey all, I initially posted this on the developer forum, but not sure if that was the best place for it so reposting here. I've got an issue with jQuery in IE7. It is throwing the following error: Line: 2355 Error: Object doesn't support this property or method Looking at jquery source (v1.2.6), on that line is the Opera condition for the bindReady() event, ie: if ( jQuery.browser.opera ) document.addEventListener( DOMContentLoaded, function () { if (jQuery.isReady) return; for (var i = 0; i document.styleSheets.length; i++) if (document.styleSheets[i].disabled) { setTimeout( arguments.callee, 0 ); return; } // and execute any waiting functions jQuery.ready(); }, false); If i comment out this block of code, all works fine (even in opera). is this a known bug? is there a workaround (besides what i've done)?? thanks heaps greg
[jQuery] Re: Advice on sIEve/Drip?
I figured I'd bring this up again - I'm really hoping someone here has some advice for me on this. Buehler? JK From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Kretz Sent: Friday, October 31, 2008 4:56 PM To: jquery-en@googlegroups.com Subject: [jQuery] Advice on sIEve/Drip While debugging my application (which makes heavy use of jQuery), after several hours IE had consumed about 300MB. So I figure I've got some memory leaks. I tried sIEve 0.8 and wasn't able to find anything specific that was leaking or causing problems. I tried the system, dragged things around, opened various popups, etc. Basically used a while series of functions on the CMS. No leaks reported at any time. I then pulled up one of heavier js pages and put it auto-refresh for about 10 minutes. It slowly went from 61MB to 66MB over a 10 minute period. At no point during the auto-refresh, or during the other stages when I was actually using the system, dragging things around, etc. were any specific leaks reported. Are there other actions I can take to track down the problem? I noticed that sIEve/Drop hasn't been updated in over 2 years, so I'm guessing it's not a maintained project. Is there a better alternative? JK
[jQuery] Re: Advice on sIEve/Drip?
OUCH. With over 25,000 lines of javascript code (full featured CMS) that's a nightmare to track down. Am I out of luck? Are there no other alternative tools like sIEve that are still in development? Arrgh. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mattkime Sent: Monday, November 03, 2008 1:16 PM To: jQuery (English) Subject: [jQuery] Re: Advice on sIEve/Drip? I found that using sIEve wasn't that much more useful than just watching IE memory usage. Your code leaks even if you can't figure out where it is. I traced down my own leaks by running suspect functions 1,000s of times. --matt On Nov 3, 3:38 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I figured I'd bring this up again - I'm really hoping someone here has some advice for me on this. Buehler? JK From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Kretz Sent: Friday, October 31, 2008 4:56 PM To: jquery-en@googlegroups.com Subject: [jQuery] Advice on sIEve/Drip While debugging my application (which makes heavy use of jQuery), after several hours IE had consumed about 300MB. So I figure I've got some memory leaks. I tried sIEve 0.8 and wasn't able to find anything specific that was leaking or causing problems. I tried the system, dragged things around, opened various popups, etc. Basically used a while series of functions on the CMS. No leaks reported at any time. I then pulled up one of heavier js pages and put it auto-refresh for about 10 minutes. It slowly went from 61MB to 66MB over a 10 minute period. At no point during the auto-refresh, or during the other stages when I was actually using the system, dragging things around, etc. were any specific leaks reported. Are there other actions I can take to track down the problem? I noticed that sIEve/Drop hasn't been updated in over 2 years, so I'm guessing it's not a maintained project. Is there a better alternative? JK
[jQuery] Re: Bug in IE7 - Complains about Opera bindReady code in jquery
This is a bit confusing. Is IE7 running that block of code, even though its earmarked for Opera? Like is the browser detection is failing? Or is IE7 failing when that code is there even though it never runs it? Meaning, the bug went away when you commented out code that is never reached? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gregoriusness Sent: Monday, November 03, 2008 2:31 PM To: jQuery (English) Subject: [jQuery] Bug in IE7 - Complains about Opera bindReady code in jquery hey all, I initially posted this on the developer forum, but not sure if that was the best place for it so reposting here. I've got an issue with jQuery in IE7. It is throwing the following error: Line: 2355 Error: Object doesn't support this property or method Looking at jquery source (v1.2.6), on that line is the Opera condition for the bindReady() event, ie: if ( jQuery.browser.opera ) document.addEventListener( DOMContentLoaded, function () { if (jQuery.isReady) return; for (var i = 0; i document.styleSheets.length; i++) if (document.styleSheets[i].disabled) { setTimeout( arguments.callee, 0 ); return; } // and execute any waiting functions jQuery.ready(); }, false); If i comment out this block of code, all works fine (even in opera). is this a known bug? is there a workaround (besides what i've done)?? thanks heaps greg
[jQuery] Re: Trying to grasp basics of scrolling a TBODY
Ken, Do you have a test case page online somewhere I could take a look at? I've successfully implemented a scrollTo-type function using offsets and rows, and if I can see the page you're working with I might be able to suggest something. JK From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Downs Sent: Sunday, November 02, 2008 3:58 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Trying to grasp basics of scrolling a TBODY Dan Switzer wrote: Ken, I'm trying to grasp the basics of scrolling to a particular row in a TABLE. Let's say you've got a TABLE, with a TBODY that has a fixed height and overflow: scroll. It appears I ought to be able to use core functions like offset() and scrollTop() to work out where a row is and scroll the TBODY to that position, but lots of trial and error has left me lost on why these things don't seem to work as I expect. The particular case I am looking at involves the user using arrow keys to navigate up and down. Its easy enough to use .next() to highlight the next row, but if a user keeps doing it, and the next row is below the viewable scroll region, I need to be able to slide up the display to show the highlighted row. This is an educational venture, not a practical one, I'd like to understand it myself, not find and use a plugin that does it already. Scrolling with the TBODY tag is spotty. IE6 doesn't support it at all--you need to place your table in a DIV that has a fixed height and overflow set to scroll. Thankfully I have no interest in IE 6 :) I currently have the DIV system you describe. My best construction of why it does not work is this: 1) There is a div that represents TBODY. It has clear:both as a CSS row 2) Each row is a div inside of the TBODY div 3) Each cells must be a div, firefox does not support widths on spans (don't know about IE, doesn't matter if firefox won't do it) 4) The cells must be float: left 5) ...and at the end I get .offset() returning meaningless numbers for the row divs. All divs in the body return 0 as the offset. 6) For good measure, the .scrollTo() extension does not work at all on this simulated TABLE, which I suspect is related to these bogus numbers. 7) I *think* the clear:both on the tbody div is causing this, but I really don't know So I monkeyed up a TABLE by hand and found all of the .offset() and related functions appear to be giving real results, I just can't quite connect the dots on how to put it all together. FWIW, the only reason I used the entire simulated TABLE was because IE 7 does not support onclick() on a TR. But I can just as well put the onclick on TD elements and get where I need to go using a TABLE, if only I could connect the dots on the scrolling stuff. I'm not sure what browsers you're targeting, but if IE6 was one you were having problems with, this is why. -Dan -- Kenneth Downs Secure Data Software, Inc. www.secdat.comwww.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010
[jQuery] Re: Advice on sIEve/Drip?
*bump* From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Kretz Sent: Friday, October 31, 2008 4:56 PM To: jquery-en@googlegroups.com Subject: [jQuery] Advice on sIEve/Drip While debugging my application (which makes heavy use of jQuery), after several hours IE had consumed about 300MB. So I figure I've got some memory leaks. I tried sIEve 0.8 and wasn't able to find anything specific that was leaking or causing problems. I tried the system, dragged things around, opened various popups, etc. Basically used a while series of functions on the CMS. No leaks reported at any time. I then pulled up one of heavier js pages and put it auto-refresh for about 10 minutes. It slowly went from 61MB to 66MB over a 10 minute period. At no point during the auto-refresh, or during the other stages when I was actually using the system, dragging things around, etc. were any specific leaks reported. Are there other actions I can take to track down the problem? I noticed that sIEve/Drop hasn't been updated in over 2 years, so I'm guessing it's not a maintained project. Is there a better alternative? JK