[jQuery] Re: Notification when content was updated via AJAX
The Live Query plugin may help in this circumstance: http://plugins.jquery.com/project/livequery --Sam On Dec 1, 12:43 pm, Raphael <[EMAIL PROTECTED]> wrote: > I'm having a little problem: > There are two independent modules (I'm working in a drupal > environment). Well, one module polls a table via AJAX request and the > other module provides some services when a tr element has been > clicked. BUT: On Pageload the click event is bound to the tr element. > When the first module though polls in a new table, this table doesn't > have the click event attached. > > What I need. My second module needs to somehow know when new content > comes in via AJAX, so it can bind the click element to them. Is there > some way to accomplish this? > > Thanks > Raphael
[jQuery] Re: show many news in one screen instead of one with Newsticker
Not tested this yet, but the code would need to be tweaked. Change el.items = $("li", el); to el.items = $("> li", el); And then use lists within lists: News 1 ... News 10 News 11 ... News 20 Hope this helps. -- Sam On Oct 10, 10:44 am, RDB <[EMAIL PROTECTED]> wrote: > Hello, > I’m using Newsticker (http://www.texotela.co.uk) in my site, I would > like to know how to show multiple news per each screen instead of only > one in this plugin. > I'd like to show 10 news by 10 because of their big number. > Any idea on how to make this ? > > Thanks a lot > > Jquery code : > > > > (function($) { > /* > * A basic news ticker. > * > * @name newsticker (or newsTicker) > * @param delay Delay (in milliseconds) between iterations. > Default 4 seconds (4000ms) > * @author Sam Collett (<a rel="nofollow" href="http://www.texotela.co.uk">http://www.texotela.co.uk</a>) > * @example $("#news").newsticker(); // or $ > ("#news").newsTicker(5000); > * > */ > $.fn.newsTicker = $.fn.newsticker = function(delay) > { > delay = delay || 4000; > initTicker = function(el) > { > stopTicker(el); > el.items = $("li", el); > // hide all items (except first one) > el.items.not(":eq(0)").hide().end(); > // current item > el.currentitem = 0; > startTicker(el); > }; > startTicker = function(el) > { > el.tickfn = setInterval(function() { doTick(el) }, delay) > }; > stopTicker = function(el) > { > clearInterval(el.tickfn); > }; > pauseTicker = function(el) > { > el.pause = true; > }; > resumeTicker = function(el) > { > el.pause = false; > }; > doTick = function(el) > { > // don't run if paused > if(el.pause) return; > // pause until animation has finished > el.pause = true; > // hide current item > $(el.items[el.currentitem]).fadeOut("slow", > function() > { > $(this).hide(); > // move to next item and show > el.currentitem = ++el.currentitem % > (el.items.size()); > $(el.items[el.currentitem]).fadeIn("slow", > function() > { > el.pause = false; > } > ); > } > ); > }; > this.each( > function() > { > if(this.nodeName.toLowerCase()!= "ul") return; > initTicker(this); > } > ) > .addClass("newsticker") > .hover( > function() > { > // pause if hovered over > pauseTicker(this); > }, > function() > { > // resume when not hovered over > resumeTicker(this); > } > ); > return this; > > }; > })(jQuery); > > $(document).ready( > function() > { > $("#news").newsTicker(2000); > } > ); > > > > > > HTML code : > > > > first news > second news > third news > ... > 50th news > >
[jQuery] Re: show many news in one screen instead of one with Newsticker
Not tested this yet, but the code would need to be tweaked. Change el.items = $("li", el); to el.items = $("> li", el); And then use lists within lists: News 1 ... News 10 News 11 ... News 20 Hope this helps. -- Sam On Oct 10, 10:44 am, RDB <[EMAIL PROTECTED]> wrote: > Hello, > I’m using Newsticker (http://www.texotela.co.uk) in my site, I would > like to know how to show multiple news per each screen instead of only > one in this plugin. > I'd like to show 10 news by 10 because of their big number. > Any idea on how to make this ? > > Thanks a lot > > Jquery code : > > > > (function($) { > /* > * A basic news ticker. > * > * @name newsticker (or newsTicker) > * @param delay Delay (in milliseconds) between iterations. > Default 4 seconds (4000ms) > * @author Sam Collett (<a rel="nofollow" href="http://www.texotela.co.uk">http://www.texotela.co.uk</a>) > * @example $("#news").newsticker(); // or $ > ("#news").newsTicker(5000); > * > */ > $.fn.newsTicker = $.fn.newsticker = function(delay) > { > delay = delay || 4000; > initTicker = function(el) > { > stopTicker(el); > el.items = $("li", el); > // hide all items (except first one) > el.items.not(":eq(0)").hide().end(); > // current item > el.currentitem = 0; > startTicker(el); > }; > startTicker = function(el) > { > el.tickfn = setInterval(function() { doTick(el) }, delay) > }; > stopTicker = function(el) > { > clearInterval(el.tickfn); > }; > pauseTicker = function(el) > { > el.pause = true; > }; > resumeTicker = function(el) > { > el.pause = false; > }; > doTick = function(el) > { > // don't run if paused > if(el.pause) return; > // pause until animation has finished > el.pause = true; > // hide current item > $(el.items[el.currentitem]).fadeOut("slow", > function() > { > $(this).hide(); > // move to next item and show > el.currentitem = ++el.currentitem % > (el.items.size()); > $(el.items[el.currentitem]).fadeIn("slow", > function() > { > el.pause = false; > } > ); > } > ); > }; > this.each( > function() > { > if(this.nodeName.toLowerCase()!= "ul") return; > initTicker(this); > } > ) > .addClass("newsticker") > .hover( > function() > { > // pause if hovered over > pauseTicker(this); > }, > function() > { > // resume when not hovered over > resumeTicker(this); > } > ); > return this; > > }; > })(jQuery); > > $(document).ready( > function() > { > $("#news").newsTicker(2000); > } > ); > > > > > > HTML code : > > > > first news > second news > third news > ... > 50th news > >
[jQuery] Re: Plugin that offers smart tag-like functionality?
Thought someone might have done something like this. HTML would be something like this: Action 1 Action 2 And jQuery (kind of works, but not in IE and doesn't hide if hovering over the content and out without going over the icon first): $(smarttags); function smarttags() { $("#smarttagicon").hover( function() { $("#smarttagcontent").show(); },function(e) { // if not over the smarttag div, hide content if(!$(e.relatedTarget).parents("#smarttag").length) { $("#smarttagcontent").hide(); } } ); } The 'smarttag' div would be hidden initially, but populated and shown when hovering over an element that it is applied to. I suppose a smart tag is an extension of a tooltip (which doesn't disappear if you mouse over it). -- Sam On Sep 25, 5:07 pm, Rey Bango <[EMAIL PROTECTED]> wrote: > Anyone know of a plugin that offers functionality like this? > > http://en.wikipedia.org/wiki/Image:Smarttags.PNG > > Rey...
[jQuery] Re: New jQuery Website...
As much as we don't like it, sites still have to be designed to cater for IE 6+ We are still on IE 6 at work, because some of the systems we use (not ones I have worked on of course!) only seem to work in IE 6. You would have thought when you pay for a system, it is updated as new browsers come out... should be in the Service Level Agreement. I'm sure there are still a lot of corporate intranet's still depending on IE 6 (developers not caring about standards or really understanding web development outside the GUI used...) -Sam PS While IE7 may have some annoyances (Firefox does too), it is still much better (standards wise) than IE6 jeremyBass wrote: > I don't know if this is just me but the site is all kinds of broken... > I'mean in almost everywere... this is 2 IE7's and 1 IE6's on 3 pcs... > I'd give a url but ... well it's almost everywhere... cool idea > though... > > On Sep 8, 10:03�am, "Rick Faircloth" <[EMAIL PROTECTED]> wrote: > > Yes, it does look great! > > > > Rick > > > > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of > > Chris Jordan > > Sent: Monday, September 08, 2008 12:58 PM > > To: jQuery Group > > Subject: [jQuery] New jQuery Website... > > > > I really like the look of the new jQuery website. When did it get launched? > > My hats off to the > > designers! It looks fantastic!! :o) > > > > Chris > > > > --http://cjordan.us > > > > No virus found in this incoming message. > > Checked by AVG -http://www.avg.com > > Version: 8.0.169 / Virus Database: 270.6.17/1655 - Release Date: 9/8/2008 > > 7:01 AM
[jQuery] Store JSON object in cookie
If you try and store and retrieve a JSON object in a cookie using the cookie plugin (http://plugins.jquery.com/project/cookie), you get an unexpected result. For instance, save into cookie: $.cookie("mydata", {foo:"bar",baz:1}); Retrieve value: var mydata = $.cookie("mydata"); But that returns [object Object] A json parser (e.g. http://www.json.org/js.html) has to be used. Using this script, you can 'stringify' the object before storing it: $.cookie("mydata", JSON.stringify({foo:"bar",baz:1})); Then you retrieve it and use JSON.parse: var mydata = JSON.parse($.cookie("mydata")); While this is a workaround, perhaps it may be a good idea if the cookie plugin did this automatically (i.e. convert object to string and back again)? Rather than building in JSON parsing, maybe make the json.org parser a prerequisite? Then a check is done in the plugin code: if(typeof JSON != "undefined") { if(typeof value == "object") value = JSON.stringify(value); }
[jQuery] Re: Declaring Rules in ASP.Net
All ASP.NET controls have a ClientID, which matches the ID generated in the HTML, so you should be able to replace: "<% = namePostcode %>" with "<%= namePostcode.Replace(":","\:") %>" and $("[EMAIL PROTECTED]" + <%=chkLinkAccount.ClientID %> + "]") with $("#<%=chkLinkAccount.ClientID %>") --Sam On Jul 17, 7:46 am, Gregoriusness <[EMAIL PROTECTED]> wrote: > Hey all, > > I'm trying to implement validation using the Validation plugin on an > ASP.Net (1.1 :( ) form. I'm having trouble with setting up the > rules, because they require the form element's "name" tag to assign > the rule to, and ASP.Net does some funky stuff with the names (changes > a name="myname" to "myUserControl:myname"). > > I can get that client side name by calling the name the same as the > ID, and on server side getting the fomrelement.ClientID, then doing a > String.Replace("_", ":"). > > But now it seems JQuery doesnt like that name because it has a colon > (:) in it. Putting "quotation marks" around it in the rules > declaration doesn't seem to help. > > Any ideas how i can get my rules working successfully? My best > solution would be fore the rules to accept a javascript variable > (which contains the actual element name) which i can declare at the > top of my page, and get the ClientID > Client Name values for use > later on. Or alternatively telling Validation plugin to use ID > instaed of Name attribute. > > Here's my code: > > $().ready(function() > { > $("#Short").validate({ > rules: { > "<% = namePostcode %>": { > required: function() { > return $("[EMAIL PROTECTED]" + <% > =chkLinkAccount.ClientID %> + "]").is(":checked"); > } > } > }, > messages: { > "<% = namePostcode %>": { > required: "Please enter your > postcode" > } > }, > errorPlacement: function(error, element) { > if ( element.is(":checkbox") ) > error.appendTo( element.parent()); > else > error.appendTo( element.parent() ); > } > }); > > Whic Generates the following: > > $().ready(function() > { > $("#Short").validate({ > rules: { > "ucFoxtelAccount:txtPostcode": { > required: function() { > return $("[EMAIL PROTECTED]" + > ucFoxtelAccount_chkLinkAccount + "]").is(":checked"); > } > } > }, > messages: { > "ucFoxtelAccount:txtPostcode": { > required: "Please enter your > postcode" > } > }, > errorPlacement: function(error, element) { > if ( element.is(":checkbox") ) > error.appendTo( element.parent()); > else > error.appendTo( element.parent() ); > } > }); > > And is trying to validate the following form element: > > > > Accountholder Postcode: > * > > maxlength="4" > id="ucFoxtelAccount_txtPostcode" class="required numeric textbox > postcode" MinLength="4" /> > > > > Thanks in advance > Greg
[jQuery] Re: My first jQuery plugin
How about: $("#myelement").parents("table:eq(0)") Does that do what you want? Example: http://demos.texotela.co.uk/parents.html --Sam On Jul 17, 7:51 am, ProggerPete <[EMAIL PROTECTED]> wrote: > Hi Andy, > parents doesn't do quite what I want. I want a method I can use in > event delegation handlers that basically says, 'Give me the nearest x > element'. I could of course check the current element, if it doesn't > match I could then do a parents and then work on the 1st result in > that, but that would be a bunch of extra processing for no gain (while > it continues to check parents that I have no interest in). > > I was more after info about any silly things I've done while > implementing the function. I've since discovered pushStack which > helps a fair bit. =) > > Cheers, > Pete > > On Jul 15, 6:19 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > > > Pete... > > > There is a built in parent method which does pretty much what you're doing. > > >http://remysharp.com/jquery-api/ > > > Look under parents(). > > > -Original Message- > > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > > Behalf Of ProggerPete > > Sent: Tuesday, July 15, 2008 10:41 AM > > To: jQuery (English) > > Subject: [jQuery] My first jQuery plugin > > > Hi folks, > > I'm very new to jQuery and am playing around with what is possible. > > > I found myself wanting a findParent function and couldn't spot one ready > > made. I'd love it if people could give me feedback on my implementation. > > I'm sure there's plenty I could do better. If this function also exists I'd > > like to know where it is too. =) > > > /** > > * return the first parent that matches the selector. Optionally include > > the src element in the search */ $.fn.findParent = function() { > > var _this, _selector, _includeSelf, _result; > > > function find(index, elem) > > { > > if (!_includeSelf) elem = elem.parentNode; > > while (elem) > > { > > if ($(elem).is(_selector)) return > > _result.push(elem); > > elem = elem.parentNode; > > } > > } > > > function _findParent(selector, includeSelf) > > { > > var thisp = _this = this; > > _selector = selector; > > _includeSelf = includeSelf; > > _result = []; > > this.each(find); > > var retObj = $(_result); > > retObj.end = function () { return thisp }; > > return retObj; > > } > > > return _findParent; > > }(); > > > Cheers, > > Pete
[jQuery] jQuery.post returning binary content
I current add a form to the page, which is then submitted and returns binary content (e.g. a PDF or Word/RTF Document) that causes a prompt for them to open/download the file: var form = $(document.createElement("form")).attr( { "method": "post", "action": "getdocument.ashx" }).html(""); $("body").append(form); form[0].submit(); The getdocument.ashx returns the following headers to cause the download dialog to appear: "content-type" = "application/rtf" "content-disposition" = "attachment; filename=Record1.rtf" Is there a way to use jQuery.post instead, I have tried the following, to no avail (I can see the response in Firebug, so the file is downloaded, but the user can't download it): $.post("getdocument.ashx", { "RecordID": "1" } ); Thanks, --Sam
[jQuery] Re: YouLove.us crazy cool.
Lags a bit with me as well, site looks quite good though. It is actually smoother without JavaScript enabled. It illustrates that when developing sites/applications it is a good idea to test with a slower PC (it is likely a lot of developers have above average specification computers). -Sam On Jun 16, 3:10 pm, Joe <[EMAIL PROTECTED]> wrote: > Interesting. I dig the dynamic parallax effect, but the transitions > are a bit jagged. Maybe a fade in fade out? > > Overall cool stuff. > > Joe > > www.subprint.com > > On Jun 16, 8:07 am, "Ty (tzmedia)" <[EMAIL PROTECTED]> wrote: > > > Did anyone else see the newhttp://youlove.usdesign-houseportfolio > > site? > > It's pretty cutting edge stuff, worth a study.
[jQuery] Re: Documentation for Version 1.2 (Download)
There is a special page for converting WikiText to XML: http://docs.jquery.com/Special:Wiki2XML If the Wiki has built in features for converting to XML, perhaps it could be leveraged somehow? As DocBook is one of the output formats, there are more options for creating documentation. If MediaWiki is used to power the site (I assume it is), there are options for converting to a PDF (so skipping the XML step): http://www.mediawiki.org/wiki/Extension:Pdf_Export http://wiki.enneenne.com/index.php/MediaWiki_PDF_export http://meta.wikimedia.org/wiki/PDF_Export -Sam PS CC-ing to jQuery Documents list as it seems appropriate to do so On Jun 6, 1:14 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > You may want to take a look at this thread: > > Wiki xml > exporterhttp://groups.google.com/group/jquery-dev/browse_thread/thread/d08934... > > It's a few months old, so I don't know how up-to-date any referenced code > might be (for converting from mediawiki to xml), but at the very least there > are urls listed for accessing the raw documentation from mediawiki. > > - Richard > > On Fri, Jun 6, 2008 at 7:59 AM, gogui <[EMAIL PROTECTED]> wrote: > > > Hello, I am looking for documentation I can download and have > > accessible offline. I understand that visualJQuery and JQuery 1.1.2 > > API Browsers are available for download, however, they are outdated. > > Is there and RSS feed for the documentation provided at JQuery.com > > itself? (I am willing to port the raw data to an application). > > Thanks
[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available
Mainly CSS selector tests, but perhaps also methods that may be common among libraries (like map, extend), but that may be more difficult. There is this one, but it uses old libraries (not just jQuery): http://dev.jquery.com/~john/slick/ -Sam On Jun 4, 3:52 pm, "John Resig" <[EMAIL PROTECTED]> wrote: > .extend() was used extensively in the event handling code, hence the > need for improvement. > > > How does it compare with other libraries now? > > How does what compare? No other library is making the optimizations we > are - or even examining how to perform faster operations here. > > --John
[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available
I suppose a few % points off isn't that much of a difference and in some cases were even better. But I expect mine isn't too far off the test machine. Think I got my maths the wrong way round: ((1.2.3 time - 1.2.6 time) / 1.2.3 time) * 100 e.g. for .extend(): ((63 - 46) / 63) * 100 (17 / 63) * 100 = 27% improvement Maybe that's why I made that conclusion. What I am interested in is how the lower spec PC's performed (non-dual core, entry level machines), to see if multi-core processors actually make much of a difference (since many users of website using jQuery will have these type of PC's). .map() is the major improvement in this release as a few milliseconds off a fast method like .extend() won't mean as much (although if it is called a lot it adds up to more savings). .offset() is still a bottleneck (browser quirks stop any major improvements), but caching values and restricting how often it is called helps mitigate that (I think Flash is still far smoother when it comes to mouse tracking and animation - which can be very slow over a Citrix connection). Animation performance is not something that can be tested with unit tests (still need a human to do that). How does it compare with other libraries now? -Sam On Jun 4, 1:21 pm, "John Resig" <[EMAIL PROTECTED]> wrote: > > Still a performance improvement, but not as great as the test machine > > - i.e. the faster the client PC processor, the better the performance > > improvement (I don't think RAM will have much of an impact as the CPU > > is doing the work). > > How so? Your .extend() improved by 37% and your .map() improved by > 1017%. Those are well within the realm of what we posted. The speed of > the processor shouldn't affect the degree of relative improvement. > > --John
[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available
Looks like another good release, yet more performance improvements and a few useful new features! Regarding speed testing, maybe it is worth mentioning the PC specification of the machine that performs these tests? For example, mine (Core Duo 1.6Ghz) .extend() 1.2.3 - 63 1.2.6 - 46 .map() 1.2.3 - 2268 1.2.6 - 203 Still a performance improvement, but not as great as the test machine - i.e. the faster the client PC processor, the better the performance improvement (I don't think RAM will have much of an impact as the CPU is doing the work). Perhaps the tests should be done on different spec machines, more so the low end ones (Celeron, Sempron and Intel Atom)? -Sam On Jun 3, 6:46 pm, Rey Bango <[EMAIL PROTECTED]> wrote: > jQuery v1.2.6 is now official and release notes have been > posted:http://docs.jquery.com/Release:jQuery_1.2.6 > > The biggest changes are improvements in performance, especially event > handling, which is now 103% faster. > > Also, the Dimensions plugin is now part of core. The remaining methods > of the Dimensions plugin, by Brandon Aaron, have been introduced into > jQuery core, along with additional bug fixes and performance > improvements. This plugin has seen considerable use amongst developers > and plugin authors and has become a solid part of the jQuery ecosystem. > We've been, slowly, introducing the most-used methods from the > Dimensions plugin over the past couple releases - but with the release > of 1.2.6 all remaining methods are now part of core. > > If you're upgrading your copy of jQuery to version 1.2.6 you can now opt > to exclude the Dimensions plugin from your code. > > There are plenty of other updates so please read the release note for > full details. > > http://docs.jquery.com/Release:jQuery_1.2.6 > > The jQuery Team...
[jQuery] Re: jquery.blockUI: Any way to preload images for the blockUI dialog?
You can use this preload plugin and run it as soon as possible: jQuery.preloadImages = function() { for(var i = 0; i").attr("src", arguments[i]); } } $.preloadImages("over.png", "out.gif"); $( function() { // do something when page is ready } ) On Apr 6, 8:14 am, "miCRoSCoPiC^eaRthLinG" <[EMAIL PROTECTED]> wrote: > Hi, > I am loading this animated .gif loader image into the blockUI > dialog. When the dialog comes up, there's a lag of 2-3 seconds before > the image appears.. this looks pretty unprofessional. So is there any > way to pre-load these images so that they appear along with the > message the moment the dialog pops-up? > > Thanks, > m^e
[jQuery] Re: Selecting Children Of $(this)
studiobl wrote: > I'm working on a wireframe for an ecommerce site. I need to simulate > some shopping cart functionality, like updating total counts and > dollar amounts on change(). I've already done this with a page that > contains one table. This page contains multiple tables, so I need to > add another loop: > > from > > <-- > > $(".someGrid input").each(function(){ > //some kind of code... > }); > > --> > > to > > <-- > > $(".someGrid").each(function(){ > $(this + " input").each(function(){ > //some kind of code > }); > }); > > --> > > The problem is, the second one isn't working. How can I loop through > the tables, then loop through the inputs they contain? You can do $("input", this) to find all the inputs (the optional second parameter is the context to run the selector on (i.e. must be a child in it)). -Sam
[jQuery] Re: BBC Site - jQuery
The beta test has been up for a while and looks like it uses Interface (http://interface.eyecon.ro/) for the interactivity. Not jQuery UI unfortunately (Interface is more established though and has probably had more testing). There is still some legacy code (for example they use Simon Willison's addLoadEvent function), so not completely moved over. I think it is only the home page that uses jQuery. Perhaps there are some of the editors who worked on it on this mailing list? -- Sam On Mar 3, 11:50 am, Dan Mitchell <[EMAIL PROTECTED]> wrote: > Hi all, > > The new BBC website is using jQuery - a testament to how great jQuery > is! Go team jQuery! > > http://www.bbc.co.uk > > Regards > Dan
[jQuery] Re: Return the checked items from checkboxes plugin
On Mar 3, 3:51 pm, owen <[EMAIL PROTECTED]> wrote: > I wrote: > > I'm using thecheckboxesplugin > > (http://www.texotela.co.uk/code/jquery/checkboxes/) and I'd like to pass > > the id of each checkbox that gets > > checked to a function. I see that the plugin has an option to "return > > the checked items: > > > > Return the checked items: $("#myform").checkCheckboxes(".top5", true); > > Do I need to construct it like this in order to access the returned > object? > > checkall = $("#myform").checkCheckboxes("*", true); > > Don't I need to know the structure of the object in order to access > information about it? > > Owen When you pass 'true' as the second parameter, you get a jQuery object consisting of all the checkboxes. So, to get what you want: var checked = []; $("#myform").checkCheckboxes(".top5", true).each( function() { checked[checked.length] = this.id; } ); checked is an array of id's. -- Sam
[jQuery] Re: What tool is used to minify the official jQuery distribution?
JSMin is the minifier that jQuery uses (the port to JavaScript by Franck Marcia). In SVN: http://dev.jquery.com/browser/trunk/jquery/build/js/jsmin.js On Feb 8, 11:17 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Collin, > > Thanks for the link, PHP Speedy looks interesting. I could > potentially use it in a few hobby site scenarios, though I should > state that this particular case involves ColdFusion as the server side > scripting environment running on Windows with an IIS6 web server. > These are far from ideal conditions IMO, but it's what I've got to > work with! > > I've been using YUI Compressor to do some testing and it appears to > strip trailing semicolons from .js files. Checking jQuery minified > and various plugins minified, I found that there are in fact trailing > semicolons in those scripts. They Yahoo minified scripts I'm using > work fine when loaded on their own, but I've not yet tried to > concatenate them all. I'll try that next to see the outcome. > > Anyone else have a line into the "official" minifier used for jQuery? > > Thanks, > haylo > > On Feb 7, 3:36 pm, Collin Allen <[EMAIL PROTECTED]> wrote: > > > This isn't the official tool (I'm not sure what is, maybe jsmin?), but > > you might find it helpful/inspiring: > > >http://aciddrop.com/php-speedy/ > > > On Feb 7, 12:44 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > I've been testing out various minifying strategies, such as Dean > > > Edwards' packer, YUI Compressor, jsmin, etc. My goal is to > > > concatenate all my required .js files and thenminifythem en masse. > > > I've read of concerns about trailing semicolons, etc. and am curious > > > what tool is used tominifythe official jQuery distribution. Please > > > post if you have knowledge! > > > > Thanks, > > > haylo
[jQuery] Re: new jQuery user needs help
You only need newsticker.pack.js in you head and have to add some code to make it load on statup, e.g. in $( function() { $("#newsticker").newsTicker(); }); On Jan 24, 6:10 am, visitorQ <[EMAIL PROTECTED]> wrote: > well i tried posting some code but it didn't work for some reason and > it's a lot of crap so i think the best way you could help is to go to > this linkhttp://www.texotela.co.uk/code/jquery/newsticker/and test > out the first example. see how you can get it to work on your own > development environments. and when you do, let me know how you did it > and why you think it's not working for me. like if there's something > that is obviously advanced about this or not. anyway. i really really > appreciate it guys.
[jQuery] Re: TexoTela select box manipulation modification
I think it may be because when you remove an option the total number of options is decreased, so you never get through all of them. Start at the last option and then go back, so instead of: for(var i = 0; i0; i--) On Jan 17, 3:44 pm, codecowboy <[EMAIL PROTECTED]> wrote: > Thank you very much. That worked. It would be great if you had the > time to tell me what was wrong with my original code because JS is > something that i am not so familiar with. > > On Jan 17, 7:25 am, Sam Collett <[EMAIL PROTECTED]> wrote: > > > This should work: > > > $.fn.moveOptions = function(to, which) > > { > > this.copyOptions(to, which); > > if(which == "all") > > { > > this.find("option").remove().end(); > > } > > else > > { > > this.find("[EMAIL PROTECTED]").remove().end(); > > } > > return this; > > > } > > > On Jan 16, 11:03 pm,codecowboy<[EMAIL PROTECTED]> wrote: > > > > Hi Guys, > > > > I am trying to add a function to theTexoTelaselect box manipulation > > > plug-in (http://www.texotela.co.uk/code/jquery/select/). I am trying > > > to add a function called moveOptions() that will function like a cut & > > > paste from one text box to another. There is already a function > > > called copyOptions() that copies a selected value from one select box > > > to another. I copied the code from copyOptions() to my new function > > > moveOptions() to modify. I figure that the only change would be to > > > remove the selected option from the 1st select box after adding it to > > > the 2nd select box. The concept is simple but my code is yielded > > > strange results. The functionality breaks down when you try to copy > > > multiple options at once. I am relatively new to jquery so I'm hoping > > > that it is something obvious. Any help would be greatly appreciated. > > > Thank you in advance. > > > > You can test out the code > > > here:http://www.digital-magic.biz/guy/cake_1_2_blog_tutorial/blog_wizard/f > > > > Here is my function, I commented out all the different things that I > > > have done in an attempt to make it work: > > > > /** > > > * Move options to another select (functions like cut and paste) > > > * > > > * @name moveOptions > > > * @author Sam Collett (http://www.texotela.co.uk) > > > * @type jQuery > > > * @paramString to Element to move to > > > * @paramString which (optional) Specifies which options should > > > be copied - 'all' or 'selected'. Default is 'selected' > > > * @example $("#myselect").moveOptions("#myselect2"); // copy > > > selected options from 'myselect' to 'myselect2' > > > * @example $("#myselect").moveOptions("#myselect2","selected"); // > > > same as above > > > * @example $("#myselect").moveOptions("#myselect2","all"); // copy > > > all options from 'myselect' to 'myselect2' > > > * > > > */ > > > $.fn.moveOptions = function(to, which) > > > { > > > var w = which || "selected"; > > > if($(to).size() == 0) return this; > > > this.each( > > > function() > > > { > > > if(this.nodeName.toLowerCase() != "select") > > > return this; > > > // get options > > > var o = this.options; > > > // get number of options > > > var oL = o.length; > > > for(var i = 0; i > > { > > > alert(o[i].value + " -- " + o[i].text + " -- " + > > > o[i].selected); > > > if(w == "all" || (w == "selected" && > > > o[i].selected)) > > > { > > > //alert("1" + o[i].text + o[i].value); > > > //alert(o.toString()); > > > $(to).addOption(o[i].value, > > > o[i].text); > > > $(this).removeOption(o[i].value); > > > //$(this).remove(o[i].value); > > > //this.remove(o[i].value); > > > //alert("2" + o[i].text + o[i].value); > > > } > > > //$(this).removeOption(o[i].value, true); > > > } > > > } > > > ); > > > return this; > > > > };
[jQuery] Re: TexoTela select box manipulation modification
This should work: $.fn.moveOptions = function(to, which) { this.copyOptions(to, which); if(which == "all") { this.find("option").remove().end(); } else { this.find("[EMAIL PROTECTED]").remove().end(); } return this; } On Jan 16, 11:03 pm, codecowboy <[EMAIL PROTECTED]> wrote: > Hi Guys, > > I am trying to add a function to theTexoTelaselect box manipulation > plug-in (http://www.texotela.co.uk/code/jquery/select/). I am trying > to add a function called moveOptions() that will function like a cut & > paste from one text box to another. There is already a function > called copyOptions() that copies a selected value from one select box > to another. I copied the code from copyOptions() to my new function > moveOptions() to modify. I figure that the only change would be to > remove the selected option from the 1st select box after adding it to > the 2nd select box. The concept is simple but my code is yielded > strange results. The functionality breaks down when you try to copy > multiple options at once. I am relatively new to jquery so I'm hoping > that it is something obvious. Any help would be greatly appreciated. > Thank you in advance. > > You can test out the code > here:http://www.digital-magic.biz/guy/cake_1_2_blog_tutorial/blog_wizard/f > > Here is my function, I commented out all the different things that I > have done in an attempt to make it work: > > /** > * Move options to another select (functions like cut and paste) > * > * @name moveOptions > * @author Sam Collett (http://www.texotela.co.uk) > * @type jQuery > * @paramString to Element to move to > * @paramString which (optional) Specifies which options should > be copied - 'all' or 'selected'. Default is 'selected' > * @example $("#myselect").moveOptions("#myselect2"); // copy > selected options from 'myselect' to 'myselect2' > * @example $("#myselect").moveOptions("#myselect2","selected"); // > same as above > * @example $("#myselect").moveOptions("#myselect2","all"); // copy > all options from 'myselect' to 'myselect2' > * > */ > $.fn.moveOptions = function(to, which) > { > var w = which || "selected"; > if($(to).size() == 0) return this; > this.each( > function() > { > if(this.nodeName.toLowerCase() != "select") return > this; > // get options > var o = this.options; > // get number of options > var oL = o.length; > for(var i = 0; i { > alert(o[i].value + " -- " + o[i].text + " -- " + > o[i].selected); > if(w == "all" || (w == "selected" && > o[i].selected)) > { > //alert("1" + o[i].text + o[i].value); > //alert(o.toString()); > $(to).addOption(o[i].value, > o[i].text); > $(this).removeOption(o[i].value); > //$(this).remove(o[i].value); > //this.remove(o[i].value); > //alert("2" + o[i].text + o[i].value); > } > //$(this).removeOption(o[i].value, true); > } > } > ); > return this; > > };
[jQuery] Re: add changing URL string to address for AJAX a la Gmail 2
You may find the history plugin to be of use (not sure if there is a newer version as that page hasn't been updated for a while): http://stilbuero.de/jquery/history/index.html On Jan 8, 6:19 am, "Scott Hulbert" <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm working on a simple project and I'm going to use jQuery's .load function > to switch between content pages so that the page does not have to unload and > reload. I'm doing this because my page needs a flash music player on it and > this allows for uninterrupted music. I'd like a way to do something similar > to what Gmail does now. > > For example, when I click on a message the address in the address bar > changes to: "http://mail.google.com/mail/#inbox/11757de76c56c762"; > > I just want something simple, like > domainname.com/home.php?page=about...orsomething more similar to > gmail, a la > domain.com/home.php#about. This isn't necessary but it is nice for the user > and could eventually be used with PHP to redirect a user to a linked page. > > Thanks to anyone with any insight on how this would be done. I have a decent > knowledge of jQuery but my javascript is a bit weak. > > --Scott Hulbert
[jQuery] Re: Cross Browser Issues - Simple use of JQuery
On Nov 12, 4:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > To nest lists properly, I believe you want to put the you are > toggling inside the you are clicking Also, only can be nested in or , so it would be invalid HTML (although browsers forgive that).
[jQuery] Re: JSS - New Plug-in
I noticed that you have added String.prototype.trim. jQuery actually has this already, e.g. jQuery.trim(" foo "); An easy was to get better CSS support in browsers that are not up to it. Maybe in a future version, browsers that are capable will just be ignored? Also, maybe best to wrap it in a closure: (function($) { // plugin code here, use $ as much as you like })(jQuery); On Oct 7, 12:39 am, Andy Kent <[EMAIL PROTECTED]> wrote: > Hi Guys, > > This is a plug-in that was thrown together in a few spare hours after > chatting with some people at FOWA last week, I hadn't had much sleep > at the time so it's still a bit rough round the edges. > > In a nutshell though it gives you full support for all jQuery > selectors from within your CSS files in a totally unobtrusive mannor. > This effectively means cross browser CSS3 support via JavaScript. > > You can find out more and grab it from: > > http://andykent.bingodisk.com/bingo/public/jss/ > > Any feedback, good or bad would be appreciated. > > Thanks, > Andy.
[jQuery] Re: [Site Submission]: nbc.com
It's good that they are using it quite a bit. There are some site that use it, but only $(document).ready to call a function that manipulates the DOM the old fashioned way. On 4 Oct, 08:23, "John Resig" <[EMAIL PROTECTED]> wrote: > Wow! Very awesome :-) > > It looks like they're getting a pretty good coverage of features, too. > (DOM Manipulation, animations, events, etc.) > > --John > > On 10/4/07, Karl Swedberg <[EMAIL PROTECTED]> wrote: > > > Looks like nbc.com is heavily into the jQuery love now, using 1.1.4.1 on > > their site. Looks like they're using Interface and Mike Alsup's Media > > plugin, and Klaus Hartl's cookie plugin. Also, pulling in some data with > > $.ajax, doing some accordion stuff, etc.. They could be using the > > > This line appears in > >http://www.nbc.com/assets/js/global/nbc.com.jsright after > > all of the jQuery code: > > > // Legacy crap -> > > > Pretty funny. > > > Here's another file you might want to poke around in: > > >http://www.nbc.com/assets/js/video/fun.js > > > --Karl > > _ > > Karl Swedberg > >www.englishrules.com > >www.learningjquery.com
[jQuery] Re: the jquery logo
jQuery Button Contest Winners: http://jquery.com/blog/2006/11/07/jquery-button-contest-winners/ Also, the post announcing the competition has logos in the comments. jQuery Button Contest: http://jquery.com/blog/2006/10/26/jquery-button-contest-many-prizes/ On 4 Oct, 07:38, "Tane Piper" <[EMAIL PROTECTED]> wrote: > Also, check through the blog on http://jquery.com/blog - there is an > old thread from last year where people submitted their own jQuery > logo's for use of websites. Although there was a winner, you are free > to choose whichever one you want to use. > > On 04/10/2007, Joel Birch <[EMAIL PROTECTED]> wrote: > > > > > Whoops, bad link. Here it is: > >http://users.tpg.com.au/j_birch/plugins/superfish/img/jQuery-alpha-tr... > > -- > Tane Piper > Blog -http://digitalspaghetti.me.uk > AJAX Pastebin -http://pastemonkey.org > > This email is: [ ] blogable [ x ] ask first [ ] private
[jQuery] Re: Catch a click event before the DOM is loaded
Wouldn't it be easier just to hide the button via CSS and then show it when the document is ready? Or disable the button (via html) then enable it again via script? On Oct 1, 12:38 pm, Remy Sharp <[EMAIL PROTECTED]> wrote: > I've recently been working on a project where the page is complex > enough that the DOM would not have loaded before the user had spotted > our 'big red button' - and clicked away. > > As much as I hate to admit, this project wasn't going to support a non- > JS version (due to the demographic), so I thought I'd share how we > solved the problem of early clicks. > > I have a full write up here: > > http://remysharp.com/2007/10/01/catch-click-events-before-the-dom-is-... > > In short: add an explicit click handler on the link/s in question > returning the value from the following function: > > > function earlyClickHandler() { > var t = this; > if (typeof $.isReady == 'boolean' && $.isReady) { > return true; > } else if (!t.clicked){ > t.clicked = true; > // once DOM is loaded, fire this click handler > $(function () { > $(t).click(); > }); > } > return false;} > > > > I'm an advocate for unobtrusive JavaScript, but sometimes you have to > work with what you've got. > > I'd welcome any feedback. > > Cheers, Remy.
[jQuery] Re: Did I get *all* of the XPath plugin?
Can it also be changed to take advantage of some browsers XPath parsing abilities (that is how I thought it would have worked when 1.2 came out)? I know Firefox has native parsing (http:// developer.mozilla.org/en/docs/ Introduction_to_using_XPath_in_JavaScript) and so does Internet Explorer (via ActiveX("MSXML.DOMDocument")) - do Opera and Safari? On Sep 28, 4:17 pm, "John Resig" <[EMAIL PROTECTED]> wrote: > Yes, that's it. We really don't support very much XPath, only a couple > commands. That was a big reason why it was removed, we didn't have to > resources or interest to flush it out into a full XPath > representation. > > --John > > On 9/28/07, Danjojo <[EMAIL PROTECTED]> wrote: > > > > > Is this all I need to add to my external .js library to fully include > > the Xpath plugin? > > > /* > > * Simple XPath Compatibility Plugin for jQuery 1.1 > > * By John Resig > > * Dual licensed under MIT and GPL. > > */ > > > (function(jQuery){ > > > var find = jQuery.find; > > > jQuery.find = function(selector, context){ > > > // Convert the root / into a different context > > if ( !selector.indexOf("/") ) { > > context = context.documentElement; > > selector = selector.replace(/^\/\w*/, ""); > > if ( !selector ) > > return [ context ]; > > } > > > // Convert // to " " > > selector = selector.replace(/\/\//g, " "); > > > // Convert / to > > > selector = selector.replace(/\//g, ">"); > > > // Naively convert [elem] into :has(elem) > > selector = selector.replace(/\[([EMAIL PROTECTED])\]/g, > > function(m, selector){ > > return ":has(" + selector + ")"; > > }); > > > // Naively convert /.. into a new set of expressions > > if ( selector.indexOf(">..") >= 0 ) { > > var parts = selector.split(/>\.\.>?/g); > > var cur = jQuery(parts[0], context); > > > for ( var i = 1; i < parts.length; i++ ) > > cur = cur.parent(parts[i]); > > > return cur.get(); > > } > > > return find(selector, context); > > }; > > > })(jQuery);
[jQuery] Re: When will the API be updated for 1.2.1?
You use MediaWiki don't you? If so can't you convert the Wiki markup to Xml and go from there? e.g. http://www.mediawiki.org/wiki/Extension:Wiki2xml Much better than screen scraping. On Sep 27, 4:24 pm, "Brandon Aaron" <[EMAIL PROTECTED]> wrote: > The documentation is going through some growing pains. Currently the only > source of documentation for 1.2.x is on the wiki. I've been thinking about > how we can take those docs and create an XML file like we had before ... > currently the only idea I have is to screen scrape which if you look at the > actual markup of the Wiki is a pain and doesn't scale well for inclusion of > plugins, etc. I've made a little progress (still have a long way to go) with > using Hpricot to at least get the core docs into XML. > > -- > Brandon Aaron > > On 9/27/07, Andy Matthews <[EMAIL PROTECTED]> wrote: > > > > > I use this: > >http://jquery.com/api/ > > > all the time because it's the simplest, easiest, reference for jQuery > > methods and behaviours. But it still lists it's version as 1.1.2. Are > > there plans to update this reference? > > > Alternately, I'd argue that there needs to be ONE single point of entry > > (on the jQuery site at least) for a straight up reference. I'm not talking > > about the fluffy examples found in the wiki area, but just a terse > > explanation of the method, it's parameters, and how to use it. > > > * > > > Andy Matthews > > *Senior ColdFusion Developer > > > Office: 877.707.5467 x747 > > Direct: 615.627.9747 > > Fax: 615.467.6249 > > [EMAIL PROTECTED] > >www.dealerskins.com > > > > dealerskinslogo.bmp > 6KDownload
[jQuery] Re: Focusfields
Found out the cause, but not sure how to work around it at the moment: http://www.texotela.co.uk/wrapexpandos.php On Sep 26, 1:47 pm, Sam Collett <[EMAIL PROTECTED]> wrote: > I can replicate the > error:http://www.texotela.co.uk/code/jquery/focusfields/?jqver=1.2.1 > > I will see what is causing the problem. > > On Sep 25, 4:31 pm, Charles Sheehan-Miles <[EMAIL PROTECTED]> > wrote: > > > Hello all, > > > I'm new to jquery, so forgive me if I'm asking questions which have > > been asked a thousand times. I've searched through the list archives > > and not had much luck with this one. > > > I'm using the focusfields plugin, which I found here: > > >http://www.texotela.co.uk/code/jquery/focusfields/ > > > It works great on Firefox, Camino, etc., and the demo works fine on > > IE. But in my test setup, I get this error: > > > 'this.parentNode.borderCss.off' is null or not an object > > > Error comes up as soon as the page loads. > > > I'm using jQuery 1.2 on my server, which is the one difference I > > found from the demo page (which seems to be calling > > jquery-1.1.2.pack.js). If this possibly a version difference, and > > the newer version doesn't deal as well with IE? > > > Hope someone has some ideas, > > > Charles
[jQuery] Re: Focusfields
I can replicate the error: http://www.texotela.co.uk/code/jquery/focusfields/?jqver=1.2.1 I will see what is causing the problem. On Sep 25, 4:31 pm, Charles Sheehan-Miles <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm new to jquery, so forgive me if I'm asking questions which have > been asked a thousand times. I've searched through the list archives > and not had much luck with this one. > > I'm using the focusfields plugin, which I found here: > > http://www.texotela.co.uk/code/jquery/focusfields/ > > It works great on Firefox, Camino, etc., and the demo works fine on > IE. But in my test setup, I get this error: > > 'this.parentNode.borderCss.off' is null or not an object > > Error comes up as soon as the page loads. > > I'm using jQuery 1.2 on my server, which is the one difference I > found from the demo page (which seems to be calling > jquery-1.1.2.pack.js). If this possibly a version difference, and > the newer version doesn't deal as well with IE? > > Hope someone has some ideas, > > Charles
[jQuery] Re: OT: Google autofill(or any others) and form events
I don't know if you can check if autofill has changed a form field. What may work is using a setTimeout (to give the autofiller chance to run) and then reset the background colour: setTimeout( function() { $("#myfield").css("background-color", "")}, 1000); I have not tried this, so am not 100% sure if it will work. For a designer, disabling autofillers may be desirable, but they are a useful feature of various toolbars. The other way would be to use non-standard field names: On Sep 24, 3:46 pm, Eridius <[EMAIL PROTECTED]> wrote: > I have been trying to think of a way to track auto fill type stuff. I am not > sure if this is possible, but is there a way to track if the text() of a > certain object has changed and then trigger an even ti it has. > > Eridius wrote: > > > I am doing some validation on a form using live validation. One issue > > that someone brought up is what about autofillers? is thier a way to > > trigger the event with an autofiller or disable the use of auto filler on > > that form element? it is a short form so i don't care are disabling that. > > -- > View this message in > context:http://www.nabble.com/OT%3A-Google-autofill%28or-any-others%29-and-fo... > Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Browser Crash on SlideToggle (IE)
I have a strange situation where the browser crashes when a SlideToggle animation is applied. It happens with Internet Explorer 6 and 7. What makes it particularly odd is that it only happens for part of the site. Steps to reproduce: Go to http://www.nelctp.nhs.uk Click on Help in the bar at the top Then click on SiteMap The browser then becomes unresponsive. If you click on SiteMap on any other pages (as long as they are not under /help/) this problem does not occur and it slides down as intended. Anyone able to replicate this or know why it is happening?
[jQuery] Re: jQuery plugins repo is a major traffic generator
I find that's true with my site as well. 30% comes from the jQuery site. 36% is from Google, but mostly jQuery related searches. On Sep 18, 11:10 pm, Stephan Beal <[EMAIL PROTECTED]> wrote: > Hi, all! > > The past couple of days i've been looking through some web logs and > found some really unexpected things... > > a) Though jQuery-related stuff is only a small part of my website, the > vast majority of the recent traffic targets my jQuery plugins pages. > (This is not to imply that my plugins are particularly popular > (they're not - they're all small/niche stuff).) > > b) The jQuery.com plugins repo is the most prolific referrer to my > site. > > c) 3 of the top 5 search terms which bring people to the site (via > google) are people searching for a jQuery color picker. Another one of > those top 5 is someone looking for a color picker in javascript (not > explicitly jQuery). > > My point is: If you write plugins, add them to the jQuery plugins > repository. There are lots of good reasons to do so, but one reason > which is probably under-considered is that doing so will drive traffic > more traffic to your site. Case in > point:http://wanderinghorse.net/computing/javascript/jquery/ > > :)
[jQuery] Re: Google Code
Google Web Toolkit is for Java developers (run server side), so it can't be used for those who may use ASP.NET, PHP, CFML etc On Sep 18, 5:25 pm, Anjanesh <[EMAIL PROTECTED]> wrote: > Wow ! I really thought prototypejs being the more popular one > !http://www.prototypejs.org/real-world > > Odd, I thought Google Web Toolkit (http://code.google.com/webtoolkit/) > was another JavaScript framework.
[jQuery] Re: Google Code
Looks like it is being used to show the Google Code blog posts and featured projects. Maybe they will use some of the more advanced features someday. On Sep 18, 3:54 pm, Rey Bango <[EMAIL PROTECTED]> wrote: > The next time you hear someone say that jQuery isn't a mature framework, > be sure to point them to this URL: > > http://code.google.com/ > > The way I see it is if Google feels confident enough to use jQuery, then > that speaks volumes and the naysayers can take a hike! > > Rey...
[jQuery] Re: John's Pager - best plugin no one uses?
eq is in 1.2.1, but gt and lt are not. On Sep 18, 5:14 am, "Joan Piedra" <[EMAIL PROTECTED]> wrote: > On 9/17/07, astik <[EMAIL PROTECTED]> wrote: > > > > > With the new version of jQuery out (1.2), some specific code is no > > longer working ... > > The lt and gt method are now deprecated ... > > Hi Astik, they are back in 1.2.1 > > -- > Joan Piedra || Frontend web developerhttp://www.justaquit.com/ || > http://www.joanpiedra.com/
[jQuery] Re: JSPacker for .NET
That's something I'd be interested in using. All the articles I've read about GZIP compression have been using PHP and never found anything that used C#. Does it also contain JSMin compression as an option? Also, if you made changes to Deans .NET packer perhaps you could send him the changes? On Sep 18, 2:08 am, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote: > I've spend the last few days building a .NET implementation of a gzip > packer. It accepts an argument like either of these two: > > > > src="JSPacker.ashx?F=AssemblyName:Resources.jquery.js"> > > It will also accept a semicolon-delimited list of files and will stream them > back as a single file. > > I took Dean Edwards packer, updated the .NET implementation, and used the > built-in gzip library to perform the compression. > > The basic idea is that you can have fully readable, uncompressed javascript > as a resource in your assembly or saved in a directory on your website. > When you run the website in debug mode (Cassini server) the files are not > minified. In a production environment, the source files are minified, > gzipped and cached on the server. > > I did some testing and it appears to be working very well for me, although > the jQuery source file was only compressed down to 16.5kb (instead of > 14.5kb). This may be due to the MS implementation of Gzip, but I'm not > sure. > > I can't host this for download on my company's website for various reasons, > but I'd happily send the source code and binaries (strong-named for use in > the GAC) to anyone who wants it. > > JK
[jQuery] Re: Thanks for bringing back eq() in 1.2.1
On Sep 17, 1:06 pm, Stephan Beal <[EMAIL PROTECTED]> wrote: > i think the main reason lt/gt were removed was "because you can do the > same thing with slice()". John Resig said in a post a week or so ago > that they were also removed because "they did only one thing, and > didn't do it terribly well" (or something to that effect). Fair > enough, but then i would prefer that x.lt(n) be kept and implemented > in terms of $( ":lt(n)",x), or vice versa. > > :) I think it would be better if it worked a bit like how the format plugin does it (http://bassistance.de/jquery-plugins/jquery-plugin- format/) or even better, the .NET way: var x = 2; var y = "span"; $(":filter({1}):gt({0})", x, y); // filter(span):gt(2)
[jQuery] Re: BUG ? cannot detect the id with ":"
You have to escape with \\ $("#this\\:is\\:only\\:example"); On Sep 13, 9:42 am, Adwin Wijaya <[EMAIL PROTECTED]> wrote: > Hi :) > > I am glad you are reache version 1.2 :) that's awesome .. but I would > like to report the bug, > it seems the jquery 1.2 (and before) still couldnt detect the id with > ":" for example > > > > this code usually generated by those who using netbeans + visual > webpack. they generated silly id like that .. but it works very well > using prototype :) > > adwin
[jQuery] Re: position in selector
var $a = $('a').click(function() { console.log('anchor' + $a.index(this) +' in page'); }); On Sep 12, 7:58 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have the following code > > $('a').click(function() { > console.log('anchor'+ pos+' in page); > > }); > > I'd like to be able to get the matched position number (pos) of each > element found, so if my page has 5 anchor tags, if i click on the > first a element in the page, its pos would be 1 (or 0), etc.
[jQuery] Re: newbie: how can I get the # of options in a SELECT element?
That gets all options in all selects, this would be better: $('#mySelectElement option').length On Sep 12, 1:14 pm, David Duymelinck <[EMAIL PROTECTED]> wrote: > $('select option').length should do it. > > -- david > > Ojas schreef: > > > Using jQuery, how can I get the following value? > > > document.myForm.mySelectElement.options.length > > -- > David Duymelinck > > [EMAIL PROTECTED]
[jQuery] Re: Learning JQuery book typo: plugins repo URL is 404
Although, perhaps a better idea would to have a redirect in place as I am sure there are many other sites that refer to that folder? On Sep 12, 1:34 am, Karl Swedberg <[EMAIL PROTECTED]> wrote: > Thanks a lot, Stephan, for the note. I will send this on to the > publisher. > > In the future, you can report errata directly at Packt's web > site:http://www.packtpub.com/support/book/jQuery > > Also, I'm keeping an informal list of errata on the book's companion > site at:http://book.learningjquery.com/forums/ > > Cheers, > > --Karl > _ > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Sep 11, 2007, at 6:02 PM, Stephan Beal wrote: > > > > > Hiya! > > > i'm not sure where to post bugs related to the Learning jQuery book, > > so i'll drop it here: > > > Page 309 says: > > > "The jquery.com Plugin Repository athttp://jquery.com/Plugins/ > > is a > > great place > > to start when looking for documentation." > > > That URL is a 404, though - "plugins" should be lower-case. > > > Perhaps the webmaster can adjust for that, rather than waiting on the > > next edition of the book. > > > :)
[jQuery] Re: Odd back-button behavior on 1.2 documentation pages
If ajax was used, you could load into a div and so not add to the history. Although you may have to have the external file with and tags, e.g. ... On Sep 11, 9:24 pm, "John Resig" <[EMAIL PROTECTED]> wrote: > The "loading" part isn't the issue - the issue is in running these > demos in a contained area that doesn't interfere with the rest of the > page (or the rest of the page interfere with it). > > --John > > On 9/11/07, Sam Collett <[EMAIL PROTECTED]> wrote: > > > > > Use Ajax and load into a div? > > > On Sep 11, 4:37 pm, "John Resig" <[EMAIL PROTECTED]> wrote: > > > We load the demos in an iframe, that must push it into the history. > > > Anyone have any thoughts? > > > > --John > > > > On 9/11/07, Scott Sauyet <[EMAIL PROTECTED]> wrote: > > > > > I've noticed something odd on the documentation pages. The back button > > > > is acting as though I've made multiple visits to the same page. For > > > > instance, if in a new browser window I visit > > > > > http://docs.jquery.com/Release:jQuery_1.2/Effects > > > > > I see seven entries in the Firefox's back-button drop-down, all pointing > > > > to the current page. I see the same behavior in IE6, IE7, and Op9. > > > > Safari3/win doesn't do this. > > > > > The number of entries in the history varies; and I think it's related to > > > > the number of demos on the page. Does it perhaps have to do with the > > > > Tabs? > > > > > Can anyone else at least confirm that I'm not simply crazy? > > > > >-- Scott
[jQuery] Re: Odd back-button behavior on 1.2 documentation pages
Use Ajax and load into a div? On Sep 11, 4:37 pm, "John Resig" <[EMAIL PROTECTED]> wrote: > We load the demos in an iframe, that must push it into the history. > Anyone have any thoughts? > > --John > > On 9/11/07, Scott Sauyet <[EMAIL PROTECTED]> wrote: > > > > > I've noticed something odd on the documentation pages. The back button > > is acting as though I've made multiple visits to the same page. For > > instance, if in a new browser window I visit > > > http://docs.jquery.com/Release:jQuery_1.2/Effects > > > I see seven entries in the Firefox's back-button drop-down, all pointing > > to the current page. I see the same behavior in IE6, IE7, and Op9. > > Safari3/win doesn't do this. > > > The number of entries in the history varies; and I think it's related to > > the number of demos on the page. Does it perhaps have to do with the Tabs? > > > Can anyone else at least confirm that I'm not simply crazy? > > >-- Scott
[jQuery] Re: Corner Plugin affects layout
I did manage to fix it, but set up a page showing the problems I have been having: With corner: http://www.nelctp.nhs.uk/default2.aspx Without: http://www.nelctp.nhs.uk/default2.aspx?nocorner The corner is applied to the two boxes in the middle (only very subtle corners). On Sep 10, 11:58 pm, "Christopher Jordan" <[EMAIL PROTECTED]> wrote: > Sam, I visited both links in your post (using IE6) and I can't see the > problem? Also, I don't see anything on either page that looks like the > corner plug-in has been applied. Hmmm... did you fix things already? :o/ > > Chris > > On 9/10/07, weepy <[EMAIL PROTECTED]> wrote: > > > > > > > that's an awesome plugin > > > On Sep 10, 3:59 pm, Sam Collett <[EMAIL PROTECTED]> wrote: > > > Using canvas instead of nested div's for the corner didn't help with > > > the layout (although it looks slightly better). The problem is caused > > > by the 'position: relative' added to the element with the corner > > > applied to it. > > > > On Sep 10, 2:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > ugin > > > > use this plugin:http://meerbox.nl/?page_id=4 > > > > works fine and it's pretty nice ;) > > --http://cjordan.us
[jQuery] Re: Corner Plugin affects layout
I tried to reproduce it in a test page, but was unable to. I solved it by using .css("position", "") There is a demo of the issue at http://www.nelctp.nhs.uk/default2.aspx And without corner plugin: http://www.nelctp.nhs.uk/default2.aspx?nocorner Which actually illustrates some problems with the pngfix plugin: http://khurshid.com/jquery/iepnghack/ On Sep 10, 11:37 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > Sam, > > Did you get this solved? I couldn't reproduce the error (IE7), but it > sounds like a classic "hasLayout" problem. > > Mike > > On 9/10/07, Sam Collett <[EMAIL PROTECTED]> wrote: > > > > > Using canvas instead of nested div's for the corner didn't help with > > the layout (although it looks slightly better). The problem is caused > > by the 'position: relative' added to the element with the corner > > applied to it. > > > On Sep 10, 2:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > use this plugin:http://meerbox.nl/?page_id=4 > > > works fine and it's pretty nice ;)
[jQuery] Re: Corner Plugin affects layout
Using canvas instead of nested div's for the corner didn't help with the layout (although it looks slightly better). The problem is caused by the 'position: relative' added to the element with the corner applied to it. On Sep 10, 2:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > use this plugin:http://meerbox.nl/?page_id=4 > works fine and it's pretty nice ;)
[jQuery] Re: Another site using jQuery...
It uses something else that does not use jQuery: http://www.barelyfitz.com/projects/tabber/ Something similar can be done with jQuery. e.g. http://www.texotela.co.uk/code/jquery/headertabs/ On Sep 10, 1:58 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Rick Faircloth wrote: > > Oops! Sorry about that, Klaus! > > > Rick > > Rick, no need to apologize of course! Just wanted to give a hint for how > to detect the tabs plugin :-) > > --Klaus
[jQuery] Corner Plugin affects layout
When I apply the corner plugin to an element on the page, the layout is affected when I hover over a link with padding. This only seems to occur in Internet Explorer (IE 6 and 7), and I am unable to find out the cause. To replicate, go to http://www.nelctp.nhs.uk Resize the browser window (making it bigger illustrates the problem better), the boxes in the middle should move (to stay in the centre), but they don't. Then mouse over one of the links on the right. The right box moves to the correct position when this happens. I know it is the corner plugin, as a test without it applied works: http://www.nelctp.nhs.uk/?nocorner
[jQuery] Re: validation plugin : conflict with formsess because of "{"
How about: $.meta.cre = /((?!\[)(.*)(?=\]))/; This will fail if you use class="foo [required: true]" but should be fine with class="[required: true] foo" For it to work like it does with {} (class names before and after are ignored), the meta data plugin would probably be have to be modified. On Aug 28, 1:25 pm, "Olivier Percebois-Garve" <[EMAIL PROTECTED]> wrote: > Thanks for your answers. > > Emil you are right at saying that it is not a jquery issue. > Its even more a formsess issue than a smarty issue, and thats why your > solution > wont work.Because of the formsess filters it produces something like: > > ##FS_SMARTY_LDELIM##ldelim##FS_SMARTY_RDELIM##required: > true##FS_SMARTY_LDELIM##rdelim##FS_SMARTY_RDELIM## > > So I'm looking more for a jquery solution. > Sam your solution goes in the direction I'm looking for, but it > produces an error: > > I tried with class="[required: true]" > and added $.meta.cre = /(\[.*\])/; in the jQuery(document).ready( > > Firebug says : invalid property id > > https://xxx.nondisclosabledomainname.com/subscription_new/js/jquery.m... > Line 98 > > in green: data = {[required: true]} > > -Olivier > > On 8/28/07, Sam Collett <[EMAIL PROTECTED]> wrote: > > > > > You could try adding this in $(document).ready, before calling the > > validate plugin: > > > $.meta.cre = /(\[.*\])/; > > $("#foo").validate(); > > > Although that is not documented in the meta data plugin (maybe there > > should be an option in it to do that). > > > On Aug 28, 9:05 am, "Olivier Percebois-Garve" <[EMAIL PROTECTED]> > > wrote: > > > Hi > > > > I'm having an issue with the validation plugin. It conflicts with a > > > smarty-based php class named formsess. > > > It does not allow signs such as "{" in form tags. > > > Sounds like hell to go modify formsess, so I hope to find a way to > > change > > > that in the validation plugin. > > > Could it be possible to replace class="{required: true}" with > > > class="[required: true]" ? > > > > thanks > > > > -Olivier
[jQuery] Re: Recursive setting of names in jquery
The way I would do this is get all inputs with a name beginning with 'total' then use .each: // save jQuery object for later use $totals = $("[EMAIL PROTECTED]"); $totals.each( function() { // get letter var letter = this.name.substr(5); if(letter == "A") this.value = "Total A"; }); On Aug 28, 5:00 am, Brett <[EMAIL PROTECTED]> wrote: > Hello there, I've been loving jQuery so far - so efficient, and a > great piece of code to work with. > > I was wondering if it is possible to use jQuery in a loop where I need > to set a row of values in. > For example if there was a set of input boxes named totalA - totalE. > To change the first, I would use: > $("[EMAIL PROTECTED]'totalA']").val("the value I want to put on this > form"); > > But is there a way I can make @name a variable, or a combination of > strings? > @name='total' + currentLetter Does not work like I thought it > would have.. > I think there is something fundamentally wrong that I'm doing...
[jQuery] Re: Why isn't there top() and left() methods in the dimension plugin ?
On Aug 28, 1:59 pm, "Olivier Percebois-Garve" <[EMAIL PROTECTED]> wrote: > Wow your too fast guys. > It seems that I was using offset() the wrong way. > > $left = element.offset().left; > $top = element.offset().top; The only problem with that is you are calling offset twice (which may impact performance). I would do: $offset = element.offset(); $left = $offset.left; $top = $offset.top;
[jQuery] Re: validation plugin : conflict with formsess because of "{"
You could try adding this in $(document).ready, before calling the validate plugin: $.meta.cre = /(\[.*\])/; $("#foo").validate(); Although that is not documented in the meta data plugin (maybe there should be an option in it to do that). On Aug 28, 9:05 am, "Olivier Percebois-Garve" <[EMAIL PROTECTED]> wrote: > Hi > > I'm having an issue with the validation plugin. It conflicts with a > smarty-based php class named formsess. > It does not allow signs such as "{" in form tags. > Sounds like hell to go modify formsess, so I hope to find a way to change > that in the validation plugin. > Could it be possible to replace class="{required: true}" with > class="[required: true]" ? > > thanks > > -Olivier
[jQuery] Re: jQuery 1.1.4: Faster, More Tests, Ready for 1.2
On Aug 24, 8:31 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Bernd Matzner wrote: > > Thanks to everyone on the dev team for the new release! > > > @Klaus: are you planning to update your tabs plugin to the new > > release? It uses eq(), which I understand are deprecated now. > > I'd rather work on UI Tabs aka Tabs 3 at the moment... :-) > > But ok, I'll fix that, I only need to figure out a way to support both > 1.1.4 and less than 1.1.4 versions. > > --Klaus You could always use .filter(":eq(0)"), which should make it 1.2 compatible as well.
[jQuery] Re: jQuery 1.1.4: Faster, More Tests, Ready for 1.2
You can still have slide by doing a plugin: $.fn.slide = function(dir) { if(!dir || dir == "leftright") this.animate({width:'toggle'}, "slow"); else if(dir == "updown") this.animate({height:'toggle'}, "slow"); } $("#foo").slide("leftright"); $("#bar").slide("updown"); Infact maybe slideUp, slideDown and slideToggle should be deprecated in favour of a .slide method (something for 1.2)? $("#foo").slide("width", "toggle", "slow"); $("#foo2").slide("width", "show", "slow"); $("#bar").slide("height", "toggle", "slow"); $("#bar2").slide("height", "show", "slow"); You can probably use .animate() for something like this, but shortcuts can be far better (especially if they are used a lot) - slightly more jQuery code, but less overall code. On Aug 24, 4:38 pm, Michael Stuhr <[EMAIL PROTECTED]> wrote: > Andy Matthews schrieb:> He might have misread the slice() function? > > that's a 2.0 feature (or better shall be) ... > > micha
[jQuery] Re: Comparison of different compressed jQuery Versions with GZip
Perhaps it should be part of the build process? So you can get packed, min'd and YUI'd versions of jQuery. On Aug 23, 12:43 pm, "Tane Piper" <[EMAIL PROTECTED]> wrote: > Julien Lecomte has just released 1.1 of his YUI Compressor. As a > test, he decided to use jQuery with GZip and came up with some > interesting results compared to packer! > > http://www.julienlecomte.net/blog/2007/08/21/gzip-your-minified-javas... > > -- > Tane Piperhttp://digitalspaghetti.me.uk > > This email is: [ x ] blogable [ ] ask first [ ] private
[jQuery] Re: Loading remote JavaScript
On Aug 21, 2:19 pm, Christof Donat <[EMAIL PROTECTED]> wrote: > Hi, > > > I'm aware of that method, but I want a callback to find out what > > content type was loaded, display it if text/html or execute it if text/ > > javascript. > > $('http://example.com/myscript.js"; type="text/javascript">'). > appendTo('head'); > $('