Re: [jQuery] Question on bookmarklets
Hi, I'm not sure if this is what you mean, but this is sort of useful: javascript:(function(){var s,d=document,a=function(o){d.body.appendChild(o)}; s=d.createElement('script'); s.type='text/javascript'; s.src='http://example.com/jquery.js';a(s)})(); Nuke the newlines, of course, and turn that into a bookmarklet. You would host a copy of jquery.js on your site, not example.com. Then you can run that, and click a second bookmarklet that you write which contains jQuery code. HTH -p@ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] BUG: Rebinding an event in IE
John Resig wrote: I /think/ this has to do with the fact that if you bind events inside of an event, in IE, then the new events will fire again too, causing the browser to go into a never-ending loop. You just need to be really careful about binding duplicate event handlers in IE (at least for now, until jQuery offers some alternative). John, Thanks for the response. I wasn't sure to view this as a jQ bug or an IE bug. I guess since nothing is immediately popping out as wrong with jQ's event posting and that some kludgey (and bloated) workaround would need to be made to make IE behave correctly -- then, it can be considered an IE bug -- as such, I'd leave it alone. I am curious to know if IE7 handles this properly, though haven't yet tried to see if a beta would run under WINE. ~ Brice -- View this message in context: http://www.nabble.com/BUG%3A-Rebinding-an-event-in-IE-tf2510315.html#a7005791 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Question on bookmarklets
Truppe Steven schrieb: Hello everyone, i would find it usefull to use jQuery for bookmarklets (because jQuery code is so short) but also on pages that do no include jQuery in their pages. Is there a way to do that ?? Is there a way to just add jQuery into the head of the document loaded ? best regards, Truppe Steven Hi, have a look at this Microformats bookmarklet: http://leftlogic.com/info/articles/microformats_bookmarklet It uses jQuery... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
This is some great code, Stefan and Paul - implementing nested Drag-and-Drop lists is never easy, and I like the end result. Can't wait to use it! --John On 10/23/06, Stefan Petre [EMAIL PROTECTED] wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- John Resig http://ejohn.org/ [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery Global Events Slightly Askew
So I noticed something recently when I found out about, and played around with, those zany global event triggers. If you add two different events of the same type to the same element, when you call the global event trigger for that type, each event will get called twice. Example: func1 = function() { window.alert(1); }; func2 = function() { window.alert(2); }; $('#box').click(func1).click(func2); jQuery.event.trigger('click'); Problem: You should see 1 and 2 both alerted twice. Luckily there's a quick and painless fix to this. Inside the event.trigger function if the line var g = this.global[type]; is changed to var g = jQuery.map(this.global[type],a); jQuery.map will make sure there are no duplicate elements in the list before it is iterated through to call the events. Pretty esoteric bug but a bug nonetheless. -- blair ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
We both had some fresh ideas, but the credits for the code go to Stefan :)Great work!I will help out Stefan in testing and smoothing the result with some effects, then we'll come back with a somewhat final version. Paul2006/10/26, John Resig [EMAIL PROTECTED]: This is some great code, Stefan and Paul - implementing nestedDrag-and-Drop lists is never easy, and I like the end result. Can'twait to use it!--JohnOn 10/23/06, Stefan Petre [EMAIL PROTECTED] wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/--John Resighttp://ejohn.org/ [EMAIL PROTECTED]___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ -- Paul BakausWeb DeveloperHildastr. 3579102 Freiburg ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] tableSorter - where has that guy gone...
First, I think that it is cool, I used this plugin in my project and it is very simple, develop time ( in seconds) I like it :D.But only one thing, in header click you need return false if you don't want scroll up to the start of the page (normally click in a link with href="" scroll up the browser, this is fixed using some like a href="" false;). I fixed table sorted returning false at the end of onClick event:jQuery(.sorter,oCell).click(function(e) {[]return false;}2006/10/26, Christian Bach [EMAIL PROTECTED]:Well what can i say? I'm late as usual... Down to business, i finally got to spend some quality time together withmy trusting companion the tableSorter. I squashed the tfoot bug so it onlyindexes td elements inside the tbody element.And added a new parameter called bind. The bind parameter is kind of cool (well at least i think so). What it doesis to allow you to set the alias on which event the tablesorter willtrigger a resort.To clarify here is some sample code: $('#myTable').tableSorter(bind: 'resort');Ok, so the users has updated a table row or perhaps you have inserted someelement to the table, well this calls for a resort on the last sorted column, right? Well all you have to do is call your binded event to makeit resort.$('#myTable').resort();Or if you prefer$('#myTable').trigger(resort);A demo is located here: http://cbach.jquery.com/demo.htmlAnd the latest source code is now located in the jQuery svnunder plugins/tablesorter___ jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] new plugin: unobtrusive CRIR (Checkbox And Radio Image Replacement)
So i've made yet another plugin. I prefer that this plugin will be a part of Interface, since they are interface plugins. As for now i have it working for Checkboxes in both FF 1.5.0.7 and MSIE 6.x, but i want to do some more testing. *What's new?* I've made quite a few improvements upon the other implementations found on this list, but the code is still very simple and easy to understand/use. The checkbox/radio can have a lot of states; - off: no mouse over - off: mouse over - off: mouse down - on: no mouse over - on: mouse over - on: mouse down - disabled: no mouse over -- All will be automaticly styled using CSS. *Demo?* A demo URL will be up within a week. This plugin has a higher priority then the window plugin. I know you guys are all waiting on the window plugin, but i want to release this plugin, and maybe other UI widgets... *Refactoring needed?* Right now, all CSS classes for the above mentioned states must be defined, but i am thinking about refactoring this technique into a new plugin for which you can specify options, since we can also use this technique for buttons and some other widgets.. If i decide to do this, a demo will be up in 2 weeks or so... *Screenshots!* If you want to see how the end result CAN look, take a look at the Today screen in Live Messenger and at the bottom there is a checkbox. Or check this site: http://www.webunity.nl/upload/crir_demo.png To be continued... -- Gilles ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] new plugin: unobtrusive CRIR (Checkbox And Radio Image Replacement)
Seems to be a nice addition for Interface. I'm looking forward to your Window plugin as well. Slowly interface seems to grow into a full featured gdi replacement ;-)2006/10/26, [EMAIL PROTECTED] [EMAIL PROTECTED]: So i've made yet another plugin. I prefer that this plugin will be a partof Interface, since they are interface plugins. As for now i have itworking for Checkboxes in both FF 1.5.0.7 and MSIE 6.x, but i want to dosome more testing.*What's new?*I've made quite a few improvements upon the other implementations found onthis list, but the code is still very simple and easy to understand/use. The checkbox/radio can have a lot of states;- off: no mouse over- off: mouse over- off: mouse down- on: no mouse over- on: mouse over- on: mouse down- disabled: no mouse over-- All will be automaticly styled using CSS. *Demo?*A demo URL will be up within a week. This plugin has a higher prioritythen the window plugin. I know you guys are all waiting on the windowplugin, but i want to release this plugin, and maybe other UI widgets... *Refactoring needed?*Right now, all CSS classes for the above mentioned states must be defined,but i am thinking about refactoring this technique into a new plugin forwhich you can specify options, since we can also use this technique for buttons and some other widgets.. If i decide to do this, a demo will be upin 2 weeks or so...*Screenshots!*If you want to see how the end result CAN look, take a look at the Todayscreen in Live Messenger and at the bottom there is a checkbox. Or check this site: http://www.webunity.nl/upload/crir_demo.pngTo be continued...-- Gilles___ jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/-- Paul Bakaus Web DeveloperHildastr. 3579102 Freiburg ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] new plugin: unobtrusive CRIR (Checkbox And Radio Image Replacement)
Nice, I need this for a project. I don't like such things, but the client really likes it .About windows: i made a change in resizeables to drag resized element with the same rules as resizing (minTop, minLeft,maxBottom, maxRight). You can use a handler to drag it, or the element itself. At this point making windows with resizeables is quite easy. 2006/10/26, [EMAIL PROTECTED] [EMAIL PROTECTED]: So i've made yet another plugin. I prefer that this plugin will be a partof Interface, since they are interface plugins. As for now i have itworking for Checkboxes in both FF 1.5.0.7 and MSIE 6.x, but i want to dosome more testing.*What's new?*I've made quite a few improvements upon the other implementations found onthis list, but the code is still very simple and easy to understand/use. The checkbox/radio can have a lot of states;- off: no mouse over- off: mouse over- off: mouse down- on: no mouse over- on: mouse over- on: mouse down- disabled: no mouse over-- All will be automaticly styled using CSS. *Demo?*A demo URL will be up within a week. This plugin has a higher prioritythen the window plugin. I know you guys are all waiting on the windowplugin, but i want to release this plugin, and maybe other UI widgets... *Refactoring needed?*Right now, all CSS classes for the above mentioned states must be defined,but i am thinking about refactoring this technique into a new plugin forwhich you can specify options, since we can also use this technique for buttons and some other widgets.. If i decide to do this, a demo will be upin 2 weeks or so...*Screenshots!*If you want to see how the end result CAN look, take a look at the Todayscreen in Live Messenger and at the bottom there is a checkbox. Or check this site: http://www.webunity.nl/upload/crir_demo.pngTo be continued...-- Gilles___ jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] PLUGIN: In place AJAX editing of TableSorter
OK! Plugin has been updated to; A) Only update changed columns B) Work with HTML Form elements (input[checkbox/radio/text],select,textarea) C) Not crash IE If anyone has any comments or suggestions, I'm all ears. Demo page: http://dev.iceburg.net/jquery/tableEditor/demo.php ~ Brice -- View this message in context: http://www.nabble.com/PLUGIN%3A-In-place-AJAX-editing-of-TableSorter-tf2506135.html#a7008407 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
Great work! I already liked the previous sortable functionality and I use it in a project right now to manipulate the navigation tree in the admin panel, but this is outstanding! I can't await to use it either! I don't have Safari / Linux to test, but I gave it a try in Swift which uses the Safari engine. Everything is working but when a drag drop starts, other elements are covered in gray - probably a transparency issue. But I would guess this is a Swift problem and it should run in Safari. Felix Geisendrfer aka the_undefined -- http://www.thinkingphp.org http://www.fg-webdesign.de Paul Bakaus schrieb: We both had some fresh ideas, but the credits for the code go to Stefan :) Great work! I will help out Stefan in testing and smoothing the result with some effects, then we'll come back with a somewhat final version. Paul 2006/10/26, John Resig [EMAIL PROTECTED]: This is some great code, Stefan and Paul - implementing nested Drag-and-Drop lists is never easy, and I like the end result. Can't wait to use it! --John On 10/23/06, Stefan Petre [EMAIL PROTECTED] wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- John Resig http://ejohn.org/ [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Paul Bakaus Web Developer Hildastr. 35 79102 Freiburg ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
Works great in Firefox 1.5.0.7 under Linux as far as I can tell. Awesome! (Random thought: Hooking this up to keyboard commands would be an interesting basis for a hierarchichal list editing/outlining app... ) -p@ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
Really like the look of this, I'll test in safari when my colleague gets in with his Mac. Works a treat on Firefox/Linux :D Great work. Original Message: - From: Stefan Petre [EMAIL PROTECTED] Date: Thu, 26 Oct 2006 08:16:25 +0300 To: discuss@jquery.com Subject: Re: [jQuery] Sortables, new approach Hi James and Norbert, http://interface.eyecon.ro/demos/test_sort.html check this again. I really need some one to test this on Safari 2 because I have only Safari 1.3 James Hall wrote: Hey, Really like the look of this. :) Good work. At the moment, you can drag children out from there parents, and move them up a level. But you can't drag nodes into other nodes as children, unless it already has children. If that makes sense. Example: I can make 3-2 a child of 1-2, by dropping it just above 1-2-1. But I can't make 3-2 a child of 'option 4'. For a tree - not only do you need droppable areas in-between each node, but also ON each node. Say, when i drag over 'option 4', its background color could change, and when I drop, the dropped node will then become a child of 'option 4'. Basically, being able to do what this backbase example does - along with the reordering you've already come up with: http://www.backbase.com/demos/explorer/#examples/drag-treelist.xml[5] What do you think? Would something like this be fairly easy to do with the way it has been built? I'll have a play with the code over the next few days because this would be really useful to me. I'll let you know how I get on. Regards, James On Mon, 2006-10-23 at 22:44 +0300, Stefan Petre wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ mail2web - Check your email from the web at http://mail2web.com/ . ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
I realise it's just a draft but in IE6, when dragging nodes, the text is selected. To fix that, change: ul class=test to ul onselectstart = return false That can also be set using javascript too. Original Message: - From: Stefan Petre [EMAIL PROTECTED] Date: Thu, 26 Oct 2006 08:16:25 +0300 To: discuss@jquery.com Subject: Re: [jQuery] Sortables, new approach Hi James and Norbert, http://interface.eyecon.ro/demos/test_sort.html check this again. I really need some one to test this on Safari 2 because I have only Safari 1.3 James Hall wrote: Hey, Really like the look of this. :) Good work. At the moment, you can drag children out from there parents, and move them up a level. But you can't drag nodes into other nodes as children, unless it already has children. If that makes sense. Example: I can make 3-2 a child of 1-2, by dropping it just above 1-2-1. But I can't make 3-2 a child of 'option 4'. For a tree - not only do you need droppable areas in-between each node, but also ON each node. Say, when i drag over 'option 4', its background color could change, and when I drop, the dropped node will then become a child of 'option 4'. Basically, being able to do what this backbase example does - along with the reordering you've already come up with: http://www.backbase.com/demos/explorer/#examples/drag-treelist.xml[5] What do you think? Would something like this be fairly easy to do with the way it has been built? I'll have a play with the code over the next few days because this would be really useful to me. I'll let you know how I get on. Regards, James On Mon, 2006-10-23 at 22:44 +0300, Stefan Petre wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ mail2web - Check your email from the web at http://mail2web.com/ . ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Has anybody done this?
Here is my little plugin to create dom element:http://204.13.69.149/~wang/My questions are:1, Has anybody done this before?2, As it's my first crack on jQuery, anything wrong with the api call? 3, Is there any more elegant solutions?-- Best regardsLinan Wang ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] conflict iTooltip and ifx.js in IE
Hi jQueries, I found a bug: if itooltip.js comes with the ifx.js in the same document, the tooltip only appears once in IE. Here's an simplified example: http://test.webdebug.de/tmp/jquery/itoolfx.html does anybody have an solution or an idea to fix it? -- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Has anybody done this?
Linan Wang schrieb: Here is my little plugin to create dom element: http://204.13.69.149/~wang/ My questions are: 1, Has anybody done this before? 2, As it's my first crack on jQuery, anything wrong with the api call? 3, Is there any more elegant solutions? -- Best regards Linan Wang There are other plugins out there for DOM creation, and I think the example snippet could be done with jQuery alone: $('table/table').css(...).append('tr/tr').find('tr').append('td/td')... OK, maybe it is not as elegant. I wouldn't call the method tag(), because a tag is not an element and elements (nodes) is what you create. More about this here: http://lachy.id.au/log/2004/12/html-tags -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] conflict iTooltip and ifx.js in IE
Eckhard Rotte wrote: Hi jQueries, I found a bug: if itooltip.js comes with the ifx.js in the same document, the tooltip only appears once in IE. Here's an simplified example: http://test.webdebug.de/tmp/jquery/itoolfx.html does anybody have an solution or an idea to fix it? -- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ Hi, I will take look over it ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
I know about this, will be fixed. [EMAIL PROTECTED] wrote: I realise it's just a draft but in IE6, when dragging nodes, the text is selected. To fix that, change: ul class=test to ul onselectstart = return false That can also be set using javascript too. Original Message: - From: Stefan Petre [EMAIL PROTECTED] Date: Thu, 26 Oct 2006 08:16:25 +0300 To: discuss@jquery.com Subject: Re: [jQuery] Sortables, new approach Hi James and Norbert, http://interface.eyecon.ro/demos/test_sort.html check this again. I really need some one to test this on Safari 2 because I have only Safari 1.3 James Hall wrote: Hey, Really like the look of this. :) Good work. At the moment, you can drag children out from there parents, and move them up a level. But you can't drag nodes into other nodes as children, unless it already has children. If that makes sense. Example: I can make 3-2 a child of 1-2, by dropping it just above 1-2-1. But I can't make 3-2 a child of 'option 4'. For a tree - not only do you need droppable areas in-between each node, but also ON each node. Say, when i drag over 'option 4', its background color could change, and when I drop, the dropped node will then become a child of 'option 4'. Basically, being able to do what this backbase example does - along with the reordering you've already come up with: http://www.backbase.com/demos/explorer/#examples/drag-treelist.xml[5] What do you think? Would something like this be fairly easy to do with the way it has been built? I'll have a play with the code over the next few days because this would be really useful to me. I'll let you know how I get on. Regards, James On Mon, 2006-10-23 at 22:44 +0300, Stefan Petre wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ mail2web - Check your email from the web at http://mail2web.com/ . ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] stopPropagation case
Hello,I've got a question:In simple js applying of stopPropagation looks like !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//ENHTMLHEADTITLE New Document /TITLE META NAME=Generator CONTENT=EditPlusscript type=text/_javascript_ function stopBubble(e) { var e = e || window.event; e.cancelBubble = true; // stops IE if (e.stopPropagation) { // stops others e.stopPropagation(); } } function showTest() { alert(Test); } /script/head bodydiv id=wrapper > awd1 div id=square > div id=glassawd3/div /div/BODY/HTMLIs there anyway to apply stopPropagation in more beautiful way to #square in jQuery than that $('#wrapper').click(function(){alert( this.id);}); // shows wrapper id $('#square').click(function(e){e.stopPropagation();});???-- С уважением, Марат Мамяшев ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] stopPropagation case
Is there anyway to apply stopPropagation in more beautiful way to #square in jQuery than that $('#wrapper').click(function(){alert( this.id http://this.id);}); // shows wrapper id $('#square').click(function(e){e.stopPropagation();}); ??? Hi, what is wrong with e.stopPropagation(), except for the long method name? jQuery provides that method for IE as well and why having to remember another function name if the standard works cross browser through jQuery... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Has anybody done this?
Here is my little plugin to create dom element: http://204.13.69.149/~wang/ My questions are: 1, Has anybody done this before? 2, As it's my first crack on jQuery, anything wrong with the api call? 3, Is there any more elegant solutions? As Klaus said, the name is a bit off but I do think this approach has some promise. Right now I am using Mike Geary's DOM creation functions. http://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype I like them because (unlike string building and innerHTML) there are no gotchas with the contents of the strings you put into the DOM functions. However, the $.DIV syntax is not pretty. More important, doing things in the natural way involves attaching event handlers before the element is added to the document tree, which causes a small memory leak in IE6. Since dom() changes the selected nodes, jQuery convention says it should use pushStack to save the previous set of nodes. Building a DOM tree often several levels, though, so a pushStack on every element could result in a lot of pushed state that you don't care about. Let's say I want to create a list like ullione/lilitwo/li/ul. How would I do that with tag()? I can only pass in one tag, and it's always appended as a child. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] ajax start/stop/error - what I'm doing wrong?
Hi there! I'm having some troubles with ajaxStart/Stop/Error etc. I can't make them work. Here's a small test page: http://stamen.lasvegas-nevada.com/jq/ajtest.html If you look at the code you'll see what I mean. Seems that this block: $(#loader) .ajaxStart (function () {$(#loader).append(pstarted.../p);}) .ajaxStop (function () {$(#loader).append(pstopped.../p)}) .ajaxError (function () {$(#loader).append(p class='error'error.../p)}) .ajaxSuccess (function () {$(#loader).append(psuccess!/p)}); Doesn't work at all. Using jQuery: * $Date: 2006-10-09 20:23:18 -0400 (Mon, 09 Oct 2006) $ * $Rev: 413 $ Can somebody help me? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] stopPropagation case
Yeah! Just thought maybe there'se more elegant way to bubble event? Something like that:$('#wrapper').not(#square).click(function(){alert(this.id );}); And of course I know that not() doesn't work in such a case.Do you understand what I mean?2006/10/26, Klaus Hartl [EMAIL PROTECTED]:Hi,what is wrong with e.stopPropagation(), except for the long method name? jQuery provides that method for IE as well and why having to rememberanother function name if the standard works cross browser through jQuery...-- Klaus -- С уважением, Марат Мамяшев ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] siblings() expression bug?
Perhaps you're right. But, in the mean time, you could always use $('label').siblings().find('input,textarea').addClass('blah'); - Brian Hey, this is my first post to discuss@ and I'm new to jQuery though I'm loving it. I don't know if this is a bug or not... Shouldn't $('label').siblings('input,textarea').addClass('blah'); work? $('input,textarea').addClass('blah') works (but not at the scope of items that are siblings to labels. $('label').siblings('input').addClass('blah').end().siblings ('textarea').addClass('blah').end(); also works for what I'm doing, but it seemed to me the expression in siblings should work the same way as an expression in $(). Am I wrong on that? Thanks in advance, Gavin ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Scroll document if draggable leaves viewport
Hi jQueries, i've posted this mail 2 times ago, but it didn't appear in the mailing list. Only the web frontend did get it, nothing in my inbox. Did you get it? I'll try it once again: - Is it possible to get a scrolling feature for any drag/droppable? For Example: If you leave the viewport with an object and the document body is longer or wider than the viewport, the document scrolls connected to the mouse position. This YUI demo is a good example: http://developer.yahoo.com/yui/examples/dragdrop/ontop.html?mode=dist Is somebody working on it or did I miss it in the documentation? Or is there a simple way to implement this feature? regards ecki -- -- Eckhard Rotte Goesselstr. 10 | 28215 Bremen Tel. 0421 - 3909547 | Mobil: 0176-23498896 Skype: eckirotte | AIM/iChat: eckiprivat mailto:[EMAIL PROTECTED] -- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery on mozilla
On Oct 26, 2006, at 12:00 AM, Will Jessup wrote: Wanted to point out this jQuery implementation I was lucky enough to do : http://www.digg.com/software/ Mozilla_releases_Friends_of_Firefox_followup_to_worldfirefoxday2006 How totally cool! Way to go, Will! Congrats to Will, and also to John and Dylan for the good exposure to their fantastic work! Cheers! Karl p.s. please excuse the overabundance of exclamation points. ___ Karl Swedberg www.englishrules.com www.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ajax start/stop/error - what I'm doing wrong?
Hi, thats a bug in 1.0.2 http://jquery.com/dev/bugs/bug/265/ Its fixed in SVN. Jan Stamen Georgiev wrote: Hi there! I'm having some troubles with ajaxStart/Stop/Error etc. I can't make them work. Here's a small test page: http://stamen.lasvegas-nevada.com/jq/ajtest.html If you look at the code you'll see what I mean. Seems that this block: $(#loader) .ajaxStart (function () {$(#loader).append(pstarted.../p);}) .ajaxStop (function () {$(#loader).append(pstopped.../p)}) .ajaxError (function () {$(#loader).append(p class='error'error.../p)}) .ajaxSuccess (function () {$(#loader).append(psuccess!/p)}); Doesn't work at all. Using jQuery: * $Date: 2006-10-09 20:23:18 -0400 (Mon, 09 Oct 2006) $ * $Rev: 413 $ Can somebody help me? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/ajax-start-stop-error---what-I%27m-doing-wrong--tf2513841.html#a7011025 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Events are not cloned together with the object
Hi, Is there a way to clone events of an object that is being cloned in one go. Because right now when I clone an object its events are not copied across. Cheers ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
Do you expect to release this as a new SortableTree plugin, or would this replace the existing Sortables? More to the point, if this *did* replace Sortables, is it backwards compatible with the existing version? Stefan Petre wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. -- View this message in context: http://www.nabble.com/Sortables%2C-new-approach-tf2497066.html#a7011565 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Opera 9.02 and events
Sorry. Yes, I did get that. I was just intent on getting it to work the way I wanted it to. And thanks for the explanation of what goes on with p in the DOM. Aaron Ullom Netphoria, Inc. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Klaus Hartl Sent: Wednesday, October 25, 2006 5:00 PM To: jQuery Discussion. Subject: Re: [jQuery] Opera 9.02 and events Aaron Ullom schrieb: Klaus, I tried various doctypes, but nothing seemed to work. In the end I relented and simply used after() to insert my form. Opera instantly began behaving as FF and IE do. Aaron Ullom Netphoria, Inc. Haved you read my mail? That was exactly what I was trying to clarify in my description... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] performance optimizations?
Hi, I've just been using Jquery for a few days and WOW, this has been very productive for me. This is fantastic work all around. I do have two questions I'm hoping someone might know something about: 1) Where can I find a searchable archive of this mailing list, because I'd hate to ask questions that have already been answered. 2) I'm getting about a 1.5 second pause when the page loads up, even when on my local system, which appears to be when my jquery commands execute. It's just a little too long, my client noticed right away. Are there any tricks to help this out? For example is it better to use xpath or css type searches for better performance? I've learned the trick about using .end() correctly to reset searches without starting from scratch, and that helped a bit but it's not quite enough. I know this is a pretty open ended question please let me know if I can help clarify it. If I can get this performance thing fixed up a bit I hope some of my plugins can be useful to the community. Thanks!!! --john __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] performance optimizations?
On 26/10/06, John Napiorkowski [EMAIL PROTECTED] wrote: Hi, I've just been using Jquery for a few days and WOW, this has been very productive for me. This is fantastic work all around. I do have two questions I'm hoping someone might know something about: 1) Where can I find a searchable archive of this mailing list, because I'd hate to ask questions that have already been answered. You could try searching using Nabble: http://www.nabble.com/JQuery-f15494.html 2) I'm getting about a 1.5 second pause when the page loads up, even when on my local system, which appears to be when my jquery commands execute. It's just a little too long, my client noticed right away. Are there any tricks to help this out? For example is it better to use xpath or css type searches for better performance? Perhaps show a loading message could be of some help, as it may seem it is slow for some clients. If the code you are executing works though many nodes (i.e. table cells in a large table), that could be the cause of the delay. AFAIK XPath just maps to a CSS expression (I mostly use CSS myself). I've learned the trick about using .end() correctly to reset searches without starting from scratch, and that helped a bit but it's not quite enough. I know this is a pretty open ended question please let me know if I can help clarify it. If I can get this performance thing fixed up a bit I hope some of my plugins can be useful to the community. Thanks!!! --john __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] I need help with the jQuery .click event
Hi Mike! But watch out for page load time when you are setting up this many event handlers. I was doing this for a poup calendar widget, and the load time was noticeable on a slow machine. I ended up installing a single event handler for the entire calendar and doing my own hit testing on the click and other mouse events. It was more work, but it makes the calendar open faster. I don't know what the calendar did look like, but maybe the event.target property would help. Fixes for IE and Safari are now in SVN, therefore you can rely on the property. -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improved Event system new Accordion
2006/10/26, Jörn Zaefferer [EMAIL PROTECTED]: Hi folks, Hi, Jörn, I just commited a few changes to jQuery's event system. I fixed the target property of the event.target for both IE and Safari, and modified bind: It now accepts an optional third parameter that specifies the number of times the handler has to executed. When that amount is reached, it removes the handler. All onexxx events like oneclick now use that option and potentiolly provide better performance. Good job! (Jörn is back!!!) I updated the accordion plugin to demonstrate and test these changes: http://joern.jquery.com/accordion/accordion.html Your version relies on the way the menu is described. In extenso, it must be a definition list. Couldn't it be more independant? Is that about semantic? Here is the lastest version of the manner I did it: http://fmarcia.com/projets/jquery/accordion (click on ici to see the source code). I stayed with the rationale to set it not chainable, contrary to yours (but I'm not very sure about it... :-p ) Cheers, Franck. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] siblings() expression bug?
Perhaps you're right. But, in the mean time, you could always use $('label').siblings().find('input,textarea').addClass('blah'); I guess that should be rather: $('label').siblings().filter('input,textarea').addClass('blah'); -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How to cache jQuery
Hello, i use jQuery on multiple pages of my site so it would be nice to make sure that this file is only loaded once and not on every menu change. Is there a cross-browser way (for jQuery supported browsers) to cache the file and make it load only once ? best regards, Truppe Steven ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] performance optimizations?
2) I'm getting about a 1.5 second pause when the page loads up, even when on my local system, which appears to be when my jquery commands execute. It's just a little too long, my client noticed right away. Are there any tricks to help this out? For example is it better to use xpath or css type searches for better performance? To me, 1.5 seconds is an eternity. Can you post a link to the code, or maybe just the startup code? How big is the page? I think Xpath and css selector speeds are about the same. Avoid selectors like $(.myclass) on a big document, because it has to look at every element. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] performance optimizations?
Hi, Are there any tricks to help this out? For example is it better to use xpath or css type searches for better performance? You may speed your code up ba choosing the selector. Usually just searching for the id ahould be the fastest: $('#myid'). Number Two is searching for the tag type: $('li'). Searching for classes is rather slow: $('.myclass'). If your page contains many elements, then using a context might speed up the search for classes: $('.myclass',$('#commonAncestor')[0]). I've learned the trick about using .end() correctly to reset searches without starting from scratch, and that helped a bit but it's not quite enough. You can try and cache results, speedup loops in callbacks, etc. There are many possible ways to improve JS-code, but without any code I guess noone can really help. I do think that there are some spots in jQuery where the performance could be improved. We have that discussion here once in a while. It basically comes out to be a tradeof between readability and speed. Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
Truppe Steven schreef: Hello, i use jQuery on multiple pages of my site so it would be nice to make sure that this file is only loaded once and not on every menu change. Is there a cross-browser way (for jQuery supported browsers) to cache the file and make it load only once ? Maybe a solution that is to simple to be the one you want: isn't it possible to load every page in a master page then you can put jquery.js in the masterpage. -- David Duymelinck [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
Hi, i use jQuery on multiple pages of my site so it would be nice to make sure that this file is only loaded once and not on every menu change. Is there a cross-browser way (for jQuery supported browsers) to cache the file and make it load only once ? Yes: Make it a normal file. The browser decides on his own which files it should cache and how long. It usually takes some information from the server into account and may even try a HEAD request to get the last modification-date of the file before deciding to reload it. Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
Truppe Steven wrote: i use jQuery on multiple pages of my site so it would be nice to make sure that this file is only loaded once and not on every menu change. Is there a cross-browser way (for jQuery supported browsers) to cache the file and make it load only once ? Your browser should be doing this on its own. Do you have actual evidence it's not happening, or are you just asking? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] I need help with the jQuery .click event
Mike, I've reread your response by the light of day, and I'm curious about what you said at the bottom; But watch out for page load time when you are setting up this many event handlers. I was doing this for a poup calendar widget, and the load time was noticeable on a slow machine. I ended up installing a single event handler for the entire calendar and doing my own hit testing on the click and other mouse events. It was more work, but it makes the calendaropen faster. I'm concerned about my page execution times on slower machines. I've got some other pages with lots of _javascript_, and they seem to be a bit slower on slow machines. I'm wondering if I need to implement something like a custom event handler, but I've never written one. Could you point me to an online resource that would give me a quick rundown of how to do this? I'm searching the web right now, but haven't hit on anything just yet. Truth to tell, I wouldn't mind if you gave me a quick rundown (if you had the time), because you're previous explanation was so clear and easy to understand. You *do not* by any means have to do this, a simple link to an online resource (if you -- or anyone for that matter -- knows of one) would be fine. Thanks, Chris Michael Geary wrote: I see Klaus posted a very clean solution, but just to help you understand what went wrong... Pretend you are the_javascript_ interpreter, executing the code inside your click handler function after a click.You encounter the variable name "i" and need to find its value. Since "i" isn't defined in the innermost function, you look outside and find the "i" that was used as the loop variable in your outer function. But the for loop has already finished executing at this point! What's the value of "i" after the for loop is done? 30. If Klaus's solution didn't work for any reason, or if you ever need a solution that will work in any _javascript_ environment, you cansimply wrap your code inside a function to capture the value of "i" each time through the loop: (function( i) { $("##id_" + i).click( function(){ foo(i,ConstantArgument); } ); })( i ); Now when you pretend to be the _javascript_ interpreter and find a value for "i" in that inner foo() call, you'll find the "i" in this wrapper function - and that's a new "i" each time because this wrapper function get called separately each time through the loop. It doesn't have to be an anonymous function - it's probably more readable to break it out as a separate named function. While we're at it, let me show you another way to write your code that builds the HTML string. function add( i) { $('#MyContainerID').append([ 'span id="id_', i, '" class="MyClass" value="', i, '"', i, '/span' ].join('')); $('#id_' + i).click( function(){ foo(i,ConstantArgument); }); } Call add(i) in your for loop and you are golden. Place the add() function definition inside the same function as the for loop, so it can pick up the constantArgument. But watch out for page load time when you are setting up this many event handlers. I was doing this for a poup calendar widget, and the load time was noticeable on a slow machine. I ended up installing a single event handler for the entire calendar and doing my own hit testing on the click and other mouse events. It was more work, but it makes the calendaropen faster. (Note that none of the code above is tested! But it should be pretty close.) -Mike From: Christopher Jordan I've got a function that builds several elements on a page with a certain class. I've successfully used jQuery to add mouseover and mouseout events to all the elements with that certain class, and it works beautifully. I couldn't be happier. :0) So, now I need to add a click event to each of those elements. The trouble is, that not each of those click events will be exactly the same. Each will call the same function but with slightly different arguments (one constant and one variable). After playing with a couple of ideas on how to use jQuery to accomplish this, I ended up with the following: ... inside a JS for loop with a counter 'i' ... $("##MyContainerID").append("span id=\"id_" + i + "\" class=\"MyClass\" value=\"" + i + "\"" + i + "/span"); $("##id_" + i).click( function(){ foo(i,ConstantArgument); } ); ... end loop ... The loop creates each of these elements on the page and I was hoping it would then assign a click event to each element (made unique with the id), and this seemed to work. However when I click on each of the elements in turn I can see that they are each calling the function (foo) with the same arguments (30,40). While 40 is the constant argument and is correct, the other argument was supposed to range from 1 - 29 (the number of elements in this particular list). I'm a bit confused I thought this should work. Can anyone shed any light on what I may be doing
Re: [jQuery] Improved Event system new Accordion
Hi folks, I just commited a few changes to jQuery's event system. I fixed the target property of the event.target for both IE and Safari, and modified bind: It now accepts an optional third parameter that specifies the number of times the handler has to executed. When that amount is reached, it removes the handler. All onexxx events like oneclick now use that option and potentiolly provide better performance. Great! Going to test that tonight! By the way, is there interest to put the accordion into the jQuery repository? If you create a subdirectory in SVN/plugins this would be really good. Since Klaus and I also made an accordion plugin, we might need to change that to /plugins/accordion1/ and /plugins/accordion2/. -- Gilles ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] performance optimizations?
If your page contains many elements, then using a context might speed up the search for classes: $('.myclass',$('#commonAncestor')[0]). Thats actually the same as: $('#commonAncestor .myclass') But less cryptic :-) -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improved Event system new Accordion
Your version relies on the way the menu is described. In extenso, it must be a definition list. Couldn't it be more independant? Is that about semantic? I started with your version and modified it to use a definition list. I'm not sure what would be the best approach. But as it is so very easy to implement the accordion with jQuery, it doensn't matter very much, just rewrite it to your needs. -- Jörn Zaefferer http://bassistance.de -- GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Non-destructive jQuery
Hi folks, I'd really like to see John's modifications to pushStack included in the jQuery core. Details here: http://www.nabble.com/Non-Destructive-jQuery-tf2482924.html I'm actually wondering if that modification would break any existing code, as end() works like before. I guess the only situation is in scenarios like this: var jq = $(); var jq2 = jq.destructiveOperation(); var jq3 = jq.anotherDestructiveOperation(); With the non-destructive pushStack implementation, this would give a different result. Is someone actually using such code? I think this modification is very important to improve the overall jQuery... -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Events are not cloned together with the object
How are you cloning the object?On 10/26/06, Kush Murod [EMAIL PROTECTED] wrote: Hi,Is there a way to clone events of an object that is being cloned in one go. Because right now when I clone an object its events are not copied across.Cheers___jQuery mailing listdiscuss@jquery.com http://jquery.com/discuss/-- Yehuda KatzWeb Developer | Wycats Designs(ph)718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improved Event system new Accordion
By the way, is there interest to put the accordion into the jQuery repository? If you create a subdirectory in SVN/plugins this would be really good. Since Klaus and I also made an accordion plugin, we might need to change that to /plugins/accordion1/ and /plugins/accordion2/. I'd rather try to create a merge or best breed. I think the event delegation approach is the better one as it uses only a single event handler, but there are other details you might have solved better. If I add my soltion to /plugins/accordion/, you are still free to modify it as you like :-) -- Jörn Zaefferer http://bassistance.de -- GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Events are not cloned together with the object
yes, actually I am getting an object by id $('#someID').clone().appendTo(...), trying to duplicate specific div that has id=someID and within that div#someID there is an event attached which is not being copied across. Sorry can't show the exact example because it is at work :( Yehuda Katz wrote: How are you cloning the object? On 10/26/06, Kush Murod [EMAIL PROTECTED] wrote: Hi, Is there a way to clone events of an object that is being cloned in one go. Because right now when I clone an object its events are not copied across. Cheers ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] performance optimizations?
Hi, search for classes: $('.myclass',$('#commonAncestor')[0]). Thats actually the same as: $('#commonAncestor .myclass') For that example that ist true, but you might have cached your context: var mycontext = $('#commonAncestor')[0]; $('.menuitems',mycontext).hide(); $('.visible',mycontext).show(); $('.doSomethingWithMe',mycontext).each(function() {...}); Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] siblings() expression bug?
Thanks Brian and Jörn, that indeed does work, but I still wonder if the siblings() expression should match the functionality of find() or $(). Would be nice to find a definitive answer to that. Thanks again, Gavin On Oct 26, 2006, at 7:15 AM, Jörn Zaefferer wrote: Perhaps you're right. But, in the mean time, you could always use $('label').siblings().find('input,textarea').addClass('blah'); I guess that should be rather: $('label').siblings().filter('input,textarea').addClass('blah'); -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Non-destructive jQuery
I use multiple destructive functions all the time: $('#share').children().not('h2').hide().end().end().slideUp('normal'); They're very useful when you need to set up specific elements within a container before doing something with the container itself. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: Thursday, October 26, 2006 9:46 AM To: jQuery Discussion. Subject: [jQuery] Non-destructive jQuery Hi folks, I'd really like to see John's modifications to pushStack included in the jQuery core. Details here: http://www.nabble.com/Non-Destructive-jQuery-tf2482924.html I'm actually wondering if that modification would break any existing code, as end() works like before. I guess the only situation is in scenarios like this: var jq = $(); var jq2 = jq.destructiveOperation(); var jq3 = jq.anotherDestructiveOperation(); With the non-destructive pushStack implementation, this would give a different result. Is someone actually using such code? I think this modification is very important to improve the overall jQuery... -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Non-destructive jQuery
I use multiple destructive functions all the time: $('#share').children().not('h2').hide().end().end().slideUp('normal'); They're very useful when you need to set up specific elements within a container before doing something with the container itself. Ok, but that will still work with the modifications. -- Jörn Zaefferer http://bassistance.de -- GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Non-destructive jQuery
Hmm... ok, I guess I don't understand what the difference between the destructive and non-destructive one is then. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: Thursday, October 26, 2006 10:30 AM To: jQuery Discussion. Subject: Re: [jQuery] Non-destructive jQuery I use multiple destructive functions all the time: $('#share').children().not('h2').hide().end().end().slideUp('normal'); They're very useful when you need to set up specific elements within a container before doing something with the container itself. Ok, but that will still work with the modifications. -- Jörn Zaefferer http://bassistance.de -- GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improved Event system new Accordion
An accordian widget would be a nice addition. I know of a few places I myself would use it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: Thursday, October 26, 2006 6:52 AM To: jQuery Discussion. Subject: [jQuery] Improved Event system new Accordion Hi folks, I just commited a few changes to jQuery's event system. I fixed the target property of the event.target for both IE and Safari, and modified bind: It now accepts an optional third parameter that specifies the number of times the handler has to executed. When that amount is reached, it removes the handler. All onexxx events like oneclick now use that option and potentiolly provide better performance. I updated the accordion plugin to demonstrate and test these changes: http://joern.jquery.com/accordion/accordion.html Check these three lines: $('#list1').accordion() .oneclick(function() { simpleLog(oneclick); }) .click(function() { simpleLog(twoclick) }, 2); It now uses the event delegation pattern as described by Christian Heilmann (http://icant.co.uk/sandbox/eventdelegation/), therefore using only a single click handler and no loops at all. That required the fix for the target property. By the way, is there interest to put the accordion into the jQuery repository? -- Jörn Zaefferer http://bassistance.de -- GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Non-destructive jQuery
Someone who didn't understand jQuery's destructiveness might have done something like that by accident (cached a jQuery object, used a destructive operation, and then reused the cached object under the assumption that it wasn't destructive. It might not matter, or someone in this situation might have worked around the problem in weird ways that would have reprecussions. -- YehudaOn 10/26/06, Jörn Zaefferer [EMAIL PROTECTED] wrote: Hi folks,I'd really like to see John's modifications to pushStack included in the jQuery core. Details here: http://www.nabble.com/Non-Destructive-jQuery-tf2482924.html I'm actually wondering if that modification would break any existing code, as end() works like before. I guess the only situation is in scenarios like this:var jq = $();var jq2 = jq.destructiveOperation ();var jq3 = jq.anotherDestructiveOperation();With the non-destructive pushStack implementation, this would give a different result. Is someone actually using such code?I think this modification is very important to improve the overall jQuery... --Jörn Zaeffererhttp://bassistance.de--Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer___jQuery mailing listdiscuss@jquery.com http://jquery.com/discuss/-- Yehuda KatzWeb Developer | Wycats Designs(ph)718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Oooh! These are pretty!
Anyone up to porting some of this to jQuery? http://archive.dojotoolkit.org/nightly/demos/gfx/circles.html http://archive.dojotoolkit.org/nightly/demos/gfx/clock.html http://www.mxgraph.com/demo/mxgraph-web/web/mxWorkflow-Demo.html -Steve ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Events are not cloned together with the object
trying to duplicate specific div that has id=someID and within that div#someID there is an event attached which is not being copied across. When you clone the div, do you change the cloned ID before inserting so it won't create a duplicate ID? The W3C doesn't whether cloneNode is supposed to clone events or not. http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247 Firefox doesn't even clone the checked state of buttons or the current text of a text box, so it may not clone dynamically attached event handlers either. Maybe it would if the handler was attached as an initial attribute? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
Su schrieb: Your browser should be doing this on its own. Do you have actual evidence it's not happening, or are you just asking? I'm new to HTTP protocol but i've seen options for caching. So i thought i can pass the jquery file with an option for caching to the browser (from my php file). It's just a generall question because i'm new to http and i want to be sure not to load it every time i select another menupoint! I have one file that do all my sitemanagment, it's a very simple php that i use like this: index.php?menu=filelang=deoption=xyz. Inside index.php i just include the files needed (of course with a test to only proceed menupoints available). So the jquery.js file is allways loaded in head like David mentioned in his previous post. David: So if i do it like this ^^^ the file is cached and loaded only once ? best regards, Truppe Steven ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improved Event system new Accordion
Jörn Zaefferer schrieb: By the way, is there interest to put the accordion into the jQuery repository? If you create a subdirectory in SVN/plugins this would be really good. Since Klaus and I also made an accordion plugin, we might need to change that to /plugins/accordion1/ and /plugins/accordion2/. I'd rather try to create a merge or best breed. I think the event delegation approach is the better one as it uses only a single event handler, but there are other details you might have solved better. If I add my soltion to /plugins/accordion/, you are still free to modify it as you like :-) I agree. Let's put efforts into one plugin...! I'd say our plugin is pretty basic anyway, I'm more dedicated to my tabs and history plugin right now. Franck asked too make it a bit more flexible regarding the HTML structure. If you find that reasonable (I do, because it could also be a h2+p structure), I have done something similiar for the tabs lately, i.e. you set an option too define the HTML structure to rely on. Could be something like this: $(...).accordion({ struct: 'h2+p' }); or $(...).accordion({ struct: 'dldd+dt' }); One or the other could the default. Hm, I'm beginning to think that struct is a better option name then tabSelector... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] performance optimizations?
If your page contains many elements, then using a context might speed up the search for classes: $('.myclass',$('#commonAncestor')[0]). And if you know that the elements with the class myclass are only of one type, you can speed that up a little more: $('p.myclass', $('#commonAncestor')[0]); Maybe there are two different types of elements belonging to that class, I could imagine that the following is still faster: $('p.myclass, h2.myclass', $('#commonAncestor')[0]); But that depends on the number of elements I guess. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
Hi, I have one file that do all my sitemanagment, it's a very simple php that i use like this: index.php?menu=filelang=deoption=xyz. Inside index.php i just include the files needed (of course with a test to only proceed menupoints available). So the jquery.js file is allways loaded in head like David mentioned in his previous post. I understand you currently include jQuery like this: script type=text/javascript ? include('jQuery.js') ? // ... your code here /script Try this: script src=jQuery.js type=text/javascript/script script type=text/javascript // ... your code here /script Then jQuery.js is loaded and cached by the browser as external files. It is in some way similar to images which can be cached independently from the HTML. If your JS code only needs a fiewv values from PHP you can do it like this: script type=text/javascript myconf = { bgcolor: '?= $bgcolor ?', color: '?= $color ?', haircolor: '?= $haircolor ?' } /script script src=jQuery.js type=text/javascript/script script src=mystuff.js type=text/javascript/script Then you can use the global variable myconf in mystuff.js and keep mystuff.js unchanged. Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Non-destructive jQuery
I'd really like to see John's modifications to pushStack included in the jQuery core. Details here: http://www.nabble.com/Non-Destructive-jQuery-tf2482924.html I'm actually wondering if that modification would break any existing code, as end() works like before. I guess the only situation is in scenarios like this: var jq = $(); var jq2 = jq.destructiveOperation(); var jq3 = jq.anotherDestructiveOperation(); With the non-destructive pushStack implementation, this would give a different result. Is someone actually using such code? I use multiple destructive functions all the time: $('#share').children().not('h2').hide().end().end().slideUp('normal'); That code would still work. The difference is that today, the three variables in Jörn's example would all be the _same_ object, which would have been modified by two destructive operations. There have been several posts lately that this is unexpected behavior--people want jq to be untouched by the next two lines. With the new approach, you would have three separate jQuery objects, linked so that .end() goes backwards to the previous object. In essence, a chain of jQuery objects completely replaces the internal node stack. I am pretty sure I don't have any code that would be broken by the new behavior. The entire test suite passes with it, although that may be more an indictment of the test suite than a stamp of approval. :-) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improved Event system new Accordion
Might as well throw my 2 cents in. Here is my accordion code for a ul with an id of navItems with a nested ul: $('#navItems li ul').hide(); $('#navItems li a').click(function(){ var ul = $(this).parent().children('ul'); if ( ul.is(':hidden') ){ $(this).parent().siblings().children('ul').filter (':visible').slideUp(); ul.slideDown(); } return false; }); $('#navItems li').filter('.selected').children('a').trigger (click); On Oct 26, 2006, at 9:35 AM, Klaus Hartl wrote: Jörn Zaefferer schrieb: By the way, is there interest to put the accordion into the jQuery repository? If you create a subdirectory in SVN/plugins this would be really good. Since Klaus and I also made an accordion plugin, we might need to change that to /plugins/accordion1/ and /plugins/accordion2/. I'd rather try to create a merge or best breed. I think the event delegation approach is the better one as it uses only a single event handler, but there are other details you might have solved better. If I add my soltion to /plugins/accordion/, you are still free to modify it as you like :-) I agree. Let's put efforts into one plugin...! I'd say our plugin is pretty basic anyway, I'm more dedicated to my tabs and history plugin right now. Franck asked too make it a bit more flexible regarding the HTML structure. If you find that reasonable (I do, because it could also be a h2+p structure), I have done something similiar for the tabs lately, i.e. you set an option too define the HTML structure to rely on. Could be something like this: $(...).accordion({ struct: 'h2+p' }); or $(...).accordion({ struct: 'dldd+dt' }); One or the other could the default. Hm, I'm beginning to think that struct is a better option name then tabSelector... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Has anybody done this?
Thanks to Klaus and Dave.It's improved and more interesting, at least I feel :)http://204.13.69.149/~wang/Pleae leave your comments and see if it can be better. On 10/26/06, Dave Methvin [EMAIL PROTECTED] wrote: Here is my little plugin to create dom element: http://204.13.69.149/~wang/ My questions are: 1, Has anybody done this before? 2, As it's my first crack on jQuery, anything wrong with the api call? 3, Is there any more elegant solutions?As Klaus said, the name is a bit off but I do think this approach has somepromise. Right now I am using Mike Geary's DOM creation functions. http://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototypeI like them because (unlike string building and innerHTML) there are nogotchas with the contents of the strings you put into the DOM functions. However, the $.DIV syntax is not pretty. More important, doing things in thenatural way involves attaching event handlers before the element is addedto the document tree, which causes a small memory leak in IE6. Since dom() changes the selected nodes, jQuery convention says it should usepushStack to save the previous set of nodes. Building a DOM tree oftenseveral levels, though, so a pushStack on every element could result in a lot of pushed state that you don't care about.Let's say I want to create a list like ullione/lilitwo/li/ul.How would I do that with tag()? I can only pass in one tag, and it's always appended as a child.___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ -- Best regardsLinan Wang ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Non-destructive jQuery
Ah, that makes sense. Given that I understand it now, that seems to be more how I'd expect things to work. Now that I think about it, I was bitten by that destructiveness thing at one time before. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Methvin Sent: Thursday, October 26, 2006 11:48 AM To: 'jQuery Discussion.' Subject: Re: [jQuery] Non-destructive jQuery I'd really like to see John's modifications to pushStack included in the jQuery core. Details here: http://www.nabble.com/Non-Destructive-jQuery-tf2482924.html I'm actually wondering if that modification would break any existing code, as end() works like before. I guess the only situation is in scenarios like this: var jq = $(); var jq2 = jq.destructiveOperation(); var jq3 = jq.anotherDestructiveOperation(); With the non-destructive pushStack implementation, this would give a different result. Is someone actually using such code? I use multiple destructive functions all the time: $('#share').children().not('h2').hide().end().end().slideUp('normal'); That code would still work. The difference is that today, the three variables in Jörn's example would all be the _same_ object, which would have been modified by two destructive operations. There have been several posts lately that this is unexpected behavior--people want jq to be untouched by the next two lines. With the new approach, you would have three separate jQuery objects, linked so that .end() goes backwards to the previous object. In essence, a chain of jQuery objects completely replaces the internal node stack. I am pretty sure I don't have any code that would be broken by the new behavior. The entire test suite passes with it, although that may be more an indictment of the test suite than a stamp of approval. :-) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Has anybody done this?
If you scroll on down to a comment by Olsow, youll find what I think is a better way to do DOM creation: http://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-176 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Linan Wang Sent: Thursday, October 26, 2006 11:57 AM To: jQuery Discussion. Subject: Re: [jQuery] Has anybody done this? Thanks to Klaus and Dave. It's improved and more interesting, at least I feel :) http://204.13.69.149/~wang/ Pleae leave your comments and see if it can be better. On 10/26/06, Dave Methvin [EMAIL PROTECTED] wrote: Here is my little plugin to create dom element: http://204.13.69.149/~wang/ My questions are: 1, Has anybody done this before? 2, As it's my first crack on jQuery, anything wrong with the api call? 3, Is there any more elegant solutions? As Klaus said, the name is a bit off but I do think this approach has some promise. Right now I am using Mike Geary's DOM creation functions. http://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype I like them because (unlike string building and innerHTML) there are no gotchas with the contents of the strings you put into the DOM functions. However, the $.DIV syntax is not pretty. More important, doing things in the natural way involves attaching event handlers before the element is added to the document tree, which causes a small memory leak in IE6. Since dom() changes the selected nodes, jQuery convention says it should use pushStack to save the previous set of nodes. Building a DOM tree often several levels, though, so a pushStack on every element could result in a lot of pushed state that you don't care about. Let's say I want to create a list like ullione/lilitwo/li/ul. How would I do that with tag()? I can only pass in one tag, and it's always appended as a child. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Best regards Linan Wang ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] performance optimizations?
--- Dave Methvin [EMAIL PROTECTED] wrote: 2) I'm getting about a 1.5 second pause when the page loads up, even when on my local system, which appears to be when my jquery commands execute. It's just a little too long, my client noticed right away. Are there any tricks to help this out? For example is it better to use xpath or css type searches for better performance? To me, 1.5 seconds is an eternity. Can you post a link to the code, or maybe just the startup code? How big is the page? I think Xpath and css selector speeds are about the same. Avoid selectors like $(.myclass) on a big document, because it has to look at every element. I'm getting some great suggestions. I'm trying out some of the recommendations, particularly things about cached the context better. I'll put something up later today. There are a couple of bits in this I think people might be interested in for sharing, I hope. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] performance optimizations?
1) Where can I find a searchable archive of this mailing list, because I'd hate to ask questions that have already been answered. Here are a couple: http://www.google.com/search?q=site:jquery.com+optimize+OR+optimization http://www.nabble.com/JQuery-f15494.html 2) I'm getting about a 1.5 second pause when the page loads up, even when on my local system, which appears to be when my jquery commands execute. It's just a little too long, my client noticed right away. Are there any tricks to help this out? For example is it better to use xpath or css type searches for better performance? It's better to not do the searches at all - or rather do them only once. I see a lot of code where the same jQuery expression is repeated over and over again - whether it's inside a loop or simply repeated in the code. Instead of: $('.foo').something(); // other code here $('.foo').somethingElse(); // how about a loop for( var i = 0; i 42; i++ ) { $('.foo').andSomethingElse(); } Write: var $foo = $('.foo'); $foo.something(); // other code here $foo.somethingElse(); // how about a loop for( var i = 0; i 42; i++ ) { $foo.andSomethingElse(); } That code will be a LOT fater than the first. I like to use the $ prefix on the variable name when I save a reference to a jQuery object - it makes the code still look like jQuery code to me. :-) For a single element, it can be useful to save references to both the jQuery object and the underlying DOM element. I like to use the same variable name for both, with the $ prefix on the jQuery object. This makes it easy to see their relation in the code: var $moo = $('#moo'), moo = $moo[0]; $moo.jQueryMethod(); moo.domMethod(); I know this is a pretty open ended question please let me know if I can help clarify it. If I can get this performance thing fixed up a bit I hope some of my plugins can be useful to the community. If you're going to be releasing your code anyway, just post it somewhere and we can all take a look at it. Otherwise you'll just get general suggestions like these. -Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
I have the same problem, and currently I'm using somewhat similar to approach one. I create hidden divs in my nested sortable container so they can accept new elements. I need to add two, otherwise I cannot drop below the first element (don't know why). I think this way is simpler since at the end the Sortable interface is still doing the work, and will be simpler to remove once this issue is solved (hopefully soon). Right now I'm facing other big problem. I have a nested sortable container B that accepts a subset of the elements accepted by its parent sortable container A. The logic says that tagging the elements with two different classes, one for container A and other for container B (the subset accepted by B will be tagged with both classes) will do the trick easily. However it's not the case. When I add both classes to the draggable element I cannot drop it into the B sortable container, only on the parent. If I remove the class for container A then I can drop inside of B, but of course it's not possible to drop in A.Everything works fine if container B is not nested within A. Does somebody knows what can be done to workaround this issue? thanks On 10/25/06, James Hall [EMAIL PROTECTED] wrote: Spooky. We both had the same question on a thread last replied to onMonday. And within minutes of each other! If this interface had folder icons, maybe hovering over the icon wouldchange to a very open folder, to show you can drop items inside it.On Thu, 2006-10-26 at 02:55 +0200, Norbert Martinez wrote: Stefan, I have been silently admiring (and using) your work for a time and have to say that it rocks! I will send you a link to a demo as soon as I finish what I am working on. For the time being, I am actually quite interested in the nested sortables functionality you have posted about. I have played around with the early version example you have provided and have found a thing that probably needs to be taken care of: There is no way to drop an item A into another item B if item B does not already have some children. That means that, right now, if all items are moved one by one to, say, the same level as option 1, the sortable list will become a flat list and there will be no way to create a nested list again. I can think of two solutions to this shortcoming: 1) Put a ul class=sortConatiner inside all items (even the ones that have no children). You will probably need to make the ul class=sortConatiner have a small height so that empty ul class=sortConatiner accept dropped items. The problem with this approach is that the height needed in empty ul class=sortConatiner might make the nested list look slightly weird. Also, since the ul class=sortConatiner will be shown just bellow its parent item, it might be difficult for the user to differentiate between an item being dropped into another item and an item being dropped bellow another item. 2) Detect the exact location of the dragged item with respect to the hovered item: If the dropped item is near the top of the hovered item, show a horizontal line above the hovered item and, if the dragged item is dropped, place the dropped item as an elder brother of the hovered item, If the dropped item is around the middle of the hovered item, temporarily color the background of the hovered item and, if the dragged item is dropped, find or create an inner ul class=sortConatiner in the hovered item and put the dropped item into it. If the dropped item is near the bottom of the hovered item, show a horizontal line bellow the hovered item and, if the dragged item is dropped, place the dropped item as a younger brother of the hovered item. I hope my explanations are not too confusing! Thanks for your efforts, Norbert. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
Truppe Steven schreef: I'm new to HTTP protocol but i've seen options for caching. So i thought i can pass the jquery file with an option for caching to the browser (from my php file). It's just a generall question because i'm new to http and i want to be sure not to load it every time i select another menupoint! I have one file that do all my sitemanagment, it's a very simple php that i use like this: index.php?menu=filelang=deoption=xyz. Inside index.php i just include the files needed (of course with a test to only proceed menupoints available). So the jquery.js file is allways loaded in head like David mentioned in his previous post. David: So if i do it like this ^^^ the file is cached and loaded only once ? if you file is something like ?php // php code ? html head javascript type=text/javascript src=jquery.js /script /head body ?php // inlude files ? /body /html jquery gets cached as long as you stay on that page. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
Christof Donat schrieb: script type=text/javascript myconf = { bgcolor: '?= $bgcolor ?', color: '?= $color ?', haircolor: '?= $haircolor ?' } /script script src=jQuery.js type=text/javascript/script script src=mystuff.js type=text/javascript/script Then you can use the global variable myconf in mystuff.js and keep mystuff.js unchanged. I have something like this: head script src=jQery.js type.../.. script src=mystuff.js type.../.. /head body?php // $menu default = array[0] $menu = http_sGet(array('menu1','menu2','menu3')); include($menu); ?/body So wit this jQuery get loaded only once ? Also if i select a different menu(same .php file only other $_GET parameter) ? best regards, Truppe Steven ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] getElementsByTagName('*') avoidance?
Is there any supported jQuery platform or situation where context.getElementsByTagName('*') does not get all the elements in the context? Right now the jQuery selector code avoids using it and instead does a recursive crawl of the tree, which has to be a lot more expensive. I know it wasn't there in IE5, but I think we've given up on IE5 support. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
That was the answer for my question, thank you ! best regards, Truppe Steven ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getElementsByTagName('*') avoidance?
On 10/26/06, Dave Methvin [EMAIL PROTECTED] wrote: Is there any supported jQuery platform or situation where context.getElementsByTagName('*') does not get all the elements in the context? Right now the jQuery selector code avoids using it and instead does a recursive crawl of the tree, which has to be a lot more expensive. I know it wasn't there in IE5, but I think we've given up on IE5 support. IE5 provides the `all` collection for every element (IIRC), which is (again IIRC) equivalent to `getElementsByTagName(*)`. So if support for IE5 is required, it'd be a good alternative. -- Choan http://choangalvez.nom.es/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
Just for usability, it'd help a lot in the demo if the cursor was default (the arrow) instead of the text selection tool.-- YehudaOn 10/26/06, bbuchs [EMAIL PROTECTED] wrote: Do you expect to release this as a new SortableTree plugin, or would thisreplace the existing Sortables?More to the point, if this *did* replace Sortables, is it backwardscompatible with the existing version? Stefan Petre wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery.--View this message in context: http://www.nabble.com/Sortables%2C-new-approach-tf2497066.html#a7011565Sent from the JQuery mailing list archive at Nabble.com.___ jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/-- Yehuda Katz Web Developer | Wycats Designs(ph)718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Problem with .left() return auto in Opera
Hi Is there any way to force .left() to return pixel values for Opera 9? The element in question is absolute right positioned, while Opera 8.5 and Firefox return a pixel value, Opera 9 returns 'auto'. This is surely a correct value in this context but mostly if you want the left value, you want a pixel value to reuse it somewhere. Is there any way to change this behavior via a Plugin or in jQuery Core directly? Which results in my next Question, will jQuery allow to get native pixel values in the future? Something like widthpx(), leftpx() would be useful when doing size/position calculations for elements. Currently I write a jQuery Splitter Widget component, therefor a lot calculations are necessary and so I made some additions for jQuery like calculation and setting the complete width of an element including borders, paddings and margins. However these functions assume pixel return values for the css properties... Oskar ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Trouble width height on slideDown
Hey, first, thanks a lot for the amazing librairy! ..but i have a little trouble width the slideDown effect. My p doesn't slide down enought, so the text overflow the tag and push violently the next tag out to the bottom... you can see it here: http://www.pixoil.com/1000visages/films.html and by clicking the first button Voir la note d'intention i don't see what going wrong.. here, my css of the p (that i want slideDown): .front p.note{ position: relative; width: 380px; font-size: 10px; color:#565656; display:none; border: 1px solid red; } thanks a lot. -- Cyril Demars 05 67 22 63 56 [EMAIL PROTECTED] *www.pixoil.com http://www.pixoil.com* ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
To echo the question about backwards compatibility...I'm currently working with jQuery and doing a complete rewrite of PHPGacl's admin console for a project at work. It involves the Sortables (specifically the push capabilities) and it'd be a big loss of time, to say the least, if I had to change code as a result. On a positive note, the work on Interface is amazing (as if that's a secret!). -- David Quoting Yehuda Katz [EMAIL PROTECTED]: Just for usability, it'd help a lot in the demo if the cursor was default (the arrow) instead of the text selection tool. -- Yehuda On 10/26/06, bbuchs [EMAIL PROTECTED] wrote: Do you expect to release this as a new SortableTree plugin, or would this replace the existing Sortables? More to the point, if this *did* replace Sortables, is it backwards compatible with the existing version? Stefan Petre wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. -- View this message in context: http://www.nabble.com/Sortables%2C-new-approach-tf2497066.html#a7011565 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Yehuda Katz Web Developer | Wycats Designs (ph) 718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
I will keep both versions alive, because they behave quite different . David Olinsky wrote: To echo the question about backwards compatibility...I'm currently working with jQuery and doing a complete rewrite of PHPGacl's admin console for a project at work. It involves the Sortables (specifically the push capabilities) and it'd be a big loss of time, to say the least, if I had to change code as a result. On a positive note, the work on Interface is amazing (as if that's a secret!). -- David Quoting Yehuda Katz [EMAIL PROTECTED]: Just for usability, it'd help a lot in the demo if the cursor was default (the arrow) instead of the text selection tool. -- Yehuda On 10/26/06, bbuchs [EMAIL PROTECTED] wrote: Do you expect to release this as a new SortableTree plugin, or would this replace the existing Sortables? More to the point, if this *did* replace Sortables, is it backwards compatible with the existing version? Stefan Petre wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. -- View this message in context: http://www.nabble.com/Sortables%2C-new-approach-tf2497066.html#a7011565 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Yehuda Katz Web Developer | Wycats Designs (ph) 718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to cache jQuery
Your browser should cache the file automatically. !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Truppe Steven Sent: Thursday, October 26, 2006 9:19 AM To: jQuery Discussion. Subject: [jQuery] How to cache jQuery Hello, i use jQuery on multiple pages of my site so it would be nice to make sure that this file is only loaded once and not on every menu change. Is there a cross-browser way (for jQuery supported browsers) to cache the file and make it load only once ? best regards, Truppe Steven ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Trouble width height on slideDown
Cyril Demars schreef: Hey, first, thanks a lot for the amazing librairy! ..but i have a little trouble width the slideDown effect. My p doesn't slide down enought, so the text overflow the tag and push violently the next tag out to the bottom... you can see it here: http://www.pixoil.com/1000visages/films.html and by clicking the first button Voir la note d'intention i don't see what going wrong.. here, my css of the p (that i want slideDown): .front p.note{ position: relative; width: 380px; font-size: 10px; color:#565656; display:none; border: 1px solid red; } thanks a lot. If i check the element in firebug i see the height is set to 162px. Do you set the height somewhere in your javascript code? The overflow is set to visible too. Nice designed page by the way. David ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Scroll document if draggable leaves viewport
The list server sends your emails on to everyone else - not back to you.BlairOn 10/26/06, Eckhard Rotte [EMAIL PROTECTED] wrote:Hi jQueries,i've posted this mail 2 times ago, but it didn't appear in the mailing list. Only the web frontend did get it, nothing in my inbox.Did you get it?I'll try it once again:- Is it possible to get a scrolling feature for any drag/droppable?For Example:If you leave the viewport with an object and the document body is longeror wider than the viewport, the document scrolls connected to the mouse position.This YUI demo is a good example:http://developer.yahoo.com/yui/examples/dragdrop/ontop.html?mode=dist Is somebody working on it or did I miss it in the documentation? Or isthere a simple way to implement this feature?regardseckiEckhard Rotte Goesselstr. 10 | 28215 BremenTel. 0421 - 3909547 | Mobil: 0176-23498896Skype: eckirotte | AIM/iChat: eckiprivatmailto:[EMAIL PROTECTED]-- ___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Trouble width height on slideDown
This is reported as bug #219On 10/26/06, David [EMAIL PROTECTED] wrote: Cyril Demars schreef: Hey, first, thanks a lot for the amazing librairy! ..but i have a little trouble width the slideDown effect. My p doesn't slide down enought, so the text overflow the tag and push violently the next tag out to the bottom... you can see it here: http://www.pixoil.com/1000visages/films.html and by clicking the first button Voir la note d'intention i don't see what going wrong.. here, my css of the p (that i want slideDown): .front p.note{ position: relative; width: 380px; font-size: 10px; color:#565656; display:none; border: 1px solid red; } thanks a lot.If i check the element in firebug i see the height is set to 162px. Doyou set the height somewhere in your _javascript_ code? The overflow is set to visible too.Nice designed page by the way.David___jQuery mailing listdiscuss@jquery.com http://jquery.com/discuss/-- If there's anything more important than my ego around, I want it caught and shot now. -- Zaphod ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Adding class to dynamic element
I am trying to add a class (.currenttotal) to a dynamically generated span element. How can I do this? Basically, I am pulling an xml file and using the information to create an interface. I need to add the .currenttotal class to the registeredSpan. Any ideas? $(majorname, xml).each(function(i){ var listItem = document.createElement( 'li' ); var listLabel = document.createElement( 'label' ); listLabel.style.display = '-moz-inline-box'; listLabel.style.textAlign = 'left'; var labelSpan2 = document.createElement ( 'span' ); labelSpan2.style.display = 'block'; labelSpan2.style.width = '120px'; labelSpan2.innerHTML = $(this).text(); var listInput = document.createElement( 'input' ); listInput.name = $(this).text(); listInput.value = '3'; var registeredSpan = document.createElement( 'span' ); $(registeredSpan).addClass(currenttotal); //This doesn't work. listLabel.appendChild( labelSpan2 ); listItem.appendChild( listLabel ); listItem.appendChild( listInput ); listItem.appendChild( registeredSpan ); $(#appointmentList).append( listItem ); }); If there is a better way to write the above code, I'm open to suggestions! -- View this message in context: http://www.nabble.com/Adding-class-to-dynamic-element-tf2517168.html#a7020780 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improved Event system new Accordion
I wrote an accordion plugin as well... I also wanted something that was structurally flexible.I recently re-factored what i had, so this is not that well tested or optimized. Here it is anyway:/*** Utility function to swap className on a jQuery object. * * @example $('p.foo').swapClass('foo', 'bar');* * @param {Object} c1 class name one.* @param {Object} c2 class name two.*/jQuery.fn.swapClass = function(c1, c2){ return this.each (function(){ var t = jQuery(this); (!t.is('.'+c1)) ?t.addClass(c1).removeClass(c2) : t.addClass(c2).removeClass(c1); });}/*** jQuery plugin to add an accordian effect to any jQuery obj * and selectable content within the same parent.* requires a swapClass Plugin* * @param {_expression_} content: Required. Element to be paired with. Takes a jquery _expression_/object/dom element. * @param {Object} options: Optional option object. * {Integer} startIndex: Index of the initial pair to be shown.* {String|Integer} speed: When given a speed the accordian animates in and out. * {Function} callBack: CallBack function at the end of each toggle.*/jQuery.fn.accordian = function(content, options) { if (!this[0]) return; var options = jQuery.extend({ startIndex: 0, speed: 0, collapsible: false, callBack: null }, options || {}); var $parent = this.parent().addClass('accordian'), $content = jQuery(content, $parent).hide(), $self = this.end(); if(options.startIndex = 0) jQuery($content[options.startIndex]).show(); return this.each(function(i){ jQuery(this).click(function(){ if (!jQuery(this).is('.open') !options.collapsible){ $self.filter('.open').swapClass('open', 'close').end(); jQuery(this).swapClass('open', 'close'); var $closeObj = jQuery($content).filter(':visible'), $openObj = jQuery($content).eq(i); //$content.end(); if (options.speed) { $closeObj.animate({'height': 'hide'}, options.speed, function(){ $openObj.animate({'height': 'show'}, options.speed, options.callBack); }); } else { $closeObj.hide(options.speed); $openObj.show(options.speed, options.callBack); } } }); });} ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Problem with .left() return auto in Opera
Have you had a look at the dimensions plugin?BlairOn 10/27/06, Oskar E. [EMAIL PROTECTED] wrote: HiIs there any way to force .left() to return pixel values for Opera 9? The element in question is absolute right positioned, while Opera 8.5and Firefox return a pixel value, Opera 9 returns 'auto'. This is surelya correct value in this context but mostly ifyou want the left value, you want a pixel value to reuse it somewhere. Is there any way to changethis behavior via a Plugin or in jQuery Core directly?Which results in my next Question, will jQuery allow to get native pixelvalues in the future? Something like widthpx(), leftpx() would be useful when doingsize/position calculations for elements.Currently I write a jQuery Splitter Widget component, therefor a lotcalculations are necessary and so I made some additions for jQuery like calculation and setting the complete width of an element includingborders, paddings and margins. However these functions assume pixelreturn values for the css properties...Oskar___ jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Trouble width height on slideDown
Mats Lindblad a écrit : This is reported as bug #219 On 10/26/06, *David* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Cyril Demars schreef: Hey, first, thanks a lot for the amazing librairy! ..but i have a little trouble width the slideDown effect. My p doesn't slide down enought, so the text overflow the tag and push violently the next tag out to the bottom... you can see it here: http://www.pixoil.com/1000visages/films.html and by clicking the first button Voir la note d'intention i don't see what going wrong.. here, my css of the p (that i want slideDown): .front p.note{ position: relative; width: 380px; font-size: 10px; color:#565656; display:none; border: 1px solid red; } thanks a lot. If i check the element in firebug i see the height is set to 162px. Do you set the height somewhere in your javascript code? The overflow is set to visible too. Nice designed page by the way. David ___ jQuery mailing list discuss@jquery.com mailto:discuss@jquery.com http://jquery.com/discuss/ -- If there's anything more important than my ego around, I want it caught and shot now. -- Zaphod ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ Thank david for firebug, i didn't know this plug. The style height: 126px; id put on by the jquery at the end of the slideDown effect i think. i search in my different sheet and js, and i didn't find something -- Cyril Demars 05 67 22 63 56 [EMAIL PROTECTED] *www.pixoil.com http://www.pixoil.com* ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improved Event system new Accordion
Can you supply an example on how you would implement this? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wil Stuckey Sent: Thursday, October 26, 2006 5:56 PM To: jQuery Discussion. Subject: Re: [jQuery] Improved Event system new Accordion I wrote an accordion plugin as well... I also wanted something that was structurally flexible. I recently re-factored what i had, so this is not that well tested or optimized. Here it is anyway: /** * Utility function to swap className on a jQuery object. * * @example $('p.foo').swapClass('foo', 'bar'); * * @param {Object} c1 class name one. * @param {Object} c2 class name two. */ jQuery.fn.swapClass = function(c1, c2){ return this.each (function(){ var t = jQuery(this); (!t.is('.'+c1)) ? t.addClass(c1).removeClass(c2) : t.addClass(c2).removeClass(c1); }); } /** * jQuery plugin to add an accordian effect to any jQuery obj * and selectable content within the same parent. * requires a swapClass Plugin * * @param {_expression_} content: Required. Element to be paired with. Takes a jquery _expression_/object/dom element. * @param {Object} options: Optional option object. * {Integer} startIndex: Index of the initial pair to be shown. * {String|Integer} speed: When given a speed the accordian animates in and out. * {Function} callBack: CallBack function at the end of each toggle. */ jQuery.fn.accordian = function(content, options) { if (!this[0]) return; var options = jQuery.extend({ startIndex: 0, speed: 0, collapsible: false, callBack: null }, options || {}); var $parent = this.parent().addClass('accordian'), $content = jQuery(content, $parent).hide(), $self = this.end(); if(options.startIndex = 0) jQuery($content[options.startIndex]).show(); return this.each(function(i){ jQuery(this).click(function(){ if (!jQuery(this).is('.open') !options.collapsible){ $self.filter('.open').swapClass('open', 'close').end(); jQuery(this).swapClass('open', 'close'); var $closeObj = jQuery($content).filter(':visible'), $openObj = jQuery($content).eq(i); //$content.end(); if (options.speed) { $closeObj.animate({'height': 'hide'}, options.speed, function(){ $openObj.animate({'height': 'show'}, options.speed, options.callBack); }); } else { $closeObj.hide(options.speed); $openObj.show(options.speed, options.callBack); } } }); }); } ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin 2.0
Rey Bango schrieb: Some feedback on this. In IE7 final, there's some odd behavior. When I click on a tab, the page shoots up and then resets itself to its original position. Here's what I mean by this. Say that that I'm looking at the section of your demo page that says Slide and Fade Effect Combined and that section is at about the center of the page (vertically). What seems to be happening is that the div containing the tabs (tabs labeled Section 13-15) will be brought up to the very top of the viewable section and then put back into place. I fixed that oddity. http://stilbuero.de/jquery/tabs/ It works fine now in IE6 and IE7. I have not yet committed that fix to svn because I want to do some more tests: To fix this I remove the id of a tab container and immediatly reset it - that stops the scrollbar from jumping around. But that's way I will have to test sorrowly - in case someone uses the ids for styling as well, some kind of a flash of unstyled content isn't acceptable. Maybe it isn't noticeable anyway because the container that is to be shown is involved... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Trouble width height on slideDown
I had the exact same problem. It doesn't happen when you use show() or change the timing to zero, slideDown(0). That 219 bug is important. I heard it was fixed in 1.0.2 but it wasn't.I also tried to change the height after it finished the slideDown and that didn't work either. Any ETA on bug #219?GlenOn 10/26/06, Cyril Demars [EMAIL PROTECTED] wrote: Mats Lindblad a écrit : This is reported as bug #219 On 10/26/06, *David* [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: Cyril Demars schreef: Hey, first, thanks a lot for the amazing librairy! ..but i have a little trouble width the slideDown effect. My p doesn't slide down enought, so the text overflow the tag and push violently the next tag out to the bottom... you can see it here: http://www.pixoil.com/1000visages/films.html and by clicking the first button Voir la note d'intention i don't see what going wrong.. here, my css of the p (that i want slideDown): .front p.note{ position: relative; width: 380px; font-size: 10px; color:#565656; display:none; border: 1px solid red; } thanks a lot. If i check the element in firebug i see the height is set to 162px. Do you set the height somewhere in your _javascript_ code? The overflow is set to visible too. Nice designed page by the way. David ___ jQuery mailing list discuss@jquery.com mailto:discuss@jquery.com http://jquery.com/discuss/ -- If there's anything more important than my ego around, I want it caught and shot now. -- Zaphod ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/Thank david for firebug, i didn't know this plug. The style height: 126px; id put on by the jquery at the end of theslideDown effect i think.i search in my different sheet and js, and i didn't find something--Cyril Demars 05 67 22 63 56[EMAIL PROTECTED]*www.pixoil.com http://www.pixoil.com* ___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Visual jQuery Announcement
I just updated Visual jQuery so it uses docs that include the plugins in the svn.I'm going to be adding inline docs to Interface over the next few days, so Interface docs will be available on visualjquery.com in the next few days.If there's a plugin that you have in the svn repository, but it's not currently on Visual jQuery, please let me know whether I can add the inline docs into the repository, or if you want to do it. The more we get centralized documentation, the better the overall jQuery community becomes. -- Yehuda KatzWeb Developer | Wycats Designs(ph)718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Sortable interface issues
Hi, I'm building an application using jQuery, heavily based on the Sortable/Draggable interface. The interface is helping me a lot, however I've found some issues that heavily affect the performance and usability of my application, to the point where its deployment is at highrisk. I'll appreciate all the help you can provide (it will be a shame to throw this application to the trash can): So the issues are: 1) Nested sortable containers cannot accept elements tagged with classes accepted by its parent sortable container too, but not accepted by them. I have a nested sortable containerB (green color)that accepts a subset of the elementsaccepted by its parent sortable container A. The logic says that tagging the elements with two different classes, one for container A and other for container B (the subset accepted by B will be tagged with both classes) will do the trick easily (so the Text button has both classes, Number button has only the parent container's class, and Message button has only the container B class). However it's not the case. When I add both classes to the draggable element I cannot drop it into the B sortable container, only on the parent or any other nested sortable container with the same accepted class of the parent (the red container). If I remove the class for container A then I can drop inside of B, but of course it's not possible to drop in A.Everything works fine if container B is not nested within A (as you can see in the green container which is not nested). http://www.geocities.com/raziel_ag/multisort.html 2) Nested sortable containers need to contain children elements (used as wrappers) in order to be able to drop other elements inside.I had to create hidden divs in my nested sortable containers so they can accept new elements. It needs 2 though, and at least one not hidden, otherwise you cannot drop above the first element (don't know why). As you can see in the example, the first red container cannot be used since it doesn't contain any child. The second container works as expected because it contain 2 children, which will wrap the other elements. If the first element is hidden then it's not possible to add elements above the first element. http://www.geocities.com/raziel_ag/sort.html 3) Having nested sortable containers ,floating horizontally, will add the dropped elements only to the last container. I have 2 or more nested containers, all of them siblings, floating horizontally on the same row. When I drag an element it will only add it to the last container, even when I'm hovering over the other containers. http://www.geocities.com/raziel_ag/columnsort.html 4) Cannot drop on the sides of an already dropped element. I've tried many configurations for the sortable containers, using the axis property, etc., but I cannot get my elements to be dropped on the left or right of an already dropped element. They always go above or below, which means that if I have 2 or more elements on the same row I cannot drop a new element between them. 5) Performance decreases considerably fast as more markup is added. I'd like to say this is my main issue but the truth is that all of them are crucial at this point. I've tracked the main slowdown to the first call to any of the dynamic properties such as offsetWidth, offsetHeight, etc. According to my tests the first call to one of this takes most of the time used for the drag and drop functionality. However, in the example that I'm posting now I didn't such big spike (anyway I detected many other spikes at the sortable interface functions such as the highlight and the measure functions). I'm not sure what's going on there, or how this can be improved, but the slowdown is measured in seconds without having that much markup, and increases really fast. As you can see in the example, there's not that much markup involved nor many nested sortable containers and the slowdown is considerable. http://www.geocities.com/raziel_ag/bigsort.html I'd really appreciate any help you can provide me on any of these. Thanks, ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Visual jQuery Announcement
Nice :-) Any chance you're going to make it work with Safari in the future? Would probably be a good thing to have it support all of the same browsers jQuery itself supports. Keep up the good work, I use visualjquery often!GavinOn Oct 26, 2006, at 4:23 PM, Yehuda Katz wrote:I just updated Visual jQuery so it uses docs that include the plugins in the svn.I'm going to be adding inline docs to Interface over the next few days, so Interface docs will be available on visualjquery.com in the next few days.If there's a plugin that you have in the svn repository, but it's not currently on Visual jQuery, please let me know whether I can add the inline docs into the repository, or if you want to do it. The more we get centralized documentation, the better the overall jQuery community becomes. -- Yehuda KatzWeb Developer | Wycats Designs(ph) 718.877.1325___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Visual jQuery Announcement
I hear this often; Visual jQuery works on Safari, but you sometimes need to refresh once to get it working. I'm trying to work out why that is.I use vjQ on Safari all the time.-- Yehuda On 10/26/06, Gavin M. Roy [EMAIL PROTECTED] wrote: Nice :-) Any chance you're going to make it work with Safari in the future? Would probably be a good thing to have it support all of the same browsers jQuery itself supports. Keep up the good work, I use visualjquery often! GavinOn Oct 26, 2006, at 4:23 PM, Yehuda Katz wrote: I just updated Visual jQuery so it uses docs that include the plugins in the svn.I'm going to be adding inline docs to Interface over the next few days, so Interface docs will be available on visualjquery.com in the next few days.If there's a plugin that you have in the svn repository, but it's not currently on Visual jQuery, please let me know whether I can add the inline docs into the repository, or if you want to do it. The more we get centralized documentation, the better the overall jQuery community becomes. -- Yehuda KatzWeb Developer | Wycats Designs(ph)718.877.1325___jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___jQuery mailing listdiscuss@jquery.com http://jquery.com/discuss/-- Yehuda KatzWeb Developer | Wycats Designs(ph)718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Events are not cloned together with the object
Hi, Just got back to work, and got the snippet below -xhtml div id=fileqa_submit div class=fileset divlabelFile/labelinput size=96 type=file//div divlabelDescription/labeltextarea/textarea/div a href=javascript:; style= class=cloneMeClone me/a /div /div -jquery // clone this file upload section $('.cloneMe').click(function(){ $(this).parent().clone().appendTo('#fileqa_submit').slideDown('slow'); }); At the beginning you'd have one section $('.fileset') so when you click on $(.cloneMe) it clones whole $(' div.fileset') and appends it at the end of '#fileqa_submit'. The problem is $(.cloneMe) event on the original is not cloned together. In other words aim here is to let cloned objects to be able to clone themselves. Cheers, K -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Methvin Sent: Friday, 27 October 2006 2:02 AM To: 'jQuery Discussion.' Subject: Re: [jQuery] Events are not cloned together with the object trying to duplicate specific div that has id=someID and within that div#someID there is an event attached which is not being copied across. When you clone the div, do you change the cloned ID before inserting so it won't create a duplicate ID? The W3C doesn't whether cloneNode is supposed to clone events or not. http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247 Firefox doesn't even clone the checked state of buttons or the current text of a text box, so it may not clone dynamically attached event handlers either. Maybe it would if the handler was attached as an initial attribute? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables, new approach
Hi Stefan, I tested on Safari 2.0.4 and Firefox 1.5 (Deer Park). You've done a great job with this! The only issue I see is that the ghosted text appears about 30px to the right and 30px below the cursor when I drag an item, which could be a bit confusing. Is that the way it's supposed to be? Or is that just because it's a demo and it can be adjusted? Thanks for your amazing plugins! Karl ___ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 26, 2006, at 1:16 AM, Stefan Petre wrote: Hi James and Norbert, http://interface.eyecon.ro/demos/test_sort.html check this again. I really need some one to test this on Safari 2 because I have only Safari 1.3 James Hall wrote: Hey, Really like the look of this. :) Good work. At the moment, you can drag children out from there parents, and move them up a level. But you can't drag nodes into other nodes as children, unless it already has children. If that makes sense. Example: I can make 3-2 a child of 1-2, by dropping it just above 1-2-1. But I can't make 3-2 a child of 'option 4'. For a tree - not only do you need droppable areas in-between each node, but also ON each node. Say, when i drag over 'option 4', its background color could change, and when I drop, the dropped node will then become a child of 'option 4'. Basically, being able to do what this backbase example does - along with the reordering you've already come up with: http://www.backbase.com/demos/explorer/#examples/drag-treelist.xml[5] What do you think? Would something like this be fairly easy to do with the way it has been built? I'll have a play with the code over the next few days because this would be really useful to me. I'll let you know how I get on. Regards, James On Mon, 2006-10-23 at 22:44 +0300, Stefan Petre wrote: Hi there, Me and Paul are thinking to change the way sortables are working right now. So I had an idea that turned to be quite nice because of 2 reasons: - works faster - you can sort nested list But also has some drawbacks: you ca not have fancy affects. Please take a look at this draft http://interface.eyecon.ro/demos/test_sort.html and tell me if this kind of behavior on sortables fits you and if it is working on Safari or Linux environment. I tested on Windows, IE6, FF 1.5 and OP9 Check out the code. Simple and easy to implement. It is so easy to love jQuery. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Visual jQuery Announcement
Yehuda Katz wrote: I just updated Visual jQuery so it uses docs that include the plugins in the svn. From helping people on #jquery, one thing I'd love is to be able to link directly to a particular function. Something like http://visualjquery.com/#Core-Attributes-rel would be fantastic. It would also be nice, but far less important, if URIs in the documentation were transformed into links in the HTML. Keep up the great work! -- Best wishes, Dave Cardwell http://davecardwell.co.uk/geekery/javascript/jquery/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/