[jQuery] Re: Script to keep draggable windows in the main window not working?
I'm completely guessing but i think these lines might be the problem: newTop= window.height - $(this).outerHeight(); newLeft= window.width - $(this).outerWidth(); maybe try: newTop= $(window).height() - $ (this).outerHeight(); newLeft= $(window).width() - $(this).outerWidth (); Good luck pd On Nov 12, 1:24 pm, CodingCyborg [EMAIL PROTECTED] wrote: I have a script to keep the draggable windows from leaving the main window they are in. When I comment out the code everything else works perfectly. But if I allow this code to be included, not everything loads, the windows won't move, but nothing shows up in error console. jQuery(document).mousemove(function(){ $('.draggableWindow').each(function(){ if(parseInt($(this).css(top)) 0){ $(this).css(top, 0); } if(parseInt($(this).css(left)) 0){ $(this).css(left,0); } newTop= window.height - $(this).outerHeight(); newLeft= window.width - $(this).outerWidth(); if(parseInt($(this).css(top)) newTop){ $(this).css(top, newTop); } if(parseInt($(this).css(left)) newLeft){ $(this).css(left, newLeft); } } }); Not sure whats messing it up. I've tried changing a few parts of it to no prevail. Help is appreciated. -CodingCyborg
[jQuery] Proposal: new method for determining variables without value
Hi All This idea by James Edwards seems like a winner and an ideal candidate for a new jQuery core utility method: http://www.sitepoint.com/blogs/2008/10/16/techy-treasures-1/ Obviously his choice of name conflicts with the jQuery .empty() method however another name could be used such as: hasValue() This method would simply return a boolean response. What does everyone think? pd
[jQuery] Re: This jQuery mailing list
I posted a message today and it has not appeared yet. In fact nothing has appeared in the last 10 hours. John have you tightened the control of the list? Is it now more heavily moderated than in the past? pd On Nov 12, 5:06 am, herbasher [EMAIL PROTECTED] wrote: I read somewhere that the jQuery mailing list was supposed to be really active. I haven't really seen a sign of that, which makes me wonder. Has the community seen it's days? Is it a safe bet to develop with jQuery - will it be supported for a couple of years by an active community? Thanks, Herb
[jQuery] Re: This jQuery mailing list
Ooops, sorry all. It seems the group home page is now sorting a little differently. I thought I should see my message at the top but it appears sorted on popularity now? On Nov 13, 1:15 am, pd [EMAIL PROTECTED] wrote: I posted a message today and it has not appeared yet. In fact nothing has appeared in the last 10 hours. John have you tightened the control of the list? Is it now more heavily moderated than in the past? pd On Nov 12, 5:06 am, herbasher [EMAIL PROTECTED] wrote: I read somewhere that the jQuery mailing list was supposed to be really active. I haven't really seen a sign of that, which makes me wonder. Has the community seen it's days? Is it a safe bet to develop with jQuery - will it be supported for a couple of years by an active community? Thanks, Herb
[jQuery] Safari Mac fatal error
Hi All Had some trouble today with Safari on a crApple. Thought I should pass it on in case anyone else suffers a similar fate and wants to keep what hair they have (if any) on their heads. This is a case of one browser being significantly more strict than several others. So strict it stops loading the script code when it incurs this error whereas - rightly or wrongly - most other browsers cope with the problem which is: duplicate function names Now come on, confess, what coder doesn't make liberal use of the old copy/paste? In this case one section of jQuery code was copied and the function names were not changed so they became unique. A cut down example: $(document).ready( function () { field1.click( function somename () { // do something } ); field2.click( function somename () { // do something } ); } ); This code will fail on Safari Mac 2.0.4 (419.3) due to the duplicated somename function however **does not fail** on Safari Win 3.0.3 (522.15.5) Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2pre) Gecko/ 2007110805 Minefield/3.0b2pre Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/ 20071025 Firefox/2.0.0.9 IE Win 6.0.2900.2180.xpsp_sp2_gdr.070227-2254 IE Win 7.0.5730.11 For the record I understand that this code should probably break every time, but since the majority of mainstream browsers do not force this code to break, consistency is better than idealism in cross browser coding, I think :) t a g s safari-only, fatal, function, duplicate, names, namespaces, mac, 2.0.4
[jQuery] hasLayout question
Hello This is a CSS question more than a jQuery one. I hope people don't mind. Using the IE Developer Toolbar version 1.00.2188.0 when I try to check the value of the hasLayout property of an element, I invariably get -1. What does this value mean? Generally speaking I thought a value of -1 in a preference context means no value has been set, or the value is auto. I'd really appreciate if anyone could give me their experiences of what values the IE Dev Toolbar shows and their corresponding real- world meaning. pd
[jQuery] $(document).ready window.history.back() bug?
Hi All Not sure if this should go straight to the dev list so trying here first. I've just spent two hours debugging a strange issue where the following triggers the back function and ignores the contents of the if condition: $(document).ready( function () { if (window.history.back()) { $('td.dynamicBackButton').addClass('txtAlignRight'); $('.dynamicBackButton').append('button tabindex=-1 type=button onclick=window.history.back()lt Back/button'); } } ); Is this a bug?
[jQuery] Re: $(document).ready window.history.back() bug?
Hi yeah sorry I only realised the logic you point out immediately after posting. pd On Aug 21, 12:08 pm, Stephan Beal [EMAIL PROTECTED] wrote: On Aug 21, 3:58 am, pd [EMAIL PROTECTED] wrote: Not sure if this should go straight to the dev list so trying here first. I've just spent two hours debugging a strange issue where the following triggers the back function and ignores the contents of the if condition: $(document).ready( function () { if (window.history.back()) { Umm... window.history.back() loads a new page (well, an arbitrarily different page), so it probably doesn't return at all, much less keep running a code block from a page other than the one which is now loaded/loading. Is this a bug? i can't imagine that it is. Calling back() is similar to using GOTO - you send flow control somewhere completely different at that point.
[jQuery] Documentation on $('#foo')[0] or $('#foo').get(0) ??
Hi All I've been hacking with jQuery on and off lately and I've now hit the annoying problem of not being able to access simple DOM 0 properties unless, apparently, using either of the following syntaxes: $('#foo')[0] $('#foo').get(0) Eventually after scratching my head each time, I've found this syntax answer again. However is this documented? I really find the jQuery documentation very handy but I do not remember seeing this crucial information within it. It seems from searching this group, I'm not the only person who perceives jQuery methods to provide additional functionality above JavaScript, but to still allow access to the simple properties we are all familiar with. If this is not the case, and it doesn't seem to be, these and other syntax 'shortcuts' really should be documented and very obviously at that, shouldn't they? I can access the wiki and I'm happy to add this information though I am not convinced I have a complete 'handle' on it. pd
[jQuery] Re: Fwd: jQuery and UTF8
I can't be sure this will help, but does your server side script return the document with specifically with a utf8 charset header? On Aug 16, 8:05 am, barophobia [EMAIL PROTECTED] wrote: I'm forwarding this email again as it seems that it may not have made its way to the list the first time. -- Forwarded message -- From: barophobia [EMAIL PROTECTED] Date: Tue, 14 Aug 2007 20:02:52 -0700 Subject: jQuery and UTF8 To: jquery-en@googlegroups.com Hello, I've got some Japanese text in my MySQL database that shows up correctly through phpMyAdmin as well as when it is loaded directly as HTML. However, when I load it through .load() it only shows up as question marks. Is there an obvious solution? I couldn't find any good info on jQuery and UTF8 when searching. Also, when I try to add Japanese through AJAX it is saved in correctly in the db (as well as returned) as things like %uD0A4%uC544. It works fine when I enter foreign languages through a regular form and no AJAX. Thanks, Chris.
[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??
Hi All, Thanks for the responses. Firstly, everyone is assuming I am referring to an array. Not necessarily the case. In fact in a legit XHTML 1.0 Strict document an id is supposed to be unique is it not? My example used the # to refer to a unique id on the page, therefore *not* an array of objects. Secondly my question is, in part, not so much about the worth, speed, friendliness of this code, but whether it's clearly documented. Perhaps I am merely experiencing the simplicity of jQuery's design and expecting it to extend further than it can? Perhaps not. I don't understand (and I am more than willing to suggest it might be my lack of understanding here that is the issue) why Example A (below) and Example B (more efficient but same example) should work, but Example C does not. Example A document.getElementById('foo').selectedIndex; document.getElementById('foo').nodeName; document.getElementById('foo').className; document.getElementById('foo').nodeType; document.getElementById('foo').blahProperty; document.getElementById('foo').exampleProperty; Example B var fooObject = document.getElementById('foo'); fooObject.selectedIndex; fooObject.nodeName; fooObject.className; fooObject.nodeType; fooObject.blahProperty; fooObject.exampleProperty; Example C $('#foo').selectedIndex; $('#foo').nodeName; $('#foo').className; $('#foo').nodeType; $('#foo').blahProperty; $('#foo').exampleProperty; Please don't jump on the properties I've picked, they are just taken from Firebug and merely illustrative. AFAIK all three examples get an element on the page as a *single* (not an array) object. I think it's reasonable (though perhaps not programmatically correct) to see $('#foo') as the equivalent of document.getElementById('foo'). If this is not true in jQuery, which it does not appear to be, all I am saying is this distinction should be clearly documented. In an ideal world, I think it would rock to have a syntax like this: $('#foo').anyProperty; // for normal 'old school' DOM properties $('#foo').jQueryMethod(); // for jQuery methods However I'm not pretending to know the level of JS that the great Mr John Resig knows. If the ideal world syntax is not possible or if people don't like it, fair enough. Again my point is that there may be a need for this topic to be documented, that's all I'm saying. Personally I'll probably never forget again after this experience! pd On Aug 16, 3:43 am, Michael Geary [EMAIL PROTECTED] wrote: From: pd I've been hacking with jQuery on and off lately and I've now hit the annoying problem of not being able to access simple DOM 0 properties unless, apparently, using either of the following syntaxes: $('#foo')[0] $('#foo').get(0) pd, just to help clarify... The $() function returns an array of DOM elements. You access elements of an array, of course, by using [n]. I don't know if I would call this an annoying problem, it's just the way it is. Imagine this code: var myArray = [ document.getElementById('foo'), document.getElementById('goo') ]; Now you have an array of two elements, [0] and [1], and each element is a reference to a DOM element. If you want the first element of the array, you would use: myArray[0] And you could access DOM properties with: alert( myArray[0].id ); // alerts 'foo' Or you could do: var firstElement = myArray[0]; alert( firstElement.id ); // alerts 'foo' What you couldn't do: alert( myArray.id ); // alerts undefined After all, myArray is not a DOM element, it's an *array* of DOM elements. A jQuery object returned by $() is no different. Whenever you see $(), think array of DOM elements. (Well, it is slightly different - it is not an actual JavaScript Array object, but it does have .length and [n] properties so it works like an array for these purposes.) -Mike
[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??
Thanks Eric I'll remember to consider jQuery selector results an array from now on. So, do you feel like updating the wiki? Sounds like you would be the best person to do so as your understanding appears quite deep. I had a look at Mr Willison's article yesterday but only got half way through before getting distracted. Bizarre that it apparently has something related to this topic? I will have to read the whole thing, it's still open in one of my tabs for when I get the time :) pd On Aug 16, 11:27 am, Erik Beeson [EMAIL PROTECTED] wrote: id is supposed to be unique is it not? My example used the # to refer to a unique id on the page, therefore *not* an array of objects. Wrong, it *is* still an array of objects, it's just an array of length 1. Do console.log($('#foo')) and you'll see that it is still an array, and an array with one object in it is not the same as the object itself. AFAIK all three examples get an element on the page as a *single* (not an array) object. And that's wrong. The jQuery object is always an array. It's of length 0 for no matches, 1 for a single match, or more for multiple matches. That's by design, so that the chaining things work consistently. This allows you to make chained calls that won't throw an error, regardless of whether or not the selector found anything. I think it's reasonable (though perhaps not programmatically correct) to see $('#foo') as the equivalent of document.getElementById('foo'). If this is not true in jQuery, which it does not appear to be, all I Right, it's not. am saying is this distinction should be clearly documented. Agreed. This should probably be made clearer. I think the recently discussed post by Simon Willison addresses this really well (under Doing stuff with them):http://simonwillison.net/2007/Aug/15/jquery/ --Erik
[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??
Futher to this overall topic Eric, do you think it would be possible/ wise to implement a jQuery method that returns any of the standard DOM properties? I'm just wishlisting but I think this syntax (each line a different example property): $('#foo').dom('className'); $('#foo').dom('size'); $('#foo').dom('type'); would be very intuitive for developers and very consistent with the rest of the jQuery library. It seems more intuitive and consistent than: $('#foo')[0].className; $('#foo')[0].size; $('#foo')[0].type; to me, though maybe the method name of dom() is not the most clear and or explicit. It is short though :) pd On Aug 16, 11:27 am, Erik Beeson [EMAIL PROTECTED] wrote: id is supposed to be unique is it not? My example used the # to refer to a unique id on the page, therefore *not* an array of objects. Wrong, it *is* still an array of objects, it's just an array of length 1. Do console.log($('#foo')) and you'll see that it is still an array, and an array with one object in it is not the same as the object itself. AFAIK all three examples get an element on the page as a *single* (not an array) object. And that's wrong. The jQuery object is always an array. It's of length 0 for no matches, 1 for a single match, or more for multiple matches. That's by design, so that the chaining things work consistently. This allows you to make chained calls that won't throw an error, regardless of whether or not the selector found anything. I think it's reasonable (though perhaps not programmatically correct) to see $('#foo') as the equivalent of document.getElementById('foo'). If this is not true in jQuery, which it does not appear to be, all I Right, it's not. am saying is this distinction should be clearly documented. Agreed. This should probably be made clearer. I think the recently discussed post by Simon Willison addresses this really well (under Doing stuff with them):http://simonwillison.net/2007/Aug/15/jquery/ --Erik
[jQuery] use of this in jQuery selectors
Hi All Can someone clarify the use of the JavaScript keyword this in a jQuery context? I find it strange that the following code doesn't work $(this + '.requiredField') but this does $(this.id + '.requiredField') even when the object calling the code does not have an id attribute! Is there a way to mix the very handy this keyword with the sensational ability of jQuery to get an array of objects with blah class name ?
[jQuery] Iteration through multiple class attribute values
Hi All I'm trying to iterate through a DOM object's class values to develop a form validation routine. At the moment the $.each() function is treating each and every character in the class value as a separate item, instead of splitting the values into separate values based on spaces. Therefore this doesn't really work: var fieldClasses = parsedInField.className; or var fieldClasses = $(parsedInField).attr('class'); $.each( fieldClasses , function (count, clarse) { if (clarse == 'alphanum') { // blah } else if (clarse == 'numeric') { // blah } } ); Can anyone confirm if this should work? If so am I missing something? It is later on Friday afternoon down here in Australia :) Not the best of time for concentrating. Example (not so clean, sorry) is here: http://devel.webutils.vicnet.net.au/ Any help would be immensely appreciated. Thanks pd
[jQuery] Re: Iteration through multiple class attribute values
Thanks Erik. This situation has got me all muddled. Where you wrote string is an array of elements I thought I was misreading something! I need a good night's sleep or ten and a clear mind :) Thanks again On Jul 27, 4:49 pm, Erik Beeson [EMAIL PROTECTED] wrote: each iterates over the elements of a given array. Since a string is an array of characters (try alert(bar[1]) if you don't believe it), each is iterating over each character. Maybe try splitting the classes on space characters? Maybe something like this: $.each(foo.className.split(' '), ...); --Erik On 7/26/07, pd [EMAIL PROTECTED] wrote: Hi All I'm trying to iterate through a DOM object's class values to develop a form validation routine. At the moment the $.each() function is treating each and every character in the class value as a separate item, instead of splitting the values into separate values based on spaces. Therefore this doesn't really work: var fieldClasses = parsedInField.className; or var fieldClasses = $(parsedInField).attr('class'); $.each( fieldClasses , function (count, clarse) { if (clarse == 'alphanum') { // blah } else if (clarse == 'numeric') { // blah } } ); Can anyone confirm if this should work? If so am I missing something? It is later on Friday afternoon down here in Australia :) Not the best of time for concentrating. Example (not so clean, sorry) is here: http://devel.webutils.vicnet.net.au/ Any help would be immensely appreciated. Thanks pd
[jQuery] Re: ContextMenu plugin r2 released!
It appears this plugin can ignore the Firefox preference under Tools - Options - Content - Enable Javascript - Advanced, Allow JavaScript to Disable or replace context menus. Are you aware of this? Is this deliberate? Do you think that's a good idea to take the control away from the user? FWIW from a developer point of view I like the idea of having this much control at my disposal however there's always the possibility Mozilla might tighten up the code governing the above mentioned preference, rendering any site using this plugin compromised functionality wise, wouldn't it? From a user's viewpoint, don't know it's a great idea. Nefarious websites could re-use your code to exploit people. I understand this is a grey area and I'm not having a go at anyone, just wondering about the topic. pd On Jul 16, 1:05 pm, cdomigan [EMAIL PROTECTED] wrote: Version r2 of the ContextMenu plugin has been released. ContextMenu is a lightweight jQuery plugin that lets you selectively override the browser's right-click menu with a custom one of your own. You can download it here:http://www.trendskitchens.co.nz/jquery/contextmenu/ ContextMenu is now truly context-sensitive, allowing you to enable/ disable individual items depending on the context, or you can choose dynamically to hide the menu. Changes in this version: * $.contextMenu.defaults() now works correctly * onContextMenu, onShowMenu callbacks added (thanks Dan G. Switzer, II) * drop shadow! Plus a few other changes and bug-fixes. Seehttp://www.trendskitchens.co.nz/jquery/contextmenu/ for full changelog and documentation. r3 is currently in the works with support for nested menus, a much requested feature :) As always comments/bug reports are much appreciated! Cheers, Chris
[jQuery] dimensions plugin documentation
Hello Apologies if I've missed something simple but I can't seem to find simple documentation for dimensions.js other than that inside the actual file. I need a bit more than that. Am I missing something or is this plugin lacking a bit of documentation (no doubt due to over-worked, over-stressed developers, which is understandable)?
[jQuery] PNG hack that works for repeated background images?
Hello I've been trying to implement this 'plugin' 'hack': http://khurshid.com/jquery/iepnghack/ to get a repeated background effect in IE6 and decent browsers. It appears this plugin does not work with repeated background PNG images. Instead the image is shown just once. Can anybody confirm this as a limitation/bug? Does anyone have an alternative hack (preferably jQuery based) that can achieve repeated background PNG images?
[jQuery] Re: Can JQuery do this?
Might want to try the .empty() method, on the div containing the image, before you load in the next one. http://docs.jquery.com/DOM/Manipulation#empty.28.29 On Jun 4, 4:47 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm pretty sure it can since jquery is so sweet, but here's what I am trying to do: I have a page (call it generator.cfm) that pulls random pictures from a database. I want a button or link I can click on and have it pull from that url, and display in the div or whatever. pretty simple ajax stuff. But the tricky part is if I continue to click on the button it doesnt replace the existing picture, it just appends on the next picture to the list each time the button is clicked. Any of you guru's care to help me figure this out?
[jQuery] Re: PNG hack that works for repeated background images?
Thanks for the suggestions Erik but with IE6 still making up a substantial market share, I'd like to cater for it as well as possible (call me a masochist, you will not get much argument!). Anyone else have a definitive answer on this one? On Jun 4, 4:53 pm, Erik Beeson [EMAIL PROTECTED] wrote: Pretty sure you don't get repeating transparent png backgrounds in IE6. Use a GIF, or a really big repeating background image, or use layers without backgrounds. Personally, I just use a GIF and have a little upgrade to make it not look like ass banner. A GIF version is easy to add with conditional comments too, so you don't have to dirty up your code with too many IE6 hacks. --Erik On 6/3/07, pd [EMAIL PROTECTED] wrote: Hello I've been trying to implement this 'plugin' 'hack': http://khurshid.com/jquery/iepnghack/ to get a repeated background effect in IE6 and decent browsers. It appears this plugin does not work with repeated background PNG images. Instead the image is shown just once. Can anybody confirm this as a limitation/bug? Does anyone have an alternative hack (preferably jQuery based) that can achieve repeated background PNG images?
[jQuery] Re: PNG hack that works for repeated background images?
Thanks everyone, absolutely great to be able to get quick accurate answers like this.
[jQuery] getting DOM values
Hi BjQ (before jQuery) I can do this: document.getElementById('foo').clientWidth to get a DOM value that Firebug tells me is set to something other than 'undefined'. I can't figure out how to the do same in AjQ (after jQuery). I've tried the following: $('#foo').attr('clientWidth') but keep getting undefined. Am I trying the wrong syntax? If so, what syntax will achieve the results I'm after?
[jQuery] CSS3 support
Hi All I know I'm dreaming and it's probably not realistic but on the front of the jQuery site is the following proclamation: CSS3 Compliant · Supports CSS 1-3 and basic XPath Should that proclamation really say CSS3 Compliant (selectors) because AFAIK jQuery doesn't appear to support any CSS3 declarations like border-radius for example. I understand there are a thousand and one whacky ways for JS to manipulate the DOM into presenting rounded corners and this is generally a bad thing in terms of separation of content and style. Has jQuery ever considered implementing one of these or are they just really too evil?
[jQuery] Re: CSS3 support
Thanks guys. On May 29, 3:06 am, Brandon Aaron [EMAIL PROTECTED] wrote: We don't support any declarations that the browser itself doesn't support. However, there are plugins (lots of them) that solve lots of different problems. There are several plugins that handle rounded corners. Here is one of them:http://www.malsup.com/jquery/corner/ -- Brandon Aaron On 5/28/07, pd [EMAIL PROTECTED] wrote: Hi All I know I'm dreaming and it's probably not realistic but on the front of the jQuery site is the following proclamation: CSS3 Compliant · Supports CSS 1-3 and basic XPath Should that proclamation really say CSS3 Compliant (selectors) because AFAIK jQuery doesn't appear to support any CSS3 declarations like border-radius for example. I understand there are a thousand and one whacky ways for JS to manipulate the DOM into presenting rounded corners and this is generally a bad thing in terms of separation of content and style. Has jQuery ever considered implementing one of these or are they just really too evil?
[jQuery] Re: datePicker v2 beta
Is there any particular reason why your plugin doesn't have an option for specifying time as well as date? I'd like to use this plugin but need time functionality. On Apr 24, 7:54 pm, Kelvin Luck [EMAIL PROTECTED] wrote: Hi, I'd like to announce the beta release of v2 of my datePicker plugin for jQuery. This release is a complete rewrite which makes the date picker considerably more powerful and flexible than it previously was. Check out the temporary project page: http://kelvinluck.com/assets/jquery/datePicker/v2/demo/ Note, this is currently in beta and may be a little rough around the edges but I'd love to get some feedback. I've tested in FF2, IE6 and Opera 9 but it would be good to know if it works in other browsers (particulaly Safari). Plus any other feedback on extra stuff you'd like adding or bugs you discover, Cheers, Kelvin :)
[jQuery] Re: Help Test jQuery 1.1.3
I've tested it and zebra striping is fine, mouseover/out highlighting is fine, getJSON is still fine as well. Tested with Fx 2.0.0.3, IE7 and IE6 (SP2) on Windows XP. On May 21, 11:29 am, John Resig [EMAIL PROTECTED] wrote: Hi Everyone - A test build of the upcoming 1.1.3 release is ready for everyone to try. We need to be super-sure that there haven't been any regressions in this release, and in order to do that we'd like you to download this alpha release and try it in place of jQuery 1.1.2 (wherever you may be using it). Download the test release: * jQuery 1.1.3a (Uncompressed, Test Release) http://code.jquery.com/jquery-1.1.3a.js Here's what you can do to help: 1. Download the test release of jQuery 1.1.3 2. Temporarily replace your copy of jQuery 1.1.2 with this test release in some of your web pages 3. If something is now broken, please submit a ticket letting us know what happened. The more specific you can be, the better (demos or test cases are highly desired). http://dev.jquery.com/newticket Note: Pay special attention to Events, Selectors, and Animations; significant changes happened in all three of those areas, so if there's any place where a regression is possible, it would be more likely to occur in there. Once we're confident that there's no new bugs, we'll be releasing jQuery 1.1.3 fully (hopefully some time this week). Thanks everyone! --John
[jQuery] Re: .ready() unreliable due to IE6 inconsistencies?
Hi John Firstly due recognition: **bowing down to the master** :) jQuery is like gold, sensational, thank you. Re jQuery Flash yes two very specific reasons, one of which I raised in the dev list after the flash plugin author suggested it seemed to be overlooked. That is the ActiveX issue with the jQuery packed version. As referred to on the jQuery Flash plugin page. Secondly it doesn't seem that the jQuery Flash plugin is as good as swfobject at detecting Flash. Despite specifying silent degradation I was getting if your browser doesn't support ... override ... text displaying in IE7. My install of IE7 is possibly flaky (beyond the default flakes built in by MS :) ) though so I'm really not sure what is going on. I'd be happy to test any tweaks to the jQuery Flash plugin if anyone would like me to. Regarding using script tags in the body of a document, I agree it's not ideal. In the end instantiating swfobject with script tags at the end of the document body worked though. Perhaps this is an indication of what you suggested regarding .ready() being a different (more tolerant?) beast now than in June 2006. Thanks for your time pd On May 14, 1:44 pm, John Resig [EMAIL PROTECTED] wrote: There's more to the story than this, however. The jQuery ready() implementation was very very different in June of 2006 (hence the problems with script elements). I think the reason why Swfobject causes problems is that it's not coded very well - hence the reason for a jQuery Flash plugin. Is there any specific reason that you're choosing not to use it? --John On 5/13/07, pd [EMAIL PROTECTED] wrote: Hi Sam Thanks for your offer of help. Thankfully my colleague and I have solved the nightmare. We recently abandoned the jQuery Flash plugin and implemented swfobject instead. Thanks to luckily searching and finding a thread on .ready() issues and from June 2006 I noticed script tags in the body were suspected to cause issues with jQuery's .ready() method. The solution? Instantiating swfobject after the last body element, not immediately after the element it is trying to replace. Moral of the story? Beware when mixing jQuery .ready() and script tags in the body of your document. On May 14, 10:57 am, Sam Sherlock [EMAIL PROTECTED] wrote: two suggestions 1. try making an isolated test with just the zebra table 2. try using an uncompressed jquery file when I first loaded the page in opera it did not stripe the table, then after reloading it did sorry to not be able to offer more than just shots in the dark, I have found opera is useful debugging ie issues (I think suggested by someone on this list) though in all browsers no errors are reported. - S On 14/05/07, pd [EMAIL PROTECTED] wrote: Hello The following site uses progressive enhancement to zebra style alternative table rows, centre some text in table cells, reveal JS- only functionality hidden by default in the style sheet, etc etc Unfortunately it appears that the $(document).ready() method we have wrapped all our onload code in, fires inconsistently inside IE6. In IE6 on Windows XP this URL: http://devel.wynlearn.net.au/calendar.cgi will not load zebra striping (on the second table), nor perform rollovers - all added with $(document).ready() - even after several reloads whereas this URL: http://devel.wynlearn.net.au/forum.cgi loads zebra striping (on the second table), centre aligns text in columns two and three and sets up rollovers **but** only after one refresh. The relevant files are: CSS defines rollovers and altRow classes: http://devel.wynlearn.net.au/style/default.css JS file containing $(document).ready() code: http://devel.wynlearn.net.au/js/WynlearnUtils.js I have swfobject onloading the top right Flash animation where clients have Flash 8 or higher. Hence if swfobject can reliably behave onload, it seems the symptoms are jQuery related. Can anyone please help?
[jQuery] .ready() unreliable due to IE6 inconsistencies?
Hello The following site uses progressive enhancement to zebra style alternative table rows, centre some text in table cells, reveal JS- only functionality hidden by default in the style sheet, etc etc Unfortunately it appears that the $(document).ready() method we have wrapped all our onload code in, fires inconsistently inside IE6. In IE6 on Windows XP this URL: http://devel.wynlearn.net.au/calendar.cgi will not load zebra striping (on the second table), nor perform rollovers - all added with $(document).ready() - even after several reloads whereas this URL: http://devel.wynlearn.net.au/forum.cgi loads zebra striping (on the second table), centre aligns text in columns two and three and sets up rollovers **but** only after one refresh. The relevant files are: CSS defines rollovers and altRow classes: http://devel.wynlearn.net.au/style/default.css JS file containing $(document).ready() code: http://devel.wynlearn.net.au/js/WynlearnUtils.js I have swfobject onloading the top right Flash animation where clients have Flash 8 or higher. Hence if swfobject can reliably behave onload, it seems the symptoms are jQuery related. Can anyone please help?
[jQuery] Re: Selectors: x td in all rows of a table
Hi Karl That's excellent, works a treat, thanks! I tried :eq(0) and :nth(0) Selects the Nth element from the matched element set from http://docs.jquery.com/Selectors#Custom_Selectors_2 without luck. I thought it was possible though and of course the simple nth-child does the trick. I was close with :nth haha. I'm surprised both textAlign and text-align work as .css() properties. That is really developer friendly, sensational. jQuery is the best thing since sliced bread. Mr Resig and colleagues are gods! On May 8, 11:10 am, pd [EMAIL PROTECTED] wrote: Hello I've looked up http://docs.jquery.com/Selectors and alas I can't determine if there is a way to select the x td of all rows of a table. The use case is that i have a table for a forum and I'd like to center text-align the 'Topics' and 'Replies' totals columns. Thanks pd
[jQuery] Re: Selectors: x td in all rows of a table
Ah, one problem Karl. Thanks again for your help though there's just one thing that I don't really understand. I was attempting to use such a selector in a site-wide $ (document).ready() context. Hence this applies to all tables which is problematic. Hence initially I was attempting the equivalent (using your example) of: $('.relevantTableClass td:nth-child(2)').css('textAlign', 'center'); and I've tried this again just now but it fails. Should a similar syntax be possible? The following works: $('#relevantTableId td:nth-child(2)').css('textAlign', 'center'); however a class-based solution would work better for me. Is this possible? Thanks pd On May 8, 11:20 am, Karl Swedberg [EMAIL PROTECTED] wrote: If I understand your situation correctly, you might be looking for :nth-child() You could, for example, get the 2nd cell of each row this way: $('td:nth-child(2)').css('textAlign', 'center'); Remember that nth-child() is the only jQuery selector that is 1- based, because it's based solely on the CSS spec. Cheers, --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 7, 2007, at 9:10 PM, pd wrote: Hello I've looked up http://docs.jquery.com/Selectors and alas I can't determine if there is a way to select the x td of all rows of a table. The use case is that i have a table for a forum and I'd like to center text-align the 'Topics' and 'Replies' totals columns. Thanks pd
[jQuery] Re: Selectors: x td in all rows of a table
Hi Karl I can't explain why but the code appears to be working as it should now. Rather strange but all is well that ends well. Thanks again for your excellent, considered and patient help. pd On May 8, 1:37 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hmmm. I'm not sure what could be causing the problem you're having with classes. I put together a simple test page using your code: $('.relevantTableClass td:nth-child(2)').css('textAlign', 'center'); inside $(document).ready and it works for me as expected:http://test.learningjquery.com/nth-child.html Let me know if that helps you pinpoint any differences in your code that might be causing the problem. Otherwise, if you could provide a link to your page, that might help us troubleshoot. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 7, 2007, at 10:15 PM, pd wrote: Ah, one problem Karl. Thanks again for your help though there's just one thing that I don't really understand. I was attempting to use such a selector in a site-wide $ (document).ready() context. Hence this applies to all tables which is problematic. Hence initially I was attempting the equivalent (using your example) of: $('.relevantTableClass td:nth-child(2)').css('textAlign', 'center'); and I've tried this again just now but it fails. Should a similar syntax be possible? The following works: $('#relevantTableId td:nth-child(2)').css('textAlign', 'center'); however a class-based solution would work better for me. Is this possible? Thanks pd On May 8, 11:20 am, Karl Swedberg [EMAIL PROTECTED] wrote: If I understand your situation correctly, you might be looking for :nth-child() You could, for example, get the 2nd cell of each row this way: $('td:nth-child(2)').css('textAlign', 'center'); Remember that nth-child() is the only jQuery selector that is 1- based, because it's based solely on the CSS spec. Cheers, --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 7, 2007, at 9:10 PM, pd wrote: Hello I've looked up http://docs.jquery.com/Selectors and alas I can't determine if there is a way to select the x td of all rows of a table. The use case is that i have a table for a forum and I'd like to center text-align the 'Topics' and 'Replies' totals columns. Thanks pd