[jQuery] Re: Autocomplete.js not runs on PHP Version 5.0.2
On 7/21/07, Stephan Beal [EMAIL PROTECTED] wrote: On Jul 21, 3:26 pm, navi [EMAIL PROTECTED] wrote: I found that autocomplete runs only on PHP 5.2 and higher version, Any solution in this regard. Unfortunately, the author of autocomplete fails to document which PHP version it needs. About which autocomplete plugin is this? If it's mine or any of the derivatives, I'm quite positive you don't need any PHP to run it. Just JavaScript and jQuery will do. The example on dyve.net uses PHP, but that's just the example. -Dylan
[jQuery] selecting next/prev element in a table
Hi list, I have a number of checkboxes, each inside a table cell. I want to let user navigate through these checkboxes using arrow keys. To do so I start with a code like this: $(input:checkbox).bind(keydown, function(e) { // Here I want to find previous or next checkbox element if (e.keyCode == 38) { // select next } else if () { // select prev } }); How can I select (focus on) next or previous checkbox in a cell? there might be different level of nesting for checkboxes, for example: table tr td [checkbox] /td td [checkbox] /td tr td span[checkbox]span /td td [checkbox] /td /tr /table Thanks, Mohsen.
[jQuery] Re: Autocomplete.js not runs on PHP Version 5.0.2
On Jul 23, 4:27 pm, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote: In short: any PHP version under 5.2 won't be supported much longer by many leading PHP applications/frameworks. This is not the truth, this site suggest to make the transition to php5 as soon as possible cause php4 development is reaching the end, only security bug will be ported to the 4.4 family. What i said is a verifiable fact. A large group of popular PHP application authors have teamed up and said, after February 5th, 2008, PHP versions under 5.2 will not be supported by us. If you've found yourself in the situation of having to maintain PHP4 and PHP5 code, in the same tree, you'll understand why it's so problematic.
[jQuery] Re: Toggling an objects visiblty without show and hide
For information, the reason that works is that setting {visibility:hidden} hides the element but the element's box still affects layout. Setting {display:none} suppresses box generation altogether. (From http://www.w3.org/TR/REC-CSS2/visufx.html#visibility) --rob On 7/24/07, Aaron Heimlich [EMAIL PROTECTED] wrote: jQuery.fn.toggleVis = function() { // Here, this is the jQuery object // This return statement is used for two reasons // 1. To make sure we hit every HTML element in the jQuery object // 2. To make sure that this method doesn't break the chain return this.each(function() { // Iterate over all selected HTML elements and toggle their visibility CSS property // Here, this a HTML element if(this.style.visibility == 'hidden') { this.style.visibility = 'visible'; } else { this.style.visibility = 'hidden'; } }); }; Usage: $('mySelector').toggleVis(); On 7/23/07, Mitchell Waite [EMAIL PROTECTED] wrote: I like jQuery effects show and hide but they actually remove the object from the screen. So an H1 under an image will move up. Can someone show me the best way to change (toggle) an objects visibility property between hidden and visible so any HTML under it will not move. Mitch -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Possible to retrieve image data via AJAX for display?
JK, Thanks but no - that's my alternative. Dan, Absolutely, please do tell me if I am! I have a server-side script which generates a graph image given a set of dataset identifiers. Additional datasets are implicitly added server-side too. Currently the image contains the legend, but I'd like to generate the legend in HTML as it'll be more consistent with legends used for tables. The legend contents cannot be determined until partway through graph generation - so I'd like to retrieve both raw image data and legend data via AJAX, build the legend's HTML representation and display the image. Otherwise, I'll use an AJAX request to return the legend data, and cache the intermediate step so that when I insert the img tag for the graph, the generating script doesn't need to repeat the first part. What do you think? --rob On 7/23/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Rob, I have a feeling the answer is a flat 'no', but want to check: is it possible for an AJAX request to retrieve binary image data (e.g. raw GIF) and display that on the page? Can you describe the *exact* effect your trying to achieve? Why do you think you need to load binary image data via AJAX? I'm asking just to make sure you're not barking up the wrong tree... -Dan -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Opening external links in a new window
Matt, The point of writing code that conforms with specifications isn't to satisfy the validator. The point of satisfying the validator is so that you know that your code will work as expected in all conforming browsers. --rob On 7/24/07, Matt Stith [EMAIL PROTECTED] wrote: Im not really worried about that.. The validator wont notice that your setting the target with javascript, so its fine for me :P On 7/23/07, Karl Swedberg [EMAIL PROTECTED] wrote: On Jul 23, 2007, at 7:53 PM, Matt Stith wrote: Or even easier, $([EMAIL PROTECTED]'http']).attr('target','_blank'); yeah, but I avoid the target attribute out of habit because as far as I can tell it's not valid with strict doctypes: http://www.w3.org/MarkUp/2004/xhtml-faq#target --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] UPDATED: jQuery moreSelectors plugin adds :color() :colIndex() :hover and more
The jQuery moreSelectors plugin has been updated for jQuery v1.1.3.1. For example: DIV:color(red) to match DIVs with red text. Also matches #rrggbb and rgb(r,g,b). TD:colIndex(1) to match table cells in column 1 (allowing for colSpans too). SELECT:modified to match SELECTs that have been changed. *:blur to match form element that last had the focus. - jQuery Plugin page: http://jquery.com/plugins/project/moreSelectors - Download: http://www.softwareunity.com/sandbox/JQueryMoreSelectors/ - Demo: http://www.softwareunity.com/sandbox/JQueryMoreSelectors/#DemoArea Hope you find something useful in there! (Also includes several undocumented selectors and extensions) George -- View this message in context: http://www.nabble.com/UPDATED%3A-jQuery-moreSelectors-plugin-adds-%3Acolor%28%29-%3AcolIndex%28%29-%3Ahover-and-more-tf4134412s15494.html#a11758739 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: JQuery plugins won't work in IE on this page only
On Jul 23, 9:07 pm, textdriven [EMAIL PROTECTED] wrote: If you look at the following page you'll see that the photonews letter works fine in IE (loads newsletters in Thickbox) and also work for all the other pages that use it... http://kadampa.org/en/centers/kmc-france/ Except for this page on which neither the accordion or thickbox work in IE. http://kadampa.org/en/centers/kmc-brazil/ Any ideas why? As a general rule, if a tool works in all cases except one, the problem is not with the tool, but with the use case. In other words, you are certainly doing something different in the kmc-brazil directory (e.g. including scripts from a different (incorrect) path, or similar). A usability note: i find the accordion idea very confusing to use in this context. i would require a CLICK instead of HOVER in that place. Also, in Firefox 2.x, SOMETIMES i have to move the mouse over a year number TWICE to get the link to trigger. That is, i move the mouse over it, nothing happens, i move the mouse out and back, and then it works.
[jQuery] [To Klaus] tabs plugin suggestion
Klaus, I've got a page which has two parts, a side bar, and a main content container. The main container is tabbed with your excellent plugin, but the contents of the sidebar must also vary in-line with the tabs. What I've done is given the tab li elements IDs like 'action-tab', and the div elements IDs like 'sidebar-action-tabcont' so that with onShow and onHide handlers for the tabs I can show and hide the relevant tabs. The one problem with this is that these handlers are not fired for any of the tabs when they are initially setup with .tabs(), so I would suggest that this be done once they are setup - call onHide for the inactive tabs and onShow for the active one. Do you agree with this? Or can you make an alternate suggestion if I'm going about this wrong? Thanks, --rob -- Rob Desbois Eml: [EMAIL PROTECTED]
[jQuery] Re: UPDATED: jQuery moreSelectors plugin adds :color() :colIndex() :hover and more
On 7/24/07, George Adamson [EMAIL PROTECTED] wrote: DIV:color(red) to match DIVs with red text. Also matches #rrggbb and rgb(r,g,b). This is weird. (and really cool *grin)
[jQuery] IE memory problem (still)
Hi, I added some months ago a ticket for memory problems, and as I found it should be fixed already, but I'm still not sure if it is correctly fixed or if there is maybe a different way of doing the same. I have following JavaScript: var h = []; for(var i=0; i20; i++) { h.push(button _idx= + i + Button + i + /button); } $(#display/button).unbind(click, onClick); $(#display).html(h.join(br/)); $(#display/button).bind(click, onClick); If I run this several times memory will grow in IE7 (maybe in IE6, too). When using the sIEve (http://home.wanadoo.nl/jsrosman/) I see #inUse and usage growing. So, what I'm still doing wrong (with the latest jQuery bits)? What I found is that delete this.global[type][index]; in events.remove will set the object to undefined but will remain the arrays length, maybe that is a problem, too. I know that it is not a problem for short running Web pages, but if you are creating a terminal application that is running 24hrs a day you should be aware of this. Michael
[jQuery] problem opening carousel items when page loads :)
hi to all! I have been a special easing script and I have added a onclick event on the images, and now when the page is still loading the images if I click on link inside the carousel it will do what the onclick event is doing, but if I wait for the page to load all the images it won't... my onclick event is nothing more than a XMLHttpRequest which shows the picture in a previously hidden div, but it uses another javaclass... I know it's hard to say if you don't see the code, but I was wandering if someone had similar problems? My script is similar to the one that uses thickbox, and both scipts work fine separately but when I put them together they don't... I could get the code online in a day or so, but I was wandering if someone had similar problems thx peace
[jQuery] Re: What am I missing from this plugin?
On 7/23/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Making it be unobtrusive would be up the developer. The easy way to do this would be for the user to hide the button via CSS and show it after attach your plug-in. The developer could also make their button be able to automatically generate a password by submitting back to the server and generate a password for user via server-side processing and reserve the page with the new password. The problem with generating the button automatically is that there's no way to control the position of the development--which is important for UI. I see. Thanks.
[jQuery] Figuring Type of Selected Element
Hi, I am running an each loop on a group of child elements and then doing something to them. Only, I want to treat tables differently. How can I find out that what type the selected element is? Type as in, is it a table or a div or a span... Thanks, Gurpreet
[jQuery] Re: Figuring Type of Selected Element
Maybe: $(this).is('table') Although, you might want to just use different selectors for the different elements: $(...).find('table').each(...); $(...).find('div').each(...); --Erik On 7/24/07, G[N]Urpreet Singh [EMAIL PROTECTED] wrote: Hi, I am running an each loop on a group of child elements and then doing something to them. Only, I want to treat tables differently. How can I find out that what type the selected element is? Type as in, is it a table or a div or a span... Thanks, Gurpreet
[jQuery] Re: Figuring Type of Selected Element
Use the tagName property on the element. For example: $('.myClass').each(function() { var tag = this.tagName.toLowerCase(); alert(tag); }); Mike On 7/24/07, G[N]Urpreet Singh [EMAIL PROTECTED] wrote: Hi, I am running an each loop on a group of child elements and then doing something to them. Only, I want to treat tables differently. How can I find out that what type the selected element is? Type as in, is it a table or a div or a span... Thanks, Gurpreet
[jQuery] Re: [Announce] jQuery Reference Guide available for pre-order
Is there to be a PDF version of this? There's no mention on the page at all, which is odd. I'd like the information itself, but I'm not sure this type of book is the kind of thing I'd want eating up shelfspace(I have too many books as it is *grin*).
[jQuery] Re: UPDATED: jQuery moreSelectors plugin adds :color() :colIndex() :hover and more
George, Those new selectors are great! On 7/24/07, Su [EMAIL PROTECTED] wrote: On 7/24/07, George Adamson [EMAIL PROTECTED] wrote: DIV:color(red) to match DIVs with red text. Also matches #rrggbb and rgb(r,g,b). This is weird. (and really cool *grin) -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: Sortables (interface plugin)
It's not going to be super easy as there's no built-in support for nested sortables in Interface. The accept option may help. I haven't tested it, but even if it worked, I'm guessing it would require a unique class name on all LIs of each sortable UL. One work-around I've used before: Call .Sortable() on only the parent UL (and maybe SortableAddItem on the LIs) at the moment you want to begin sorting its children (I've done it with a context menu, can be accomplished by other means - perhaps draggable.onStart). Then destroy the sortable when sorting in that list is done. This way only one list is sortable at a time. - Richard On 7/23/07, rayfidelity [EMAIL PROTECTED] wrote: Hello, I have a nested list and i'd like to lock the sortable option to the each level (so that it wouldn't be possible to drag the selected element to the another level). I was looking at the documentation on the interface plugin site (http://interface.eyecon.ro/docs/sort) but i didn't find such an option... Does anywan know if this is possible? I'm also wondering how to submit the resorted list?
[jQuery] Moving Plugins to new repository
I'm not sure how many folks have noticed, but an excellent new plugin repository was activated with little fanfare a few weeks ago at http://jquery.com/plugins. At the moment, we've had a plugin list at http://docs.jquery.com/Plugins, which is where the main plugin link points to. Because of the incredible new features of the new plugin repository, we are going to switch the link over to use it instead of the old wiki page. As a result, we're requesting that all plugin authors add an entry in the new repository with as much detail as possible. We're going to flip the switch on August 1, so again, please get everything moved over as soon as you can. While you're at it, it might be useful to determine whether your plugins still work with the latest version of jQuery. Additionally, all jQuery.fnplugins should return a jQuery object for chainability, so make sure that your plugin does, in fact, do that. Thanks a ton! -- Yehuda Katz Plugin Team Leader | jQuery (ph) 718.877.1325
[jQuery] [Announce] Confirmer plugin update
Hi, all! There's a new release of the Confirmer plugin: Plugin description: Confirmer implements a novel approach to the process of confirming an action. Normally this is achieved via a yes/no dialog box or a button with a confirm checkbox next to it. The Confirmer plugin instead sets up a single button which changes to a confirm the action state if it is clicked one time. If the button is clicked again within a specified time then the action is confirmed, otherwise it times out and returns to its initial state. http://wanderinghorse.net/computing/javascript/jquery/confirmer/ Changes to this release: - Plugin no longer attaches new properties to 'this', as that may cause collisions with jQuery properties. - Implemented Felix Geisendörfer's suggestion: options classInitial and classActivated. This means you can now add/remove a pair of CSS classes as the associated UI control is activated, e.g. to add a red border around the element during the countdown. The classInitial/classActivated feature can be seen in action in the demo app: http://wanderinghorse.net/computing/javascript/jquery/confirmer/demo-confirmer.html (Click the yellow-highlighted SPAN to see it.) The much-discussed disable button for 500ms to avoid double-clicks feature was not added. Well, it WAS added, but was too flaky to keep. i kept having problems with the events when double-clicking, such as both confirmation and cancellation happening. The problems are believed to involve race conditions which cannot be adequately solved in an environment like a browser. One poster suggesting adding a no-op dblclick handler to avoid the problem altogether, but unfortunately a dblclick handler apparently has no effect on Button controls. Happy hacking!
[jQuery] Toggle state
Hello all, first post to this group. I have an element that I'm toggling, is there a way to determine what state it is in? Thanks. Adrian
[jQuery] Form plugin returned data
Hi, is there a way how to access XMLHttpRequest (it's headers) returned after submiting ajaxForm? Now it only returns responseXML/responseText ... Thanks
[jQuery] Form plugin returned XMLHttpRequest
Hi, is there a way how to access XMLHttpRequest (it's headers) returned after submiting ajaxForm? Thanks
[jQuery] BlockUI: Odd behaviour in Internet Explorer
I have been attempting to build functionality into my AJAX app that blocks the UI while the XML is loading. At first I thought I could do this quite simply with a DIV over the top of the content, but as it became increasingly aparent that IE 6 wouldn't work with this approach I went with the blockUI plugin instead. I got it working without too much difficulty but I noticed some odd behaviour in IE. Once the interface has been restored the IE download progress bar is still showing and the throbber (the spinning circle in IE 7 and the Windows logo flag in IE 6) are still animating. They do eventually time out and there doesn't seem to be any impact of the actual workings of my app, but the progress bar and throbber might mislead some users into thinking the page isn't ready to use when in fact it is. The problem seems to have something to do on completion of the AJAX request. When I call unblockUI () on complete the progress bar disappears and the throbber stops. The code for doing it was along these lines: $.ajax ({ type: 'GET', dataType: 'xml', url : 'foo' , complete: function () { $.unblockUI (); } }); However I found the effect a little abrupt so I thought that instead I could do a fade out and call unblockUI in the callback, something like the following: $.ajax ({ type: 'GET', dataType: 'xml', url : 'foo' , complete: function () { $('.blockUI').fadeOut ('slow', function (){$.unblockUI ()}); } }); The fadeout effect happens as desired but the progress bar and throbber still show activity. Does anyone know if this is normal or not? Is there a way of achieving a fade out without causing the throbber problem in IE? For the record the other test browsers did not seem to have this problem. I know that on the whole it's a pretty minor problem but I do still think it might cause confusion for people.
[jQuery] IE6 Show/Hide List Height Issue
I have a div that holds two additional divs that each contain a list you can show and hide. When you show the second list (All link), IE6 cuts the list in half and adds a substantial amount of white space. Any thoughts on why this is happening? And yes, the DOCTYPE needs to be HTML 4.01 Strict. Demo: http://64.13.206.202/ie6ListIssue/
[jQuery] Re: Moving Plugins to new repository
Is the old list still going to be archived (incase some plugins are not updated by the original author and someone takes it over)? On Jul 24, 3:30 pm, Yehuda Katz [EMAIL PROTECTED] wrote: I'm not sure how many folks have noticed, but an excellent new plugin repository was activated with little fanfare a few weeks ago athttp://jquery.com/plugins. At the moment, we've had a plugin list athttp://docs.jquery.com/Plugins, which is where the main plugin link points to. Because of the incredible new features of the new plugin repository, we are going to switch the link over to use it instead of the old wiki page. As a result, we're requesting that all plugin authors add an entry in the new repository with as much detail as possible. We're going to flip the switch on August 1, so again, please get everything moved over as soon as you can. While you're at it, it might be useful to determine whether your plugins still work with the latest version of jQuery. Additionally, all jQuery.fnplugins should return a jQuery object for chainability, so make sure that your plugin does, in fact, do that. Thanks a ton! -- Yehuda Katz Plugin Team Leader | jQuery (ph) 718.877.1325
[jQuery] retrieving the width of an element??
.width() is not enough ;-) I have a div with overflow: hidden and it's width is, suppose, 100px; Inside i have a very long P div style=width: 100px; overflow:hidden p style=white-space:nowrap;my v-e-r-y long text, repeated...my v-e- r-y long text, repeated...100 times/p /div the NOWRAP keep my text in ONE line. Riht? If i ask: $(div p).width() jQuery returns 100! 100 is the value of the visible area, i guess. What for the part i don't see? maybe the dimensions plugin may help? Tried but without success. Is there any way to get the exact value, in PX of a NESTED element even tho it's not FULLY visible? Yes, still the newsticker Thanks in advance. GC
[jQuery] Re: Moving Plugins to new repository
Have all the bugs been fixed? Plugin repository seems to have major feature creep, so much stuff that doesn't seem necessary. On Jul 24, 3:30 pm, Yehuda Katz [EMAIL PROTECTED] wrote: I'm not sure how many folks have noticed, but an excellent new plugin repository was activated with little fanfare a few weeks ago athttp://jquery.com/plugins. At the moment, we've had a plugin list athttp://docs.jquery.com/Plugins, which is where the main plugin link points to. Because of the incredible new features of the new plugin repository, we are going to switch the link over to use it instead of the old wiki page. As a result, we're requesting that all plugin authors add an entry in the new repository with as much detail as possible. We're going to flip the switch on August 1, so again, please get everything moved over as soon as you can. While you're at it, it might be useful to determine whether your plugins still work with the latest version of jQuery. Additionally, all jQuery.fnplugins should return a jQuery object for chainability, so make sure that your plugin does, in fact, do that. Thanks a ton! -- Yehuda Katz Plugin Team Leader | jQuery (ph) 718.877.1325
[jQuery] Re: retrieving the width of an element??
Is this happening in all the browsers or just a specific browser? -- Brandon Aaron On 7/24/07, GianCarlo Mingati [EMAIL PROTECTED] wrote: .width() is not enough ;-) I have a div with overflow: hidden and it's width is, suppose, 100px; Inside i have a very long P div style=width: 100px; overflow:hidden p style=white-space:nowrap;my v-e-r-y long text, repeated...my v-e- r-y long text, repeated...100 times/p /div the NOWRAP keep my text in ONE line. Riht? If i ask: $(div p).width() jQuery returns 100! 100 is the value of the visible area, i guess. What for the part i don't see? maybe the dimensions plugin may help? Tried but without success. Is there any way to get the exact value, in PX of a NESTED element even tho it's not FULLY visible? Yes, still the newsticker Thanks in advance. GC
[jQuery] Re: Toggle state
First thing that comes to mind is to set a variable inside the two sides of the toggle. $(p).toggle(function(){ $(this).addClass(selected); someVar = true; },function(){ $(this).removeClass(selected); someVar = false; }); Glen On 7/24/07, Adrian Lynch [EMAIL PROTECTED] wrote: Hello all, first post to this group. I have an element that I'm toggling, is there a way to determine what state it is in? Thanks. Adrian
[jQuery] noob question - load function - dynamic content to slide in place
I'm new to jQuery and can't figure this one out. Instead of using an ajax get and innerHTML to load in external html, I can just use jQuery's load function: $(emptyDiv).load(externalHTMLFile); which I like! I would like to do is make better use of the graceful animations that jQuery has. I would prefer that the external HTML not show up so suddenly, but instead to slide or fade in place. It's not clear to me how to make that happen. I tried chaining, but by the time the content is loaded, the chained animation doesn't really do the trick: $emptyDiv).load(externalHTMLFile, function() {$emptyDiv.slideDown('slow');}); If you know of answer, please share. Thanks for any help. Tony
[jQuery] AJAX success callback fail, with jquery.form.js
Hi, Dear group user I'm tring to build a ajax paginator, here is my code: $(document).ready( function(){ var opts = { target : '#id-search-result', url : '/query/', success : paginator_hook, }; var form_id = '#id-search-form'; function paginator_hook(){ $('div.paginator a.ajaxpage').click( function(e) { $(this).parents('div.paginator').html('loading...'); $.ajax( { type : 'GET', dataType : 'html', url : $(this).attr('href'), success: function(data){ $ (this).parents('div.paginator').html(data); }, }); return false; }); }; $(form_id).ajaxForm(opts); }); The context is I have a ajax form made with jquery ajaxForm plugin and I want to show the result in a paginator. And the HTML is something like this: form id=id-search-form /form div class=paginator id=id-search-result div id=result-from-ajax-response /div div id=pagnav a href=/pagination/path class=ajaxpagePaginator Link/a /div /div I can get AJAX response when I clicked on the paginator links, but the wrapper div didn't get updated with the responseText(that's to say, success callback failed). Is there anybody encountered the same problem and kind to offer me help? I appreciated if you can give some hint. Best regards! Can
[jQuery] Validation Plugin: Validating newly added dom objects
I have a form which will allow users to duplicate sections of the form at will. For example there is a traveler section; to add a new traveler you click a button which duplicates (it really just appends) that section to the previous section. The problem I am having is that the plguin does not prevent my submit if there are errors in the new section, only in the sections that were available when the page was initially loaded. I am running the validator function again in hopes that it will overwrite the previous and reread the dom. It works in that I can see error messages (if there are other errors in the form) but it will not prevent the submit. Here is my validator function which runs on document.ready: code function thevalidator() { var v = $(#world_wide_travel).validate({ errorContainer: $(#errorbox), focusCleanup: true, submitHandler: function(form) { // get all email addresses for cc'ing getdefaultccFromForm(); // remove stuff we can't see in case a val was filled in then hidden again - php backend will remove empty vals $('.hidden').children(':input').val(''); // get tinymce ready to go by sending content back to textarea tinyMCE.triggerSave(); // prepare Options Object for ajax submit var options = {beforeSubmit: presubmit, target: '#SubmitSuccess',success: postsubmit}; alert('I submitted fool'); //$(form).ajaxSubmit(options); } }); } /code Section duplicator with html removed: code function createDuplicateRequestor(){ var counter=1; $(.inputs_requestor).each(function(i){ //for each set of .inputs being set1, set2, set3 etc... repeat(this.id); // get the current id of the .inputs element and pass it to the repeat function function repeat(currentSet){ counter++; var totalInputs = $(# + currentSet + .formInputs).length; // get current length of .formInputs of the current set ex. = #set1 .formInputs $(# + currentSet + .formInputs:last .add_requestor:visible).click(function(){ //add click handler to current sets .add ex. = #set1Input1 .add $(# + currentSet + .formInputs:last .add_requestor).css({visibility:hidden}); // hide button for current sets .add var idname = currentSet+_+($(# + currentSet + .formInputs).length + 1); var requestorhtml = some html to duplicate; $(# + currentSet + .formInputs:last).after(requestorhtml); // add another set of inputs $(# + currentSet + .formInputs).removeClass(oddBg); // remove oddBg class $(# + currentSet + .formInputs:odd).addClass(oddBg); //add back in oddBg class $(#+currentSet+ .remove_requestor).click(function() { //bind click event to the remove button if($(this).parent().next(.formInputs).length == 0){ //if there are no inputs after these inputs then you are the last one so... $ (this).parent().prev().children(.add_requestor).css({visibility:visible}); // naviagte to the prior inputs and turn on the add } $(this).parent().remove(); //remove this inputs for a specific set $(# + currentSet + .formInputs).removeClass(oddBg); // remove oddBg class $(# + currentSet + .formInputs:odd).addClass(oddBg); //add back in oddBg class }); //setup autocomplete after dom has been created for this section autoshowusers('requestor_name_'+idname,idname); //re-run validator on newly created dom items
[jQuery] Re: noob question - load function - dynamic content to slide in place
Tony, try: (for an ID) $('#emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); (for a class) $('.emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); On 7/24/07, tonywhite [EMAIL PROTECTED] wrote: I'm new to jQuery and can't figure this one out. Instead of using an ajax get and innerHTML to load in external html, I can just use jQuery's load function: $(emptyDiv).load(externalHTMLFile); which I like! I would like to do is make better use of the graceful animations that jQuery has. I would prefer that the external HTML not show up so suddenly, but instead to slide or fade in place. It's not clear to me how to make that happen. I tried chaining, but by the time the content is loaded, the chained animation doesn't really do the trick: $emptyDiv).load(externalHTMLFile, function() {$emptyDiv.slideDown('slow');}); If you know of answer, please share. Thanks for any help. Tony -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: [To Klaus] tabs plugin suggestion
Rob, If I understood you correctly, then idTabs does exactly what your asking for. http://www.sunsean.com/idTabs/ If I misunderstood, can you clarify? ~Sean
[jQuery] Re: Toggling an objects visiblty without show and hide
I get everything but this // This return statement is used for two reasons // 1. To make sure we hit every HTML element in the jQuery object // 2. To make sure that this method doesn't break the chain What does hit mean and what is the chain? I don't want everything to become invisible, just the one container I specify. Wont th is work just fine? jQuery.fn.toggleVis = function() { if(this.style.visibility == 'hidden') { this.style.visibility = 'visible'; } else { this.style.visibility = 'hidden'; } }; From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Heimlich Sent: Monday, July 23, 2007 6:01 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Toggling an objects visiblty without show and hide jQuery.fn.toggleVis = function() { // Here, this is the jQuery object // This return statement is used for two reasons // 1. To make sure we hit every HTML element in the jQuery object // 2. To make sure that this method doesn't break the chain return this.each(function() { // Iterate over all selected HTML elements and toggle their visibility CSS property // Here, this a HTML element if(this.style.visibility == 'hidden') { this.style.visibility = 'visible'; } else { this.style.visibility = 'hidden'; } }); }; Usage: $('mySelector').toggleVis(); On 7/23/07, Mitchell Waite [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I like jQuery effects show and hide but they actually remove the object from the screen. So an H1 under an image will move up. Can someone show me the best way to change (toggle) an objects visibility property between hidden and visible so any HTML under it will not move. Mitch -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: retrieving the width of an element??
parseInt($t(#divID).css(width) ) should work On Jul 24, 11:25 am, Brandon Aaron [EMAIL PROTECTED] wrote: Is this happening in all the browsers or just a specific browser? -- Brandon Aaron On 7/24/07, GianCarlo Mingati [EMAIL PROTECTED] wrote: .width() is not enough ;-) I have a div with overflow: hidden and it's width is, suppose, 100px; Inside i have a very long P div style=width: 100px; overflow:hidden p style=white-space:nowrap;my v-e-r-y long text, repeated...my v-e- r-y long text, repeated...100 times/p /div the NOWRAP keep my text in ONE line. Riht? If i ask: $(div p).width() jQuery returns 100! 100 is the value of the visible area, i guess. What for the part i don't see? maybe the dimensions plugin may help? Tried but without success. Is there any way to get the exact value, in PX of a NESTED element even tho it's not FULLY visible? Yes, still the newsticker Thanks in advance. GC
[jQuery] jcarousel Ajax txt file with Thickbox
Hi, I'm trying to have the new version of jcarousel load dynamically by a txt file in addition to having the loading pictures to open in thickbox. There are examples for 1 or the other and I've been trying for that last day to merge the 2 somehow. The past version had an example of how to merge the two but it doesn't work with the new jcarousel. Has anyone done this and willing to share the code I would be forever in debt. Or if you can give me some pointers on what I need to do. Thanks in advance, Josh
[jQuery] Re: [To Klaus] tabs plugin suggestion
Whoa! Just what I was looking for, can one dynamically assign content to the tabs using Ajax? Great plugin On Jul 24, 6:08 pm, Sean Catchpole [EMAIL PROTECTED] wrote: Rob, If I understood you correctly, then idTabs does exactly what your asking for.http://www.sunsean.com/idTabs/ If I misunderstood, can you clarify? ~Sean
[jQuery] Re: TreeView with Checkbox Tree
There is more to it than just a checkbox. The checking / unchecking behaviors clears or checks the child boxes. MARIO MOURA wrote: Other good example http://www.scbr.com/docs/products/dhtmlxTree/ Regards 2007/6/26, Jörn Zaefferer [EMAIL PROTECTED]: Mario Moura wrote: Yes, Jörn Will be a good addon to treeview. About Christof email if just add the checkboxes to the li-Tag will work? Should I re-create my tree from my select form using option value=0linone/li/option or lioption value=0none/option /li How about this? liinput type=checkbox /Blah/li -- Jörn Zaefferer http://bassistance.de -- Mário Alberto Chaves Moura [EMAIL PROTECTED] 31-9157-6000 -- View this message in context: http://www.nabble.com/TreeView-with-%22Checkbox-Tree%22-tf3976905s15494.html#a11767769 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: retrieving the width of an element??
Calling .width() will return the same value but as a Number and not a String. That takes away the need to do a parseInt on the result. :) -- Brandon Aaron On 7/24/07, Terry B [EMAIL PROTECTED] wrote: parseInt($t(#divID).css(width) ) should work On Jul 24, 11:25 am, Brandon Aaron [EMAIL PROTECTED] wrote: Is this happening in all the browsers or just a specific browser? -- Brandon Aaron On 7/24/07, GianCarlo Mingati [EMAIL PROTECTED] wrote: .width() is not enough ;-) I have a div with overflow: hidden and it's width is, suppose, 100px; Inside i have a very long P div style=width: 100px; overflow:hidden p style=white-space:nowrap;my v-e-r-y long text, repeated...my v-e- r-y long text, repeated...100 times/p /div the NOWRAP keep my text in ONE line. Riht? If i ask: $(div p).width() jQuery returns 100! 100 is the value of the visible area, i guess. What for the part i don't see? maybe the dimensions plugin may help? Tried but without success. Is there any way to get the exact value, in PX of a NESTED element even tho it's not FULLY visible? Yes, still the newsticker Thanks in advance. GC
[jQuery] Re: tabs plugin suggestion
On Jul 24, 12:02 pm, Rob Desbois [EMAIL PROTECTED] wrote: The one problem with this is that these handlers are not fired for any of the tabs when they are initially setup with .tabs(), so I would suggest that this be done once they are setup - call onHide for the inactive tabs and onShow for the active one. Do you agree with this? Or can you make an alternate suggestion if I'm going about this wrong? My tabs plugin does fire the onshow during the initial setup, but i find it philosophically questionable to fire the onhide handlers at setup because they tabs are more like being born instead of being hidden. That said, that's an interesting feature idea. Philosophically questionable, but an interesting idea nonetheless. http://wanderinghorse.net/computing/javascript/jquery/bogotabs/ If i can reconcile with the fundamental funkiness of it, it would be a two-line change to add the onhide-on-birth feature to my plugin. One of the questionable aspects is that we would probably need to call onhide for the initially selected tab, THEN call the onshow handler, just to make sure that everything is internally symmetric. :?
[jQuery] Re: Moving Plugins to new repository
On Jul 24, 5:23 pm, Dan G. Switzer, II [EMAIL PROTECTED] wrote: However, plug-ins that don't need to return a specific value should be returning a jQuery reference so the chain doesn't break. The plug-ins that *do* break the chain should be clearly stated as doing such. That's a question of plugin documentation, though, not the plugin repository. There isn't a plugin master who's going to go through every plugin and ensure that they comply here.
[jQuery] Re: retrieving the width of an element??
Hi. The problem is with this newsticker i'm building for an intranet app @work: http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/beta/ticker-absolute.html This ticker works, but i have to make two prototypes: one with fading . done one with continuous scrolling from right to left. not done (also it's really old-fashion i prefer the phading one) Follow me with this: if i get the data from the XML file, i wrap everything (date in a span) and text (clickable, hence into an A tag) in a very long P (paragraph, block element) and then move (animate) that P from right to left and again as i reach an 'endpoint' it should work. If only i could get the total amount of pixel of such P That's why i need the TOTAL width of my P even if i'm only 'seeing' 650 px of it. Get it? .width() does not work. it always returns the visible area. wich is not good for my 'experiment'. GC On Jul 24, 7:14 pm, Brandon Aaron [EMAIL PROTECTED] wrote: Calling .width() will return the same value but as a Number and not a String. That takes away the need to do a parseInt on the result. :) -- Brandon Aaron On 7/24/07, Terry B [EMAIL PROTECTED] wrote: parseInt($t(#divID).css(width) ) should work On Jul 24, 11:25 am, Brandon Aaron [EMAIL PROTECTED] wrote: Is this happening in all the browsers or just a specific browser? -- Brandon Aaron On 7/24/07, GianCarlo Mingati [EMAIL PROTECTED] wrote: .width() is not enough ;-) I have a div with overflow: hidden and it's width is, suppose, 100px; Inside i have a very long P div style=width: 100px; overflow:hidden p style=white-space:nowrap;my v-e-r-y long text, repeated...my v-e- r-y long text, repeated...100 times/p /div the NOWRAP keep my text in ONE line. Riht? If i ask: $(div p).width() jQuery returns 100! 100 is the value of the visible area, i guess. What for the part i don't see? maybe the dimensions plugin may help? Tried but without success. Is there any way to get the exact value, in PX of a NESTED element even tho it's not FULLY visible? Yes, still the newsticker Thanks in advance. GC
[jQuery] Re: retrieving the width of an element??
EVERYWHERE :-( On Jul 24, 5:25 pm, Brandon Aaron [EMAIL PROTECTED] wrote: Is this happening in all the browsers or just a specific browser?
[jQuery] Re: Toggling an objects visiblty without show and hide
On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: What does hit mean A jQuery object is an pseudo-array[1] that contains all of the HTML elements selected by a give selector. So $(div.foo); is a pseudo-array of all of the div elements on the page that have the class foo. By hit, I mean that toggleVis() will toggle each and every one of the elements selected whatever selector you use (that's usually what you want). and what is the chain? See http://docs.jquery.com/How_jQuery_Works#Chainability_.28The_Magic_of_jQuery.29 I don't want everything to become invisible, just the one container I specify. That's exactly what my plugin does. Only the element's selected by the selector that you use will be affected. Wont th is work just fine? jQuery.fn.toggleVis = function() { if(this.style.visibility == 'hidden') { this.style.visibility = 'visible'; } else { this.style.visibility = 'hidden'; } }; No it won't. In that context, this refers to a jQuery object, which does not have a style property. To iterate over the contents of a jQuery object, use the each method[2], as plugin does. The each method accepts a function, and within that function this is set to whatever element is currently being iterated over. The each method returns the jQuery object it was iterating over, which allows users to continue chaining method calls onto each other. The concept of this is certainly one of the more confusion aspects of jQuery (and of JavaScript in general). For now, I direct you to http://docs.jquery.com/How_jQuery_Works#Callbacks.2C_Functions.2C_and_.27this.27, although there was a post by Michael Geary some time ago[3] that explained this concept very well (as he always does). [1] It's not an actual instance of JavaScript's Array class, but it acts enough like one that it can be used mostly in the same fashion. You can iterate over it like an Array object, and you can access indexes (foo[0], foo[1], foo[2], etc.) like you can with an Array object, but that's about it. [2] http://docs.jquery.com/Core#each.28_fn_.29 [3] I believe this is it: http://groups.google.com/group/jquery-en/browse_thread/thread/d670a83c308961d3/92e29565dff28d32#92e29565dff28d32 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Toggling an objects visiblty without show and hide
I don't think you understand my question. I have a link called 'Change the cats visibility'. I have a div with a cat image inside it. I would like that particular link to change the visibility of that particular image inside a div. I want to be able to give the link an ID and the routine to toggle the visibility a function in jQuery. From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Heimlich Sent: Tuesday, July 24, 2007 10:40 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Toggling an objects visiblty without show and hide On 7/24/07, Mitchell Waite [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: What does hit mean A jQuery object is an pseudo-array[1] that contains all of the HTML elements selected by a give selector. So $(div.foo); is a pseudo-array of all of the div elements on the page that have the class foo. By hit, I mean that toggleVis() will toggle each and every one of the elements selected whatever selector you use (that's usually what you want). and what is the chain? See http://docs.jquery.com/How_jQuery_Works#Chainability_.28The_Magic_of_jQuery. 29 I don't want everything to become invisible, just the one container I specify. That's exactly what my plugin does. Only the element's selected by the selector that you use will be affected. Wont th is work just fine? jQuery.fn.toggleVis = function() { if(this.style.visibility == 'hidden') { this.style.visibility = 'visible'; } else { this.style.visibility = 'hidden'; } }; No it won't. In that context, this refers to a jQuery object, which does not have a style property. To iterate over the contents of a jQuery object, use the each method[2], as plugin does. The each method accepts a function, and within that function this is set to whatever element is currently being iterated over. The each method returns the jQuery object it was iterating over, which allows users to continue chaining method calls onto each other. The concept of this is certainly one of the more confusion aspects of jQuery (and of JavaScript in general). For now, I direct you to http://docs.jquery.com/How_jQuery_Works#Callbacks.2C_Functions.2C_and_.27thi s.27, although there was a post by Michael Geary some time ago[3] that explained this concept very well (as he always does). [1] It's not an actual instance of JavaScript's Array class, but it acts enough like one that it can be used mostly in the same fashion. You can iterate over it like an Array object, and you can access indexes (foo[0], foo[1], foo[2], etc.) like you can with an Array object, but that's about it. [2] http://docs.jquery.com/Core#each.28_fn_.29 [3] I believe this is it: http://groups.google.com/group/jquery-en/browse_thread/thread/d670a83c308961 d3/92e29565dff28d32#92e29565dff28d32 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Toggling an objects visiblty without show and hide
Well you should have mentioned that in the beginning. But, that doesn't mean that my plugin isn't usable. On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: I have a link called 'Change the cats visibility'. I have a div with a cat image inside it. I would like that particular link to change the visibility of that particular image inside a div. I want to be able to give the link an ID and the routine to toggle the visibility a function in jQuery. Using my original plugin: Note: You will have to edit the selectors to actually find the proper elements, as I have no knowledge of your page's structure // Find the Change the cats visibility link and assign a click event handler to it $(a.changeVis).click(function() { // Find the div that has the cat image in it and toggle the image's visibility $(#catDiv img).toggleVis(); }); -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Possible to retrieve image data via AJAX for display?
how does raw image data get you anything? Seems you want the data and the image URL via XHR and then dynamically insert your DOM bits (img tag w/ URL from response with some sort of wrapper containing your legend)... I mean, what you are talking about is technically doable (not in all browsers) http://www.kryogenix.org/days/2003/10/18/embedding but I am not sure it gets you anything. -wade On Jul 24, 3:59 am, Rob Desbois [EMAIL PROTECTED] wrote: JK, Thanks but no - that's my alternative. Dan, Absolutely, please do tell me if I am! I have a server-side script which generates a graph image given a set of dataset identifiers. Additional datasets are implicitly added server-side too. Currently the image contains the legend, but I'd like to generate the legend in HTML as it'll be more consistent with legends used for tables. The legend contents cannot be determined until partway through graph generation - so I'd like to retrieve both raw image data and legend data via AJAX, build the legend's HTML representation and display the image. Otherwise, I'll use an AJAX request to return the legend data, and cache the intermediate step so that when I insert the img tag for the graph, the generating script doesn't need to repeat the first part. What do you think? --rob On 7/23/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Rob, I have a feeling the answer is a flat 'no', but want to check: is it possible for an AJAX request to retrieve binary image data (e.g. raw GIF) and display that on the page? Can you describe the *exact* effect your trying to achieve? Why do you think you need to load binary image data via AJAX? I'm asking just to make sure you're not barking up the wrong tree... -Dan -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Possible to retrieve image data via AJAX for display?
a more recent post about this topic http://rifers.org/blogs/gbevin/2005/4/11/embedding_images_inside_html and make sure to check out the link to http://neil.fraser.name/software/img2html/ because that is just sick! Taking your idea to the next demented level -w On Jul 24, 2:20 pm, traunic [EMAIL PROTECTED] wrote: how does raw image data get you anything? Seems you want the data and the image URL via XHR and then dynamically insert your DOM bits (img tag w/ URL from response with some sort of wrapper containing your legend)... I mean, what you are talking about is technically doable (not in all browsers)http://www.kryogenix.org/days/2003/10/18/embedding but I am not sure it gets you anything. -wade On Jul 24, 3:59 am, Rob Desbois [EMAIL PROTECTED] wrote: JK, Thanks but no - that's my alternative. Dan, Absolutely, please do tell me if I am! I have a server-side script which generates a graph image given a set of dataset identifiers. Additional datasets are implicitly added server-side too. Currently the image contains the legend, but I'd like to generate the legend in HTML as it'll be more consistent with legends used for tables. The legend contents cannot be determined until partway through graph generation - so I'd like to retrieve both raw image data and legend data via AJAX, build the legend's HTML representation and display the image. Otherwise, I'll use an AJAX request to return the legend data, and cache the intermediate step so that when I insert the img tag for the graph, the generating script doesn't need to repeat the first part. What do you think? --rob On 7/23/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Rob, I have a feeling the answer is a flat 'no', but want to check: is it possible for an AJAX request to retrieve binary image data (e.g. raw GIF) and display that on the page? Can you describe the *exact* effect your trying to achieve? Why do you think you need to load binary image data via AJAX? I'm asking just to make sure you're not barking up the wrong tree... -Dan -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Possible to retrieve image data via AJAX for display?
Hi, I have a server-side script which generates a graph image given a set of dataset identifiers. Additional datasets are implicitly added server-side too. Currently the image contains the legend, but I'd like to generate the legend in HTML as it'll be more consistent with legends used for tables. The legend contents cannot be determined until partway through graph generation - so I'd like to retrieve both raw image data and legend data via AJAX, build the legend's HTML representation and display the image. I guess you are lokking for something like canvas. Firefox and Safari do support it. I am not shure about Opera, but IE and Konqueror don't. For IE there is at least IECanvas (http://sourceforge.net/projects/iecanvas), which might be of use. You can use JavaScript to put an Image on a canvas and you also have drawing primitives to add Information. Christof
[jQuery] Re: Moving Plugins to new repository
Is the old list still going to be archived (incase some plugins are not updated by the original author and someone takes it over)? Yeah, we'll make a copy of the old plugin list. Plugin authors should try and prune plugins that they have already moved over, or are dead and they are no longer maintaining. That way the list will be manageable. --John
[jQuery] Re: [To Klaus] tabs plugin suggestion
On 7/24/07, voltron [EMAIL PROTECTED] wrote: Whoa! Just what I was looking for, can one dynamically assign content to the tabs using Ajax? Great plugin Sure you bet. Passing a click function can allow for many possibilities to idTabs, including things entirely different from tabs. I suppose at the moment the only thing you can't change dynamically is which tab a tab opens. ~Sean
[jQuery] Re: retrieving the width of an element??
GianCarlo, Hi. The problem is with this newsticker i'm building for an intranet app @work: http://www.gcmingati.net/wordpress/wp- content/lab/jquery/newsticker/beta/ticker-absolute.html This ticker works, but i have to make two prototypes: one with fading . done one with continuous scrolling from right to left. not done (also it's really old-fashion i prefer the phading one) Follow me with this: if i get the data from the XML file, i wrap everything (date in a span) and text (clickable, hence into an A tag) in a very long P (paragraph, block element) and then move (animate) that P from right to left and again as i reach an 'endpoint' it should work. If only i could get the total amount of pixel of such P That's why i need the TOTAL width of my P even if i'm only 'seeing' 650 px of it. Get it? .width() does not work. it always returns the visible area. wich is not good for my 'experiment'. You need to set the p element to display: inline. That should allow you to get the actual length. Also, I'd probably use div / tags instead of paragraph tags. Regardless of what tag you use, it'll need to have an inline display model. So if it's a block style tag, you'll need to manually make it an inline element. -Dan
[jQuery] Problems with tablesorter
I have a little problem with tablesorter plugin node has no properties [Break on this error] return node.innerHTML; line 147 Because mi table is inside another table (old layout) and this error aoccours but in other page when i load by ajax and set the tablesorter this works and the both have the same estructure =/ -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com
[jQuery] Re: Toggling an objects visiblty without show and hide
My apology for the confusion. I should have just posted the darn code. I'll remember this in the future. I had one typo, left out the # for the container, then it worked fine. I think it's a good demo but I still don't think I need all the for 'each' stuff however. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / titleCSS, DHTML amp; Ajax | Making Objects Appear and Disappear | Changing Visibility Style/title script src=js/jquery.js type=text/javascript/script script type=text/javascript jQuery.fn.toggleVis = function() { // Here, this is the jQuery object // This return statement is used for two reasons // 1. To make sure we hit every HTML element in the jQuery object // 2. To make sure that this method doesn't break the chain return this.each(function() { // Iterate over all selected HTML elements and toggle their visibility CSS property // Here, this a HTML element if(this.style.visibility == 'hidden') { this.style.visibility = 'visible'; } else { this.style.visibility = 'hidden'; } }); }; $(document).ready(function(){ /* testing mouse events in jQuery */ $(#cheshireCat).show(); /* hide cat */ $('#hidecat').click(function(){ $(#cheshireCat).hide(); }); /* show cat */ $('#showcat').click(function(){ $(#cheshireCat).show(); }); /* toggle visibility */ $('#toggle').click(function(){ $('#cheshireCat').toggleVis(); }); }); /script style type=text/css media=screen body { font-size: 1.2em; font-family: Georgia, Times New Roman, times, serif; color: #00; background-color: #ccc; margin: 8px; } #cheshireCat { margin: 8px; } /style /head body a id=hidecat href=#Javascript;Hide The Cat/a a id=showcat href=#Javascript;Show the Cat/a a id=toggle href=#Javascript;Change the Cat's Visibility/a div id=cheshireCatimg src=images/alice24.gif //div h1The Cheshire Cat/h1 /body /html From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mitchell Waite Sent: Tuesday, July 24, 2007 11:08 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Toggling an objects visiblty without show and hide I don't think you understand my question. I have a link called 'Change the cats visibility'. I have a div with a cat image inside it. I would like that particular link to change the visibility of that particular image inside a div. I want to be able to give the link an ID and the routine to toggle the visibility a function in jQuery. From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Heimlich Sent: Tuesday, July 24, 2007 10:40 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Toggling an objects visiblty without show and hide On 7/24/07, Mitchell Waite [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: What does hit mean A jQuery object is an pseudo-array[1] that contains all of the HTML elements selected by a give selector. So $(div.foo); is a pseudo-array of all of the div elements on the page that have the class foo. By hit, I mean that toggleVis() will toggle each and every one of the elements selected whatever selector you use (that's usually what you want). and what is the chain? See http://docs.jquery.com/How_jQuery_Works#Chainability_.28The_Magic_of_jQuery. 29 I don't want everything to become invisible, just the one container I specify. That's exactly what my plugin does. Only the element's selected by the selector that you use will be affected. Wont th is work just fine? jQuery.fn.toggleVis = function() { if(this.style.visibility == 'hidden') { this.style.visibility = 'visible'; } else { this.style.visibility = 'hidden'; } }; No it won't. In that context, this refers to a jQuery object, which does not have a style property. To iterate over the contents of a jQuery object, use the each method[2], as plugin does. The each method accepts a function, and within that function this is set to whatever element is currently being iterated over. The each method returns the jQuery object it was iterating over, which allows users to continue chaining method calls onto each other. The concept of this is certainly one of the
[jQuery] Re: retrieving the width of an element??
hi Dan thanks it seems a 'fundamental' tip. i'll try that tomorrow. i've noticed tho that jquery applies an inline style of display:block to elements phaded or moved with the .animate method. am i right? could be a 'problem?' gc. On Jul 24, 9:22 pm, Dan G. Switzer, II [EMAIL PROTECTED] wrote: GianCarlo, Hi. The problem is with this newsticker i'm building for an intranet app @work: http://www.gcmingati.net/wordpress/wp- content/lab/jquery/newsticker/beta/ticker-absolute.html This ticker works, but i have to make two prototypes: one with fading . done one with continuous scrolling from right to left. not done (also it's really old-fashion i prefer the phading one) Follow me with this: if i get the data from the XML file, i wrap everything (date in a span) and text (clickable, hence into an A tag) in a very long P (paragraph, block element) and then move (animate) that P from right to left and again as i reach an 'endpoint' it should work. If only i could get the total amount of pixel of such P That's why i need the TOTAL width of my P even if i'm only 'seeing' 650 px of it. Get it? .width() does not work. it always returns the visible area. wich is not good for my 'experiment'. You need to set the p element to display: inline. That should allow you to get the actual length. Also, I'd probably use div / tags instead of paragraph tags. Regardless of what tag you use, it'll need to have an inline display model. So if it's a block style tag, you'll need to manually make it an inline element. -Dan
[jQuery] Re: select all unchecked checkboxes
I've just updated the jQuery moreSelectors plugin which includes an :unchecked selector. Might be what you're after. See http://jquery.com/plugins/project/moreSelectors George Rob Desbois-2 wrote: I think $(#myform input:checkbox).not(:checked) should do what you want, but I've not tested it. --rob On 6/26/07, badtant [EMAIL PROTECTED] wrote: Hi! I want to get all checkbox items that are not checked. I use the following to get all checkboxes that is checked but now i want to get the ones that are unchecked, how can I do that? $(#myform input:checkbox:checked) Thanks! /Niklas -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. -- View this message in context: http://www.nabble.com/select-all-unchecked-checkboxes-tf3982502s15494.html#a11770977 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: retrieving the width of an element??
GianCarlo, hi Dan thanks it seems a 'fundamental' tip. i'll try that tomorrow. i've noticed tho that jquery applies an inline style of display:block to elements phaded or moved with the .animate method. am i right? could be a 'problem?' gc. Some effects do change the display to block. However, you should only need to get the width calculation once. If you get it before apply the effect, you should be ok. -Dan
[jQuery] Re: Problems with tablesorter
Hi everyone, I'm trying to bind a custom event and then use trigger() to trigger it, but it's not working for me. Here's my code, does anyone see any issues? Currently it's logging 'mouseout' but not 'my Event' as I mouse over my table cells. $(o).mouseout( function(event) { console.log('mouseout'); $(event.target).trigger('myEvent'); }).bind(myEvent,function(event) { console.log('my Event'); }); Any help is appreciated!! Jeff
[jQuery] Re: Problems with tablesorter
sorry didn't mean to hijack this email - i'll send a different one! On 7/24/07, Jeff L [EMAIL PROTECTED] wrote: Hi everyone, I'm trying to bind a custom event and then use trigger() to trigger it, but it's not working for me. Here's my code, does anyone see any issues? Currently it's logging 'mouseout' but not 'my Event' as I mouse over my table cells. $(o).mouseout( function(event) { console.log('mouseout'); $(event.target).trigger('myEvent'); }).bind(myEvent,function(event) { console.log('my Event'); }); Any help is appreciated!! Jeff
[jQuery] Re: retrieving the width of an element??
Be sure to grab jQuery 1.1.3.1 which only adds display: block when absolutely necessary for animations. -- Brandon Aaron On 7/24/07, GianCarlo Mingati [EMAIL PROTECTED] wrote: hi Dan thanks it seems a 'fundamental' tip. i'll try that tomorrow. i've noticed tho that jquery applies an inline style of display:block to elements phaded or moved with the .animate method. am i right? could be a 'problem?' gc. On Jul 24, 9:22 pm, Dan G. Switzer, II [EMAIL PROTECTED] wrote: GianCarlo, Hi. The problem is with this newsticker i'm building for an intranet app @work: http://www.gcmingati.net/wordpress/wp- content/lab/jquery/newsticker/beta/ticker-absolute.html This ticker works, but i have to make two prototypes: one with fading . done one with continuous scrolling from right to left. not done (also it's really old-fashion i prefer the phading one) Follow me with this: if i get the data from the XML file, i wrap everything (date in a span) and text (clickable, hence into an A tag) in a very long P (paragraph, block element) and then move (animate) that P from right to left and again as i reach an 'endpoint' it should work. If only i could get the total amount of pixel of such P That's why i need the TOTAL width of my P even if i'm only 'seeing' 650 px of it. Get it? .width() does not work. it always returns the visible area. wich is not good for my 'experiment'. You need to set the p element to display: inline. That should allow you to get the actual length. Also, I'd probably use div / tags instead of paragraph tags. Regardless of what tag you use, it'll need to have an inline display model. So if it's a block style tag, you'll need to manually make it an inline element. -Dan
[jQuery] triggering a custom event is not working
Hi everyone, I'm trying to bind a custom event and then use trigger() to trigger it, but it's not working for me. Here's my code, does anyone see any issues? Currently it's logging 'mouseout' but not 'my Event' as I mouse over my table cells. $(o).mouseout( function(event) { console.log('mouseout'); $(event.target).trigger('myEvent'); }).bind(myEvent,function(event) { console.log('my Event'); }); Any help is appreciated!! Jeff
[jQuery] jQuery Live Search - where?
I'm looking for any example about jQuery Live Search. Google gives me this example: http://www.steintafel.ch/blog/2006-10/jquery-visitenkarte-mit-ajax-laden/ but in german(help Klaus and Karl)! ;P Do you know any more example? Cheers
[jQuery] Re: jQuery Live Search - where?
Web Specialist escribi: I'm looking for any example about jQuery Live Search. Google gives me this example: http://www.steintafel.ch/blog/2006-10/jquery-visitenkarte-mit-ajax-laden/ but in german(help Klaus and Karl)! ;P Do you know any more example? Cheers this website is writed with prototype, isnt Jquery but have a live search in the top and is a good example http://www.blinklist.com
[jQuery] Re: jQuery Live Search - where?
It looks from the demo on that site that you're looking for an AutoComplete. Is that correct? If so, check out this one by jQuery team member Joern: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ I've used that one extensively. Rey... Web Specialist wrote: I'm looking for any example about jQuery Live Search. Google gives me this example: http://www.steintafel.ch/blog/2006-10/jquery-visitenkarte-mit-ajax-laden/ http://www.steintafel.ch/blog/2006-10/jquery-visitenkarte-mit-ajax-laden/ but in german(help Klaus and Karl)! ;P Do you know any more example? Cheers
[jQuery] Re: Sortables (interface plugin)
So what would be an alternative (if there is one)? Any suggestions on how to easily implement this feature? On Jul 24, 4:26 pm, Richard D. Worth [EMAIL PROTECTED] wrote: It's not going to be super easy as there's no built-in support for nested sortables in Interface. The accept option may help. I haven't tested it, but even if it worked, I'm guessing it would require a unique class name on all LIs of each sortable UL. One work-around I've used before: Call .Sortable() on only the parent UL (and maybe SortableAddItem on the LIs) at the moment you want to begin sorting its children (I've done it with a context menu, can be accomplished by other means - perhaps draggable.onStart). Then destroy the sortable when sorting in that list is done. This way only one list is sortable at a time. - Richard On 7/23/07, rayfidelity [EMAIL PROTECTED] wrote: Hello, I have a nested list and i'd like to lock the sortable option to the each level (so that it wouldn't be possible to drag the selected element to the another level). I was looking at the documentation on the interface plugin site (http://interface.eyecon.ro/docs/sort) but i didn't find such an option... Does anywan know if this is possible? I'm also wondering how to submit the resorted list?
[jQuery] Re: Form plugin returned XMLHttpRequest
You can defined a complete handler. This handler is passed the XHR and status. For example: $('form').ajaxForm({ complete: function(xhr, status) { var ct = xhr.getResponseHeader(Content-Type)); alert(content type is: + ct); } }); Note that this is possible because the form plugin uses the $.ajax method under the hood. Any options that $.ajax supports can be used with the form plugin as well. Mike On 7/24/07, x0nix [EMAIL PROTECTED] wrote: Hi, is there a way how to access XMLHttpRequest (it's headers) returned after submiting ajaxForm? Thanks
[jQuery] Re: 3 state buttons - is there a best way
$(div.buttons).mousedown(function(){ $(this).addClass(down); }).mouseup(function(){ $(this).removeClass(down); }).hover(function(){ $(this).addClass(hover); },function(){ $(this).removeClass(hover); }); Then in your CSS you would have this: div.buttons { .. } /* Up state */ div.buttons.hover { .. } /* Hover state */ div.buttons.down { .. } /* Down state */ Hope this helps! --John On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: Can anyone point me in the best direction for setting up a three state button using images (up, down and hover). I can imagine a lot of different ways to do it. Each button should be unique (have its own ID).
[jQuery] Re: 3 state buttons - is there a best way
Is there a reason why not to use pure CSS for this? http://www.commadot.com/jquery/buttons/ I use this method for buttons alot. No flicker. Tested in IE6/7, FF, Safari. John, in your example you can't have div.buttons.hover. That doesn't work in IE6 unfortunately. I WISH it did. (http://commadot.com/?p=528) Glen On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: Can anyone point me in the best direction for setting up a three state button using images (up, down and hover). I can imagine a lot of different ways to do it. Each button should be unique (have its own ID).
[jQuery] Re: Toggling an objects visiblty without show and hide
I know this is trivial but what it turned out I needed was something this simple jQuery.fn.toggleVis = function() { if(chesireCat.style.visibility == 'hidden') { chesireCat.style.visibility = 'visible'; } else { chesireCat.style.visibility = 'hidden'; } }; Enabled with this /* toggle visibility */ $('#toggle').click(function(){ $('#cheshireCat').toggleVis(); From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mitchell Waite Sent: Tuesday, July 24, 2007 12:45 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Toggling an objects visiblty without show and hide My apology for the confusion. I should have just posted the darn code. I'll remember this in the future. I had one typo, left out the # for the container, then it worked fine. I think it's a good demo but I still don't think I need all the for 'each' stuff however.
[jQuery] 3 state buttons - is there a best way
Can anyone point me in the best direction for setting up a three state button using images (up, down and hover). I can imagine a lot of different ways to do it. Each button should be unique (have its own ID).
[jQuery] Re: 3 state buttons - is there a best way
The best CSS technique i have found so far for these kinda buttons is http://members.chello.nl/o.karadeniz/sndbx/even_more_sexy_button/index.html Enjoy... -GTG On 7/24/07, Glen Lipka [EMAIL PROTECTED] wrote: Is there a reason why not to use pure CSS for this? http://www.commadot.com/jquery/buttons/ I use this method for buttons alot. No flicker. Tested in IE6/7, FF, Safari. John, in your example you can't have div.buttons.hover. That doesn't work in IE6 unfortunately. I WISH it did. (http://commadot.com/?p=528) Glen On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: Can anyone point me in the best direction for setting up a three state button using images (up, down and hover). I can imagine a lot of different ways to do it. Each button should be unique (have its own ID).
[jQuery] Re: 3 state buttons - is there a best way
John, in your example you can't have div.buttons.hover. That doesn't work in IE6 unfortunately. I WISH it did. (http://commadot.com/?p=528) I'm not sure how you're testing this, but it worked wonderfully for me (You even made me load up Parallels :-P). You need to be careful to make the order right, otherwise one selector may overwrite another, due to its order. --John
[jQuery] Re: Toggling an objects visiblty without show and hide
On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: jQuery.fn.toggleVis = function() { if(chesireCat.style.visibility == 'hidden') { chesireCat.style.visibility = 'visible'; } else { chesireCat.style.visibility = 'hidden'; } }; That works for you??? (works as in functions properly, not as in I'm ok with this), because I couldn't get it to in either Firefox or IE 7. In fact, I was expecting this not to work. As I explained in our off-list communication, that cannot possibly work because there is no variable named chesireCat defined within the toggleVis(). If I correct the spelling mistake and change chesireCat to cheshireCat, then it works, but only in Internet Explorer (which is generally a Bad Thing, you *want* things to work cross-browser[1]). If my original solution was too complex for you, here's a simpler solution (although it lacks the reusability of mine): /* toggle visibility */ $('#toggle').click(function() { // Remember, a jQuery object acts like an array of all elements selected by a // particular selector (in this case, #cheshireCat), so we access individual // elements through numbered array indexes (starting with 0) var cheshireCat = $(#cheshireCat)[0]; if(cheshireCat.style.visibility == 'hidden') { cheshireCat.style.visibility = 'visible'; } else { cheshireCat.style.visibility = 'hidden'; } }); [1] jQuery helps *a lot* in this regard, but it doesn't handle everything. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: AJAX success callback fail, with jquery.form.js
success: function(data){ $(this).parents('div.paginator').html(data); }, } Can, you cannot use this within the callback. But you could rewrite your method like this: function paginator_hook(){ $('div.paginator a.ajaxpage').click( function(e) { var a = this; // store ref to anchor element a.parents('div.paginator').html('loading...'); $.ajax( { type: 'GET', dataType: 'html', url: a.attr('href'), success: function(data) { a.parents('div.paginator').html(data); } }); return false; }); }; Mike On 7/24/07, can xiang [EMAIL PROTECTED] wrote: Hi, Dear group user I'm tring to build a ajax paginator, here is my code: $(document).ready( function(){ var opts = { target : '#id-search-result', url : '/query/', success : paginator_hook, }; var form_id = '#id-search-form'; function paginator_hook(){ $('div.paginator a.ajaxpage').click( function(e) { $(this).parents('div.paginator').html('loading...'); $.ajax( { type : 'GET', dataType : 'html', url : $(this).attr('href'), success: function(data){ $ (this).parents('div.paginator').html(data); }, }); return false; }); }; $(form_id).ajaxForm(opts); }); The context is I have a ajax form made with jquery ajaxForm plugin and I want to show the result in a paginator. And the HTML is something like this: form id=id-search-form /form div class=paginator id=id-search-result div id=result-from-ajax-response /div div id=pagnav a href=/pagination/path class=ajaxpagePaginator Link/a /div /div I can get AJAX response when I clicked on the paginator links, but the wrapper div didn't get updated with the responseText(that's to say, success callback failed). Is there anybody encountered the same problem and kind to offer me help? I appreciated if you can give some hint. Best regards! Can
[jQuery] Re: 3 state buttons - is there a best way
Demo: http://commadot.com/jquery/buttons/cssAND.htm In IE7 and FF, the last one is green. In IE6, the 2nd and 3rd are green. Its a false positive. Ill elaborate the example with other IE6 weirdness. Ganeshji, The technique there is similar to what I am doing, but I am combining the right cap and the left cap into one image. Looking at it, I could probably improve my sprite image to be simpler. Glen On 7/24/07, John Resig [EMAIL PROTECTED] wrote: John, in your example you can't have div.buttons.hover. That doesn't work in IE6 unfortunately. I WISH it did. (http://commadot.com/?p=528) I'm not sure how you're testing this, but it worked wonderfully for me (You even made me load up Parallels :-P). You need to be careful to make the order right, otherwise one selector may overwrite another, due to its order. --John
[jQuery] Re: which autocomplete plugin ...?
You can also try my custom amalgamation of two popular autocompleters here: http://www.vulgarisoip.com/2007/06/29/jquerysuggest-an-alternative-jquery-based-autocomplete-library/ On Jul 23, 2:57 am, mit [EMAIL PROTECTED] wrote: I'm looking for a stable autocomplete plugin. Of the various autocomplete plugins available, which are most commonly used/most stable?
[jQuery] Re: Toggle state
a simple solution that i could think of is $(mySelector).is(:visible); This should return true if your element is visible and false otherwise. Untested though -GTG On 7/24/07, Glen Lipka [EMAIL PROTECTED] wrote: First thing that comes to mind is to set a variable inside the two sides of the toggle. $(p).toggle(function(){ $(this).addClass(selected); someVar = true; },function(){ $(this).removeClass(selected); someVar = false; }); Glen On 7/24/07, Adrian Lynch [EMAIL PROTECTED] wrote: Hello all, first post to this group. I have an element that I'm toggling, is there a way to determine what state it is in? Thanks. Adrian
[jQuery] Re: 3 state buttons - is there a best way
Cool... Let us know... We are always looking for simple elegant solutions. arent we? -GTG On 7/24/07, Glen Lipka [EMAIL PROTECTED] wrote: Demo: http://commadot.com/jquery/buttons/cssAND.htm In IE7 and FF, the last one is green. In IE6, the 2nd and 3rd are green. Its a false positive. Ill elaborate the example with other IE6 weirdness. Ganeshji, The technique there is similar to what I am doing, but I am combining the right cap and the left cap into one image. Looking at it, I could probably improve my sprite image to be simpler. Glen On 7/24/07, John Resig [EMAIL PROTECTED] wrote: John, in your example you can't have div.buttons.hover. That doesn't work in IE6 unfortunately. I WISH it did. (http://commadot.com/?p=528) I'm not sure how you're testing this, but it worked wonderfully for me (You even made me load up Parallels :-P). You need to be careful to make the order right, otherwise one selector may overwrite another, due to its order. --John
[jQuery] Re: Toggle state
I thought of something similar, but I wasn't sure if the toggle is hiding anything. The question didnt specify. Glen On 7/24/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: a simple solution that i could think of is $(mySelector).is(:visible); This should return true if your element is visible and false otherwise. Untested though -GTG On 7/24/07, Glen Lipka [EMAIL PROTECTED] wrote: First thing that comes to mind is to set a variable inside the two sides of the toggle. $(p).toggle(function(){ $(this).addClass(selected); someVar = true; },function(){ $(this).removeClass(selected); someVar = false; }); Glen On 7/24/07, Adrian Lynch [EMAIL PROTECTED] wrote: Hello all, first post to this group. I have an element that I'm toggling, is there a way to determine what state it is in? Thanks. Adrian
[jQuery] Re: 3 state buttons - is there a best way
Yuk that is nasty. First it limits the artwork in a major way. You want to be able to create an image for each state. And it is far more work to make the graphic on that site then it is to make nice arty images of the 3 state buttons. You can find free button graphics all over the net. John: Your adding a class to make the states change. So that implies the images are defined in the CSS. Would it not be much easier to make this three containers on top of each other, each with its own graphic, and just alter the visibility of the div? Here is what I had in mind. The only problem with it I see is that there is flicker when you get the hover state. The problem is that a mouseovers are being sent when you move the mouse a tiny bit. I could not think of a way to stop that other then delaying the period of time the hover state is on a few hundred milliseconds. http://www.whatbird.com/wwwroot/3StateButton.html The code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titlejQuery 3 State Button/title script src=js/jquery.js type=text/javascript/script script type=text/jscript $(document).ready(function(){ /* testing mouse events in jQuery */ $(#normal).show(); $(#hover).hide(); $(#down).hide(); /* show top layer hover */ $('#normal').mouseover(function(){ $(#hover).show(); }); /* hide top layer hover */ $('#normal').mouseout(function(){ $(#hover).hide(); $(#normal).show(); }); /* */ $('#normal').click(function(){ $(#hover).hide(); $(#down).show(); $(#normal).hide(); }); }); /script style type=text/css !-- #hover { position:absolute; width:94px; height:32px; z-index:3; left: 174px; top: 45px; } #normal { position:absolute; width:94px; height:32px; z-index:2; left: 174px; top: 45px; } #down { position:absolute; width:94px; height:32px; z-index:1; left: 174px; top: 45px; } -- /style /head body table width=363 border=0 cellspacing=0 cellpadding=0 tr td height=94 div id=normalimg src=images/b_normal.gif width=93 height=29 //div div id=hoverimg src=images/b_hover.gif width=93 height=29 //div div id=downimg src=images/b_down.gif width=93 height=29 //div/td /tr /table /body /html From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Glen Lipka Sent: Tuesday, July 24, 2007 4:13 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: 3 state buttons - is there a best way Is there a reason why not to use pure CSS for this? http://www.commadot.com/jquery/buttons/ I use this method for buttons alot. No flicker. Tested in IE6/7, FF, Safari. John, in your example you can't have div.buttons.hover. That doesn't work in IE6 unfortunately. I WISH it did. (http://commadot.com/?p=528) Glen On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: Can anyone point me in the best direction for setting up a three state button using images (up, down and hover). I can imagine a lot of different ways to do it. Each button should be unique (have its own ID). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] How to call many ajax functions?
Hi! I have 3 buttons (id's bt1, bt2 and bt3), and each one has a onclick funcion that is a ajax function. I want to execute this code: 1 $(#bt1).click() 2 $(#bt2).click() 3 $(#bt3).click() but to execute the line 2, the line 1 must have finished the execution, and the line 3 shoud be executed when the line 2 finished (all funcions are ajax functions). How can I do this??? Thanks. []'s
[jQuery] Re: BlockUI: Odd behaviour in Internet Explorer
Gordon, I really like this idea so I added it as the default behavior to blockUI. Unblocking is now done as a fade operation in the lastest version (http://jqueryjs.googlecode.com/svn/trunk/plugins/blockUI/jquery.blockUI.js). This can be overridden for anyone that doesn't like it. I'm not seeing the IE6 problem so let me know if that still occurs. Thanks for the idea! Mike On 7/24/07, Gordon [EMAIL PROTECTED] wrote: I have been attempting to build functionality into my AJAX app that blocks the UI while the XML is loading. At first I thought I could do this quite simply with a DIV over the top of the content, but as it became increasingly aparent that IE 6 wouldn't work with this approach I went with the blockUI plugin instead. I got it working without too much difficulty but I noticed some odd behaviour in IE. Once the interface has been restored the IE download progress bar is still showing and the throbber (the spinning circle in IE 7 and the Windows logo flag in IE 6) are still animating. They do eventually time out and there doesn't seem to be any impact of the actual workings of my app, but the progress bar and throbber might mislead some users into thinking the page isn't ready to use when in fact it is. The problem seems to have something to do on completion of the AJAX request. When I call unblockUI () on complete the progress bar disappears and the throbber stops. The code for doing it was along these lines: $.ajax ({ type: 'GET', dataType: 'xml', url : 'foo' , complete: function () { $.unblockUI (); } }); However I found the effect a little abrupt so I thought that instead I could do a fade out and call unblockUI in the callback, something like the following: $.ajax ({ type: 'GET', dataType: 'xml', url : 'foo' , complete: function () { $('.blockUI').fadeOut ('slow', function (){$.unblockUI ()}); } }); The fadeout effect happens as desired but the progress bar and throbber still show activity. Does anyone know if this is normal or not? Is there a way of achieving a fade out without causing the throbber problem in IE? For the record the other test browsers did not seem to have this problem. I know that on the whole it's a pretty minor problem but I do still think it might cause confusion for people.
[jQuery] innerFade or jQuery Cycle Plugin feature addition will pay $$$
The innerFade plug-in and the Cycle plug-in both take a group of divs or images in a class and cross fade them to a set speed and time. Both of these play a sequence and the repeat. Anybody interested in re-programming either Plugin above so the fading can stop once the all the slides have been shown. In other words, the animation stops on the last slide. This would need to be a parameter, so people could have it both ways. This would need to work with multiple instances running at a time. So instance one may stop while instance 2 keeps playing. The Cycle plug-in is probably a better place to start as I see that there is a stop command. As far as I can tell, it has to be called externally from an event - perhaps this can be called internally from a parameter. This does not have to work with random playback, only sequential. I am assuming this is an evenings work for a better coder than myself. I would gladly pay $200 to $250 USD for this to a PayPal account on a working sample. 1/4 up front, remainder on working script. Please reply to this if you're interested. Much appreciated, Julian Dormon -- View this message in context: http://www.nabble.com/innerFade-or-jQuery-Cycle-Plugin-feature-addition-will-pay-%24%24%24-tf4139568s15494.html#a11774878 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: 3 state buttons - is there a best way
What is nasty? The sprite technique is pretty popular specifically because it eliminates flicker and doesnt require javascript. Im not sure what you mean by limits the artwork either. Seems pretty easy to make anything. Normally, I am all for the jQuery method, but this one seems off. Glen On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: Yuk that is nasty. First it limits the artwork in a major way. You want to be able to create an image for each state. And it is far more work to make the graphic on that site then it is to make nice arty images of the 3 state buttons. You can find free button graphics all over the net. John: Your adding a class to make the states change. So that implies the images are defined in the CSS. Would it not be much easier to make this three containers on top of each other, each with its own graphic, and just alter the visibility of the div? Here is what I had in mind. The only problem with it I see is that there is flicker when you get the hover state. The problem is that a mouseovers are being sent when you move the mouse a tiny bit. I could not think of a way to stop that other then delaying the period of time the hover state is on a few hundred milliseconds. http://www.whatbird.com/wwwroot/3StateButton.html The code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titlejQuery 3 State Button/title script src=js/jquery.js type=text/javascript/script script type=text/jscript $(document).ready(function(){ /* testing mouse events in jQuery */ $(#normal).show(); $(#hover).hide(); $(#down).hide(); /* show top layer hover */ $('#normal').mouseover(function(){ $(#hover).show(); }); /* hide top layer hover */ $('#normal').mouseout(function(){ $(#hover).hide(); $(#normal).show(); }); /* */ $('#normal').click(function(){ $(#hover).hide(); $(#down).show(); $(#normal).hide(); }); }); /script style type=text/css !-- #hover { position:absolute; width:94px; height:32px; z-index:3; left: 174px; top: 45px; } #normal { position:absolute; width:94px; height:32px; z-index:2; left: 174px; top: 45px; } #down { position:absolute; width:94px; height:32px; z-index:1; left: 174px; top: 45px; } -- /style /head body table width=363 border=0 cellspacing=0 cellpadding=0 tr td height=94 div id=normalimg src=images/b_normal.gif width=93 height=29 //div div id=hoverimg src=images/b_hover.gif width=93 height=29 //div div id=downimg src=images/b_down.gif width=93 height=29 //div/td /tr /table /body /html *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Glen Lipka *Sent:* Tuesday, July 24, 2007 4:13 PM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: 3 state buttons - is there a best way Is there a reason why not to use pure CSS for this? http://www.commadot.com/jquery/buttons/ I use this method for buttons alot. No flicker. Tested in IE6/7, FF, Safari. John, in your example you can't have div.buttons.hover. That doesn't work in IE6 unfortunately. I WISH it did. (http://commadot.com/?p=528) Glen On 7/24/07, *Mitchell Waite* [EMAIL PROTECTED] wrote: Can anyone point me in the best direction for setting up a three state button using images (up, down and hover). I can imagine a lot of different ways to do it. Each button should be unique (have its own ID).
[jQuery] Re: innerFade or jQuery Cycle Plugin feature addition will pay $$$
I'll add this to the cycle plugin. Mike Anybody interested in re-programming either Plugin above so the fading can stop once the all the slides have been shown. In other words, the animation stops on the last slide.
[jQuery] Formatting External Links
Hello, I was hoping someone could help me out with a little issue im having. I want jquery to convert the target of any link that isn't within my internal site. i tried it one way, in which i added a class to each link that was to go outside. that worked and turned the links from... a class='redir' href=http://google.com;Google/a --to-- a class='redir' href=http://mysite.com/redirect.php?url=http:// google.comGoogle/a --using the jquery-- $(a.redir).attr(href,?=$root;?frame.cfmx?url= + $ (a.redir).attr(href)); buuut... i want to get rid of using the classes altogether. whats the right way to see if mysite.com is in the href part of the link, and if its not, append my redirect script. ive started it below but its just not working for me if($(a).attr(href).contains(http://mysite.com;) == false) { $(this).attr(href,http://mysite.com/redirect.php?url=; + $ (this).attr(href)); }
[jQuery] Re: 3 state buttons - is there a best way
Limits the artwork in the sense the middle portion of all you images must be a stretched background slice, so you can't reproduce all the subtle affects of switching images. You have to produce the end caps from a sliced piece of artwork so this sort of tosses out a lot of high quality graphics. I saw an example somewhere that used the hover compound event in jQuery to toggle between two classes, one representing the normal state button image and the other the roll over image. You can use hover to toggle the a '.hiddenl class that would contain a display: none. If I was smarter I could just write this myself. From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Glen Lipka Sent: Tuesday, July 24, 2007 6:56 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: 3 state buttons - is there a best way What is nasty? The sprite technique is pretty popular specifically because it eliminates flicker and doesnt require javascript. Im not sure what you mean by limits the artwork either. Seems pretty easy to make anything. Normally, I am all for the jQuery method, but this one seems off. Glen On 7/24/07, Mitchell Waite [EMAIL PROTECTED] wrote: Yuk that is nasty. First it limits the artwork in a major way. You want to be able to create an image for each state. And it is far more work to make the graphic on that site then it is to make nice arty images of the 3 state buttons. You can find free button graphics all over the net. John: Your adding a class to make the states change. So that implies the images are defined in the CSS. Would it not be much easier to make this three containers on top of each other, each with its own graphic, and just alter the visibility of the div? Here is what I had in mind. The only problem with it I see is that there is flicker when you get the hover state. The problem is that a mouseovers are being sent when you move the mouse a tiny bit. I could not think of a way to stop that other then delaying the period of time the hover state is on a few hundred milliseconds. http://www.whatbird.com/wwwroot/3StateButton.html The code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titlejQuery 3 State Button/title script src=js/jquery.js type=text/javascript/script script type=text/jscript $(document).ready(function(){ /* testing mouse events in jQuery */ $(#normal).show(); $(#hover).hide(); $(#down).hide(); /* show top layer hover */ $('#normal').mouseover(function(){ $(#hover).show(); }); /* hide top layer hover */ $('#normal').mouseout(function(){ $(#hover).hide(); $(#normal).show(); }); /* */ $('#normal').click(function(){ $(#hover).hide(); $(#down).show(); $(#normal).hide(); }); }); /script style type=text/css !-- #hover { position:absolute; width:94px; height:32px; z-index:3; left: 174px; top: 45px; } #normal { position:absolute; width:94px; height:32px; z-index:2; left: 174px; top: 45px; } #down { position:absolute; width:94px; height:32px; z-index:1; left: 174px; top: 45px; } -- /style /head body table width=363 border=0 cellspacing=0 cellpadding=0 tr td height=94 div id=normalimg src=images/b_normal.gif width=93 height=29 //div div id=hoverimg src=images/b_hover.gif width=93 height=29 //div div id=downimg src=images/b_down.gif width=93 height=29 //div/td /tr /table /body /html From: jquery-en@googlegroups.com [mailto: mailto:jquery-en@googlegroups.com [EMAIL PROTECTED] On Behalf Of Glen Lipka Sent: Tuesday, July 24, 2007 4:13 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: 3 state buttons - is there a best way Is there a reason why not to use pure CSS for this? http://www.commadot.com/jquery/buttons/ I use this method for buttons alot. No
[jQuery] Re: innerFade or jQuery Cycle Plugin feature addition will pay $$$
Hi Mike, Awesome. I would like to pay you for this. You turned me down once before for some form plug-in help. Please let me know your paypal email if you've got one. malsup wrote: I'll add this to the cycle plugin. Mike Anybody interested in re-programming either Plugin above so the fading can stop once the all the slides have been shown. In other words, the animation stops on the last slide. -- View this message in context: http://www.nabble.com/innerFade-or-jQuery-Cycle-Plugin-feature-addition-will-pay-%24%24%24-tf4139568s15494.html#a11775442 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: innerFade or jQuery Cycle Plugin feature addition will pay $$$
Ok, these change are now available: http://www.malsup.com/jquery/cycle/ Let me know if this is what you had in mind. (The docs are updated too). Mike On 7/24/07, juliandormon [EMAIL PROTECTED] wrote: Hi Mike, Awesome. I would like to pay you for this. You turned me down once before for some form plug-in help. Please let me know your paypal email if you've got one. malsup wrote: I'll add this to the cycle plugin. Mike Anybody interested in re-programming either Plugin above so the fading can stop once the all the slides have been shown. In other words, the animation stops on the last slide. -- View this message in context: http://www.nabble.com/innerFade-or-jQuery-Cycle-Plugin-feature-addition-will-pay-%24%24%24-tf4139568s15494.html#a11775442 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: innerFade or jQuery Cycle Plugin feature addition will pay $$$
Ill take the payment if he wont :DI know i didnt help at all but i could always use some extra money xD On 7/24/07, juliandormon [EMAIL PROTECTED] wrote: Hi Mike, Awesome. I would like to pay you for this. You turned me down once before for some form plug-in help. Please let me know your paypal email if you've got one. malsup wrote: I'll add this to the cycle plugin. Mike Anybody interested in re-programming either Plugin above so the fading can stop once the all the slides have been shown. In other words, the animation stops on the last slide. -- View this message in context: http://www.nabble.com/innerFad e-or-jQuery-Cycle-Plugin-feature-addition-will-pay-%24%24%24- tf4139568s15494.html#a11775442 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: Formatting External Links
Gday Justin, From an earlier question I wanted to see how that was done also so created a little sample page. http://www.subtledifference.com.au/jquery/linkout/ Thought of 3 ways, its fairly basic and not a plugin just some code. Essentially: $(document).ready(function(){ $(#linkout).find(a).each(function(){ var siteUrl = 'example.com'; // your site base domain if($(this).attr(href).match(siteUrl)===null $ (this).attr(class)!=='notarget') { $(this).clone().insertAfter(this).addClass('linkout orange').attr('title','Open new window').attr('target','_blank').text(#); } }); }); Hope that helps you out. Cheers Stephen On Jul 25, 12:47 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, I was hoping someone could help me out with a little issue im having. I want jquery to convert the target of any link that isn't within my internal site. i tried it one way, in which i added a class to each link that was to go outside. that worked and turned the links from... a class='redir' href=http://google.com;Google/a --to-- a class='redir' href=http://mysite.com/redirect.php?url=http:// google.comGoogle/a --using the jquery-- $(a.redir).attr(href,?=$root;?frame.cfmx?url= + $ (a.redir).attr(href)); buuut... i want to get rid of using the classes altogether. whats the right way to see if mysite.com is in the href part of the link, and if its not, append my redirect script. ive started it below but its just not working for me if($(a).attr(href).contains(http://mysite.com;) == false) { $(this).attr(href,http://mysite.com/redirect.php?url=; + $ (this).attr(href)); }
[jQuery] Re: Formatting External Links
Hi Justin, Instead of using $('a.redir'), try using $('[EMAIL PROTECTED]') That will select all links with mysite.com anywhere in the href --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 24, 2007, at 10:47 PM, [EMAIL PROTECTED] wrote: Hello, I was hoping someone could help me out with a little issue im having. I want jquery to convert the target of any link that isn't within my internal site. i tried it one way, in which i added a class to each link that was to go outside. that worked and turned the links from... a class='redir' href=http://google.com;Google/a --to-- a class='redir' href=http://mysite.com/redirect.php?url=http:// google.comGoogle/a --using the jquery-- $(a.redir).attr(href,?=$root;?frame.cfmx?url= + $ (a.redir).attr(href)); buuut... i want to get rid of using the classes altogether. whats the right way to see if mysite.com is in the href part of the link, and if its not, append my redirect script. ive started it below but its just not working for me if($(a).attr(href).contains(http://mysite.com;) == false) { $(this).attr(href,http://mysite.com/redirect.php?url=; + $ (this).attr(href)); }
[jQuery] Re: 3 state buttons - is there a best way
This almost works http://www.whatbird.com/wwwroot/3Statebutton_2.html !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleUntitled Document/title script src=js/jquery.js type=text/javascript/script style type=text/css .hidden {display: none;} .showPic { position:absolute; width:94px; height:31px; z-index:1; } /style script type=text/javascript $(document).ready(function(){ $(#showPic).hover(function() { $(#hover, #normal).toggleClass(hidden); }); }); /script /head body div id=showPicimg id=hover src=images/B_hover.gif class=hidden / img id=normal src=images/b_normal.gif / /div /body /html
[jQuery] Is it possible so scroll all the way to the end a div overflow: scroll; ?
I have a div that its overflow attribute is set scroll (or auto), basically, I need to make sure it's always at the bottom. How do I do that? Thanks, Sam
[jQuery] Re: noob question - load function - dynamic content to slide in place
Cool - I get it now. I found that my problem was really that the target div for inserting my HTML wasn't set to display:none; to begin with, so animating it to a block state was just not happening. Thanks for your response - I appreciate the group. On Jul 24, 11:08 am, Benjamin Sterling [EMAIL PROTECTED] wrote: Tony, try: (for an ID) $('#emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); (for a class) $('.emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); On 7/24/07, tonywhite [EMAIL PROTECTED] wrote: I'm new to jQuery and can't figure this one out. Instead of using an ajax get and innerHTML to load in external html, I can just use jQuery's load function: $(emptyDiv).load(externalHTMLFile); which I like! I would like to do is make better use of the graceful animations that jQuery has. I would prefer that the external HTML not show up so suddenly, but instead to slide or fade in place. It's not clear to me how to make that happen. I tried chaining, but by the time the content is loaded, the chained animation doesn't really do the trick: $emptyDiv).load(externalHTMLFile, function() {$emptyDiv.slideDown('slow');}); If you know of answer, please share. Thanks for any help. Tony -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com
[jQuery] Re: Validation Plugin: Validating newly added dom objects
I solved this issue by using the refresh and reset methods from within the duplicator sections. I create the object as the last item on the page to load (i know its cheesy) because setting a var from ready() caused to many issues. On Jul 24, 10:53 am, n0ah [EMAIL PROTECTED] wrote: I have a form which will allow users to duplicate sections of the form at will. For example there is a traveler section; to add a new traveler you click a button which duplicates (it really just appends) that section to the previous section. The problem I am having is that the plguin does not prevent my submit if there are errors in the new section, only in the sections that were available when the page was initially loaded. I am running the validator function again in hopes that it will overwrite the previous and reread the dom. It works in that I can see error messages (if there are other errors in the form) but it will not prevent the submit. Here is my validator function which runs on document.ready: code function thevalidator() { var v = $(#world_wide_travel).validate({ errorContainer: $(#errorbox), focusCleanup: true, submitHandler: function(form) { // get all email addresses for cc'ing getdefaultccFromForm(); // remove stuff we can't see in case a val was filled in then hidden again - php backend will remove empty vals $('.hidden').children(':input').val(''); // get tinymce ready to go by sending content back to textarea tinyMCE.triggerSave(); // prepare Options Object for ajax submit var options = {beforeSubmit: presubmit, target: '#SubmitSuccess',success: postsubmit}; alert('I submitted fool'); //$(form).ajaxSubmit(options); } });} /code Section duplicator with html removed: code function createDuplicateRequestor(){ var counter=1; $(.inputs_requestor).each(function(i){ //for each set of .inputs being set1, set2, set3 etc... repeat(this.id); // get the current id of the .inputs element and pass it to the repeat function function repeat(currentSet){ counter++; var totalInputs = $(# + currentSet + .formInputs).length; // get current length of .formInputs of the current set ex. = #set1 .formInputs $(# + currentSet + .formInputs:last .add_requestor:visible).click(function(){ //add click handler to current sets .add ex. = #set1Input1 .add $(# + currentSet + .formInputs:last .add_requestor).css({visibility:hidden}); // hide button for current sets .add var idname = currentSet+_+($(# + currentSet + .formInputs).length + 1); var requestorhtml = some html to duplicate; $(# + currentSet + .formInputs:last).after(requestorhtml); // add another set of inputs $(# + currentSet + .formInputs).removeClass(oddBg); // remove oddBg class $(# + currentSet + .formInputs:odd).addClass(oddBg); //add back in oddBg class $(#+currentSet+ .remove_requestor).click(function() { //bind click event to the remove button if($(this).parent().next(.formInputs).length == 0){ //if there are no inputs after these inputs then you are the last one so... $ (this).parent().prev().children(.add_requestor).css({visibility:visible}); // naviagte to the prior inputs and turn on the add } $(this).parent().remove(); //remove this inputs for a specific set $(# + currentSet + .formInputs).removeClass(oddBg); // remove oddBg class $(# +
[jQuery] Re: Formatting External Links
Karl, I want to reformat all the links that DONT point to my site. On Jul 24, 11:19 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Justin, Instead of using $('a.redir'), try using $('[EMAIL PROTECTED]') That will select all links with mysite.com anywhere in the href --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 24, 2007, at 10:47 PM, [EMAIL PROTECTED] wrote: Hello, I was hoping someone could help me out with a little issue im having. I want jquery to convert the target of any link that isn't within my internal site. i tried it one way, in which i added a class to each link that was to go outside. that worked and turned the links from... a class='redir' href=http://google.com;Google/a --to-- a class='redir' href=http://mysite.com/redirect.php?url=http:// google.comGoogle/a --using the jquery-- $(a.redir).attr(href,?=$root;?frame.cfmx?url= + $ (a.redir).attr(href)); buuut... i want to get rid of using the classes altogether. whats the right way to see if mysite.com is in the href part of the link, and if its not, append my redirect script. ive started it below but its just not working for me if($(a).attr(href).contains(http://mysite.com;) == false) { $(this).attr(href,http://mysite.com/redirect.php?url=; + $ (this).attr(href)); }