[jQuery] Re: RELEASE: Easing Plugin 1.3 - Now with default easing
Haha, that good huh? On Nov 13, 9:19 am, george.gsgd [EMAIL PROTECTED] wrote: Hi All, I've just updated the easing plugin so you can now specify a default equation for all your animations. http://gsgd.co.uk/sandbox/jquery/easing/ Should make plugin integration much simpler. It overwrites the default swing (renames the standard one to jswing) in order to accomplish this, so just be aware of that. Comments welcome. George.
[jQuery] bind and one to avoid event-bubbling
Hi, I have this situation: When I click on an element (A), a new element (B) of same type is overlayed to A on foreground. When I click on B, B disappares and remain A on foreground. When I re- click on A 2 elements B are overlayed instead of 1. I guess this is a problem of event-bubbling, and so instead of use bind to catch click event of mouse, I use one for A and B. Obviously one permits only one click for an element, and so I cannot click a second time on A or B. How can I reset one-condition everytime on element is on foreground? Or this is not event-bubbling problem and solution is another? Thanks, Julio
[jQuery] Re: css(...,function(){ return ...;})
But $('#page').css('display',function(){ return 'none'; }); not work for me:-(
[jQuery] Re: clueTip 'rounded' theme issue with showTitle: false
I like the arrows on the rounded corners! Nice! Example #1 on the Rounded Corners Theme doesn't really work because the content in the clueTip is shifted down, out of vertical alignment within the clueTip. I'm guessing maybe it can be shifted up by playing with the padding? I'll give it a shot here soon. Also noticed that using clueTip on forms is problematic because some form elements, especially select boxes, show right though and overlay on top of the clueTip. Rats. http://mammoth.t1shopper.com/voip/internet_phone_service_details.php?p=1
[jQuery] Getting the values of the Dropdownlist, inside a DialogBox
I am having one dialog box in a.aspx, in some scenario dialogbox will be opened.In that Dialog box,there is one Dropdownlist box. The users can able to select the values. I want to get the selected value of the DropDownListBox which is inside the dialog box.
[jQuery] Problem unbinding event from button (function binds event each time it is run)
Hello, i have a problem with a function (functionB) i bind to the click event of a button. Every time the function (functionA) which binds this event is called, it adds functionB another time. So after i called functionA five times, functionB runs five times on button click. I tried to unbind this event in functionB, but it does not seem to work. I hope anybody understands this squirrel dropping of a post ... An example code with my problem: this.functionA = function(parameter1, parameter2){ $.blockUI(TextEditLayer, {border:'none'}); $('#button').bind('click', function() { var oAjaxObject = new Array(); oAjaxObject[0] = TextEditTextbox.value; oAjaxObject[1] = iJobNumber; myNamespace.myClass.myAjaxMethod(oAjaxObject); $.unblockUI(); $('#button').unbind(); }); }
[jQuery] Use Sortable and Droppable together can't work in IE (but work in Firefox)
I'm having a problem with using Sortable and Droppable (interface plugin for jquery) together.My Idea is drag an item into a container (dropable), and then when I drop it there is one new item will be created in the container item and I want the new items can sort together in the container. As you know, we can't use Sortable and Droppable together. So I have some trick for that problem. Below is my code. As you see, first in the ready() function, I load Sortable for the container and then define draggable for the items. Then, with the onStart event of dragable items, I destroy the sortable of the containers and load droppable of them. The onStop event is when I destroy the droppable and then recall the sortable of the containers.And the problem is that, it worked great in Firefox but rase some error in IE (so I add some stupid try catch for that, but it still can't work :( ). Can you help me for this error? Or are there any other solution to solve my problem? Thank you!!! function loadDropable() { $(div.itemContainer).Droppable( { accept : 'menuItem', hoverclass: 'menuItemHover', ondrop: function (drag) { $(this).html($(this).html() + br/ + $ (drag).attr(id)); } } ); } function loadSortable() { $('div.itemContainer').Sortable( { accept: 'item', helperclass: 'sortHelper', activeclass : 'sortableactive', hoverclass :'sortablehover', handle: 'div.itemTitle', tolerance: 'pointer', onStart : function() { $.iAutoscroller.start(this, document.getElementsByTagName('body')); }, onStop : function() { $.iAutoscroller.stop(); } } ); } $(document).ready( function() { loadSortable(); $('div.menuItem').Draggable( { zIndex: 1000, ghosting: true, opacity:0.7, revert: true, fx:300, onStart: function () { try { $('div.itemContainer').SortableDestroy(); } catch(err) { } loadDropable(); }, onStop: function() { try { $(div.itemContainer).DroppableDestroy(); } catch(err) {} loadSortable(); } } ); } );
[jQuery] Re: What causes the speed bottleneck in Javascript?
Just because the code is open source doesn't mean there's no usage restrictions in what you can do with it. Most open source licenses take a dim view of using open source code in closed source commercial software, as there's always a risk that if it was allowed then the commercial organization would later claim the code as their own and attempt to sue the original creator and/or other projects that also use the code for breach of copyright. And while in theory such a case would go the creator's way, most open source projects are created by small businesses and hobbyists, whereas the likes of Microsoft have entire departments full of high priced lawyers On Nov 15, 4:48 am, Derek Gathright [EMAIL PROTECTED] wrote: I just randomly came across this Ajaxian podcast episode from a while back that answers the very question I posed. http://ajaxian.com/archives/audible-ajax-episode-20-project-tamarin Interestingly, Adobe open-sourced their JIT implementation of Javascript after a 3 year complete rewrite, and that's what Mozilla, Adobe, and others are collaborating on for the Tamerin Project. Some say it can increase speeds up 1ox. While Tamarin won't be in Firefox 3, it will be a later addition, likely Firefox 4 sometime in late '08. In typical Microsoft fashion, they are currently rewriting their own Javascript engine (JScript) and they intend to match, or exceed Tamarin's speed. Why doesn't MS just use Tamarin as well since it is open-source? Here's one instance where I'm glad MS is sticking to their own sandbox cause it just means more competition. If they can't beat Tamarin when they can look at Tamarin's code as much as they want, that's pretty sad. So, to completely answer my question, it looks as if the interpreter is the current bottleneck, but one interviewee said the bottleneck for most AJAX apps will be network speed in the near future. On 10/2/07, Robert Koberg [EMAIL PROTECTED] wrote: On Tue, 2007-10-02 at 11:26 -0500, Derek Gathright wrote: Thanks for the link, interesting stuff. After looking through info on Rhino, I was left with the question... why build the JS core engine in Java and not a non-interpreted language? You can compile them to byte code and create classes (I am guessing that is why rhino performs much better in the 'real world' test cases). I use them for a webapp in a servlet container. best, -Rob
[jQuery] Re: hiding checkbox AND label?
If your HTML is like this: labelLabel text hereinput type=checkbox //label then you can give the label an ID and hide that. label id=myLabel1Label text hereinput type=checkbox //label $('#myLabel1').hide (); If you're using the FOR attribute to hide then there are a few approaches. The easiest would be to give the checkbox and associated label the same class. label for=foo class=myLabel1Label text here/labelinput type=checkbox id=foo class=myLabel1 / $('.myLabel1').hide (); If you can't use classes for whatever reason then you could start trying some trickier stuff. label for=fooLabel text here/labelinput type=checkbox id=foo / $('#foo, label[for=foo]').hide (); Be aware there is a slight speed penalty for using classes instead of IDs, and there's a quite substantial speed penalty for using [] attribute matching instead of IDs or classes. For that reason I'd recommend using IDs or classes and try to avoid the fancier selectors. Your web app will be snappier for it. Don't know how helpful this is but I hope you can find some use for it. On Nov 14, 6:56 pm, Priest, James (NIH/NIEHS) [C] [EMAIL PROTECTED] wrote: Argh - I'm close - but so far I can't seem to hide BOTH the checkbox and label: $('h3').click(function() { $(this).next('.details').find(input:checkbox).not(:checked).hide(); }); OR $('h3').click(function() { $('input:checkbox').each(function() { if (!this.checked) { $(this).next().hide(); } }); }); Both hide the checkbox only. The label remains!! I've tried a few things with parent().next() but either I can remove the checkbox OR the label but never both?? I'm sure I'm missing something simple here Thanks, Jim
[jQuery] Changes repository
Hi! I was wondering where i can find changes history between jquery versions. Actually i need to know changes between version 1.0.x and 1.1.1. Know where i can find such informations? -- Serdecznie pozdrawiam, Adam Ludwinski [EMAIL PROTECTED] http://www.ludwinski.net
[jQuery] Re: History Plugin initial state
On Nov 14, 9:13 pm, dandanthesushiman [EMAIL PROTECTED] wrote: Thanks for the quick reply, but my lack of knowledge means I stil don't get it I am trying $(function() { $('a.remote').remote('#chapter', function() { if (window.console window.console.info) { console.info('content loaded'); } }); $('a.history:eq(0)').history(function() { $('#show-hide').hide(); }); $('a.history:eq(1)').history(function() { $('#show-hide').show(); }); $.ajaxHistory.initialize(function(){ load(hometext.html); }); }); But this does not do it. Any chance you could post code that's a bit more specific or a link to a site that does this so I can look at the code. Thanks Again Is load a function you defined yourself? I guess not and assume you wanted to use jQuery's load method. In that case you need to select the target first, like: $('#target').load('hometext.html'); So: $.ajaxHistory.initialize(function(){ $('#target').load('hometext.html'); }); The code didn't do anything because it threw an error. Do you use Firebug or at least Firefox' error console? You should start using either or (Firebug is highly recommended and I can't imagine working it), because you would have seen there is an error and the reason why the code doesn't do anything. --Klaus
[jQuery] Re: jquery.ifixpng.js IE 7 Transparency is Black instead of transparent
Hi, Guy... Why wouldn't you use if lt IE 7 instead of lte ? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Guy Fraser Sent: Wednesday, November 14, 2007 10:23 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jquery.ifixpng.js IE 7 Transparency is Black instead of transparent cfdvlpr wrote: I'm just trying this nice jquery plugin and it works great to solve some of my IE 6 PNG image problems. But, in IE 7, the images are black. Has anyone else seen this and found a fix for it? Is this a problem specifically with PNG 24 alpha transparency? IE7 natively supports PNG images - so make sure the plugin detects IE7 and doesn't run. We used a conditional comment around the script tag to prevent IE7 processing it... !--[if lte IE 7.] script ![endif]--
[jQuery] Re: clueTip 'rounded' theme issue with showTitle: false
Hi Geoff, Thanks for checking out the plugin! Example #1 on the Rounded Corners Theme doesn't really work because the content in the clueTip is shifted down, out of vertical alignment within the clueTip. I'm guessing maybe it can be shifted up by playing with the padding? I'll give it a shot here soon. Can you tell me which browser you're using when you see the problem with the content shifted down? I tested in Firefox (mac) and IE 6, and it looked fine to me. I set margin: -18px -12px 0 0; for .cluetip-rounded #cluetip-inner and that seemed to do the trick. Maybe there's a browser inconsistency thing that I'm not aware of, though, so any further information would be much appreciated. Also noticed that using clueTip on forms is problematic because some form elements, especially select boxes, show right though and overlay on top of the clueTip. Rats. Ah, yes. This is something that can be handled quite easily with the bgiframe plugin [http://jquery.com/plugins/project/bgiframe]. I should add that to the FAQ. http://mammoth.t1shopper.com/voip/ internet_phone_service_details.php?p=1 doesn't look like your selector -- $('a.rounded') -- is matching anything, because you have no a class=rounded in the HTML. $ ('ol.rounded a') would work. thanks again for the feedback. --Karl
[jQuery] Re: Delibarately create ajax errors from PHP script
In terms of the ajax call, the fact that the php script has returned data (empty or otherwise) is a success, and you can't alter that. The ajax call does not itself care what is in the data, simply that the communication with the backend script was successfully completed. You therefore need to structure your returned data appropriately for backend error conditions, and handle it within the success function of the ajax call. This is simple with, for example, JSON data, but possibly less so with HTML. With JSON data, for example... PHP might return: { ok:false , numErrors:3 , error:[ 'Missing name field' , 'Missing address field' , 'Bad email address' ] } ...or... { ok:true , numFields:3 , field:{ name : 'Joe Bloggs' , address : 'Here, There, Everywhere' , email : '[EMAIL PROTECTED]' } } so your success function could test data.ok and handle the rest of the data as appropriate... success : function(data){ if(data.ok){ //... data good, so process as success }else{ //...data bad, so process as failure } } For HTML data being returned, you could, for example PHP might return: div id='returnData' div id='returnErrors' div class='form_error'Missing name field/div div class='form_error'Missing address field/div div class='form_error'Bad email address/div /div /div ...or... div id='returnData' div id='returnSuccess' div class='form_success'Data added successfully!/div /div /div so your success handler might create the HTML, look for #returnSuccess and handle as appropriate success : function(data){ var $data = $(data) , ok = $data.find('#returnSuccess'); if(ok.length){ //... data good, so $data.appendTo('#goodForm'); }else{ //... data bad, so $data.appendTo('#badForm'); } } The return data structure, the type of data, are down to you, but basically you need to handle it in the success callback. HTH On Nov 15, 7:53 am, Irfan [EMAIL PROTECTED] wrote: Sorry if this has been posted before but I searched the group and could not find a clue. I have a problem which I believe has a simple solution but could not come up with a good way. While using Jquery with PHP, I want error checking to be implemented on the server side - with PHP. As it's much safer and also easier for me. All of the articles/tutorials I've seen about Jquery uses client side Javascript. Whilst I have no problems doing this with PHP , if the server side validation fails [ex: missing a required field or an out of range value in a form etc] I would like the results of this to be printed as a result of errror: section. A typical ajax request is : $.ajax({ type: POST, url: script.php, data: { ... }, success: function(t) { show the result of successful ajax call }, error: function() { show the result of a failure : server timeout etc. } }); } If the validation fails I would like to output the error messages as a result of the error: section because on the success part I usually hide/fadeout the form elements. But as the PHP script has been completed successfully output of the php falls to success section I try to overcome this problem by attaching another event to the output of script, ie: document.ready.function( . but this is really cumbersome. I would highly appreciate other people's solutions, ideas on this subejct Irfan
[jQuery] Re: hiding checkbox AND label?
-Original Message- From: Gordon [mailto:[EMAIL PROTECTED] Be aware there is a slight speed penalty for using classes instead of IDs, and there's a quite substantial speed penalty for using [] attribute matching instead of IDs or classes. For that reason I'd recommend using IDs or classes and try to avoid the fancier selectors. Your web app will be snappier for it. Don't know how helpful this is but I hope you can find some use for it. Gordon - thanks so much for this!! One thing I struggle with using jQuery is I know it *can* be done but am not sure of the best way or the alternatives (and their drawbacks)!! Jim
[jQuery] Re: bind and one to avoid event-bubbling
If you don't need to remove the click functions then they can simply remain in place, and therefore do not need unbinding/re-binding; but you should return false from the click handler to prevent the click event going any further than the intended handler ... $(#elementA).click( function () { $(#elementB).show(); return false; }); $(#elementB).click( function () { $(this).hide(); return false; }); or even... $(#elementA, #elementB).click( function () { $(#elementB).toggle(); return false; }); If you do want to remove the click handler, and re-bind after each click, then... function showB(){ $('#elementB').one('click', function () { $('#elementA').one('click', showB); $(this).hide(); return false; }).show(); return false; } $(#elementA).one('click', showB); On Nov 15, 9:45 am, Shawn [EMAIL PROTECTED] wrote: Try this: $(#elementA).unbind(click).click( function () { $(#elementB).show(); }); $(#elementB).unbind(click).click( function () { $(this).hide(); }); The problem is not event bubbling per se. It's more a case of you are adding element B, then applying event handlers. At a later time, you again add element B and apply event handlers again. You now have two event handers assigned. Using the sample above, you are explicitly saying to unbind the click event handler - so that there is NO handler for the click event. Then we apply a click handler afterwards. This approach ensures only one handler is fired. Of course, this may not be quite what you want in all cases, but I trust you to know your needs.. :) Also, a jQuery guru may correct me and offer an easier method HTH Shawn julio wrote: Hi, I have this situation: When I click on an element (A), a new element (B) of same type is overlayed to A on foreground. When I click on B, B disappares and remain A on foreground. When I re- click on A 2 elements B are overlayed instead of 1. I guess this is a problem of event-bubbling, and so instead of use bind to catch click event of mouse, I use one for A and B. Obviously one permits only one click for an element, and so I cannot click a second time on A or B. How can I reset one-condition everytime on element is on foreground? Or this is not event-bubbling problem and solution is another? Thanks, Julio
[jQuery] Re: css(...,function(){ return ...;})
...but once again it works perfectly for me! Checklist: - I am using jQuery v1.2.1 - I do have an element (a DIV) with the id of 'page' in my document - my script is within a $(document).ready() function - all other jQuery script in that document works correctly - for testing purposes, this was the last executed statement in my script (so nothing else could countermand it) I have tested in FF (v2.0.0.9), IE7 and Opera (v9.23) On Nov 15, 6:31 am, XASD [EMAIL PROTECTED] wrote: But $('#page').css('display',function(){ return 'none'; }); not work for me:-(
[jQuery] Re: Problem unbinding event from button (function binds event each time it is run)
Assuming that function A can be called an unknown/unspecified number of times before #button may actually be clicked, and that what happens when #button is eventually clicked is determined by the most recent call to function A, then ... this.functionA = function(parameter1, parameter2){ $.blockUI(TextEditLayer, {border:'none'}); $('#button').unbind('click').one('click', function() { // note var oAjaxObject = new Array(); oAjaxObject[0] = TextEditTextbox.value; oAjaxObject[1] = iJobNumber; myNamespace.myClass.myAjaxMethod(oAjaxObject); $.unblockUI(); }); } (If the assumptions are incorrect, then probably so is the solution) On Nov 15, 11:18 am, window.close [EMAIL PROTECTED] wrote: Hello, i have a problem with a function (functionB) i bind to the click event of a button. Every time the function (functionA) which binds this event is called, it adds functionB another time. So after i called functionA five times, functionB runs five times on button click. I tried to unbind this event in functionB, but it does not seem to work. I hope anybody understands this squirrel dropping of a post ... An example code with my problem: this.functionA = function(parameter1, parameter2){ $.blockUI(TextEditLayer, {border:'none'}); $('#button').bind('click', function() { var oAjaxObject = new Array(); oAjaxObject[0] = TextEditTextbox.value; oAjaxObject[1] = iJobNumber; myNamespace.myClass.myAjaxMethod(oAjaxObject); $.unblockUI(); $('#button').unbind(); }); }
[jQuery] Re: bind and one to avoid event-bubbling
Try this: $(#elementA).unbind(click).click( function () { $(#elementB).show(); }); $(#elementB).unbind(click).click( function () { $(this).hide(); }); The problem is not event bubbling per se. It's more a case of you are adding element B, then applying event handlers. At a later time, you again add element B and apply event handlers again. You now have two event handers assigned. Using the sample above, you are explicitly saying to unbind the click event handler - so that there is NO handler for the click event. Then we apply a click handler afterwards. This approach ensures only one handler is fired. Of course, this may not be quite what you want in all cases, but I trust you to know your needs.. :) Also, a jQuery guru may correct me and offer an easier method HTH Shawn julio wrote: Hi, I have this situation: When I click on an element (A), a new element (B) of same type is overlayed to A on foreground. When I click on B, B disappares and remain A on foreground. When I re- click on A 2 elements B are overlayed instead of 1. I guess this is a problem of event-bubbling, and so instead of use bind to catch click event of mouse, I use one for A and B. Obviously one permits only one click for an element, and so I cannot click a second time on A or B. How can I reset one-condition everytime on element is on foreground? Or this is not event-bubbling problem and solution is another? Thanks, Julio
[jQuery] jRails plugin: jQuery on Rails
Hey all, I've just built a plugin a that allows you to use jQuery as a replacement for Prototype/script.aculo.us in Rails. It also includes some of the visual effects that were missing since 1.2 came out and broke compatibility with interface. I still have work to do on the visual effects piece but it's a pretty solid release. If you use Rails or are interested in the visual effects implementations, check it out and let me know what you think. http://ennerchi.com/projects/jrails Thanks, -Aaron
[jQuery] Re: Problem unbinding event from button (function binds event each time it is run)
Hello Wizzud and thank you for your reply! Assuming that function A can be called an unknown/unspecified number of times before #button may actually be clicked, and that what happens when #button is eventually clicked is determined by the most recent call to function A, then ... No, after functionA is called, the page is blocked by blockUI - I can either unblock it with the submit button or the cancel button. If I use $('#button').unbind('click').one('click', function() { the function is never called. If I try $('#button').unbind('click'); $('#button').bind('click', function() { no event is unbound - it's called as often as I call functionA Any guess?
[jQuery] Re: Delibarately create ajax errors from PHP script
You could force your PHP to respond with an error header, but I personally don't think that is a very good practice. What I've done in the past is have the PHP script return a JSON response that would look something like: In the case of no validation errors: {'valid':'true'} In the case of validation errors: {'valid':'false', 'error_msg': 'your validation errors here'} Then you'd have: $.ajax({ type: POST, url: script.php, dataType: 'json', data: { ... }, success: function(t) { if (t.valid) { show the result of successful ajax call } else { show the result of t.error_msg } }, error: function() { show the result of a failure : server timeout etc. } }); } Just an idea ;) -Eric On Nov 14, 11:53 pm, Irfan [EMAIL PROTECTED] wrote: Sorry if this has been posted before but I searched the group and could not find a clue. I have a problem which I believe has a simple solution but could not come up with a good way. While using Jquery with PHP, I want error checking to be implemented on the server side - with PHP. As it's much safer and also easier for me. All of the articles/tutorials I've seen about Jquery uses client side Javascript. Whilst I have no problems doing this with PHP , if the server side validation fails [ex: missing a required field or an out of range value in a form etc] I would like the results of this to be printed as a result of errror: section. A typical ajax request is : $.ajax({ type: POST, url: script.php, data: { ... }, success: function(t) { show the result of successful ajax call }, error: function() { show the result of a failure : server timeout etc. } }); } If the validation fails I would like to output the error messages as a result of the error: section because on the success part I usually hide/fadeout the form elements. But as the PHP script has been completed successfully output of the php falls to success section I try to overcome this problem by attaching another event to the output of script, ie: document.ready.function( . but this is really cumbersome. I would highly appreciate other people's solutions, ideas on this subejct Irfan
[jQuery] Re: Why plugin repository dont have a search?
I agree that this feature is sorely needed. The wiki being the old way of posting plugins, may not be kept up to date with current versions or new plugins. It's always a guess as to what category something might be in. What is the definition of some of the categories like widgets, tools and user interface... why would a plugin be in one and not the other? I see that Accessible News Slider is in Animation (slider part I guess), Utilities, User Interface, Widgets... and I stopped looking after that. Apparently there is confusion for plugin developers as well when they need to put their plugin in at least 4 categories. On Nov 14, 5:34 am, Jean [EMAIL PROTECTED] wrote: Always when i come to find some plugin i have to click to browse by name and use the search of Firefox to find what i want, so why dont have any search field? sorry the bad english -- []´s Jeanwww.suissa.info Ethereal Agencywww.etherealagency.com
[jQuery] Browser Exit Event
I'd just like to know what the jQuery best practice for catching the browser exit event is? I'm creating a sort of icon field like a windows desktop -- when a user logs out of the app, or exits the browser I want to persist the positions of the icons which may have changed since the app loaded. I want a method that will work in IE6 and modern browsers, but I know this is a little bit of a tricky situation, so I thought I'd get the advice of the knowledgeable people on this list before I implemented anything. Thanks!
[jQuery] jquery cycle repositing of pager div according to each image height
hi! i was trying without success to get the pager repositioned with each height of my image. I would like to get the pager always exactly on below where the image ends - for now I can only position de pager on a specific distance and it does not change with the different heights of my images - any suggestion? thanks a lot!
[jQuery] Re: Getting the values of the Dropdownlist, inside a DialogBox
What have you tried so far? Can you post some code? -Eric On Nov 15, 12:33 am, kiruba [EMAIL PROTECTED] wrote: I am having one dialog box in a.aspx, in some scenario dialogbox will be opened.In that Dialog box,there is one Dropdownlist box. The users can able to select the values. I want to get the selected value of the DropDownListBox which is inside the dialog box.
[jQuery] Re: HELP with default tooltip
Hi Andrea, Maybe this would work? (untested) $('a:has(img)').each(function() { var $this = $(this); var aTitle = $this.attr('title'); var imgAlt = $('img', $this).attr('alt'); $this.hover(function() { $this.removeAttr('title'); $('img',$this).removeAttr('alt'); }, function() { $this.attr({title: aTitle}); $('img',$this).attr({alt: imgAlt}); }); }); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 15, 2007, at 11:41 AM, [EMAIL PROTECTED] wrote: Hi, I need to prevent the browsers ( All ) to show the title link and the alt message of img as tootltip. The prevention must be made only on a particular link that wrap an image. Any suggestion? Thanks Andrea
[jQuery] Re: RELEASE: Easing Plugin 1.3 - Now with default easing
Nice work. You forgot to update the version at the top of the file. Thanks for this great plugin. Glen On Nov 15, 2007 1:57 AM, george.gsgd [EMAIL PROTECTED] wrote: Haha, that good huh? On Nov 13, 9:19 am, george.gsgd [EMAIL PROTECTED] wrote: Hi All, I've just updated the easing plugin so you can now specify a default equation for all your animations. http://gsgd.co.uk/sandbox/jquery/easing/ Should make plugin integration much simpler. It overwrites the default swing (renames the standard one to jswing) in order to accomplish this, so just be aware of that. Comments welcome. George.
[jQuery] OT: Javascript OOP / Class Design
Hello, This is a bit OT sorry, but I don't know where else to post this JS related question. My question is about using design patterns and OOP principles in Javascript. I am trying to determine the best way to build a photo album application, where the user can layout many photos and each photo can have different properties and behaviors. They can also add text and other elements to their photo album. Does it make sense to create a PhotoElement class for each photo added to the album? This might be instantiating between 10-200 of these objects. Each object would manage its own display, and properties etc. The data would be saved back to the server and when it was reloaded, the data would be parsed back into object instances. So does that make sense, or should I just use a MVC pattern where the controller looks at the data (model) which is, say an array of objects (the photos/page elements) and creates an each instance of the photo representation (renders them to the screen only) and handles all of the interaction through conditional processing as opposed to allowing the objects to do their thing and maintain their own properties and behavior. Anyone? Brook
[jQuery] Re: Adressing the right area
I whipped up a demo for you. http://www.commadot.com/jquery/createDomElements.php Is it something like that? (Open up one of the questions and click reply.) The Live Jquery plugin really makes this sort of thing very easy. Rather than append all the textareas all at once, just do it when the user needs it and append the right ID on the fly. Glen On Nov 15, 2007 5:02 AM, Merlin [EMAIL PROTECTED] wrote: Hi there, I am a beginner in Jquery and need some help to get started. I would like to create a functionality that provides a button underneath each user comment of a picture reply, that would on clicking it show a reply field. Now this does not sound so hard, does it?! It looks hard to me. The problem is, that there could be 100 user comments and I would only want to add a few lines of JQ code. How can I pass the appropiate reply ID, so that on click it does only show the reply box underneath the comment in querstion? Here is how I tried it: $(document).ready(function() { var $loader = 'form method=post name=comment action=act_insert_pic_comment_reply.php style=margin-bottom:0; padding:0; border:0; margin:0 textarea tabindex=2 name=reply id=R1 class=text_L rows=7 cols=36 style=width:468px wrap=virtual/textareabrinput type=Image src=/g/p/2/ BN_ct_sa_en.gif width=80 height=19 '; $('.RB1').click(function(){ $('#C1').html($loader).fadeIn('slow'); return false; }); }); a href=# class=RB1 id=B1bReply/b/a span id=C1/span a href=# class=RB1 id=B2bReply 2/b/a span id=C2/span Thank you for any help on this! Best regards, Merlin
[jQuery] help for a zoom image
Hello, I have a problem with my zoom image. I try to make the same zoom image as you can see on gap website : http://www.gap.com/browse/product.do?cid=5168pid=472867 Here, is an example of my zoom = http://www.hybridbears.com/zoombox/ As you can see the second example doesnt work as well. Can anybody help me? Alex PS : Anybody to make a plugin? :)
[jQuery] Delibarately create ajax errors from PHP script
Sorry if this has been posted before but I searched the group and could not find a clue. I have a problem which I believe has a simple solution but could not come up with a good way. While using Jquery with PHP, I want error checking to be implemented on the server side - with PHP. As it's much safer and also easier for me. All of the articles/tutorials I've seen about Jquery uses client side Javascript. Whilst I have no problems doing this with PHP , if the server side validation fails [ex: missing a required field or an out of range value in a form etc] I would like the results of this to be printed as a result of errror: section. A typical ajax request is : $.ajax({ type: POST, url: script.php, data: { ... }, success: function(t) { show the result of successful ajax call }, error: function() { show the result of a failure : server timeout etc. } }); } If the validation fails I would like to output the error messages as a result of the error: section because on the success part I usually hide/fadeout the form elements. But as the PHP script has been completed successfully output of the php falls to success section I try to overcome this problem by attaching another event to the output of script, ie: document.ready.function( . but this is really cumbersome. I would highly appreciate other people's solutions, ideas on this subejct Irfan
[jQuery] Re: Horizontal Scroll Content Help
Thanks do you have any clearer examples I'm kinda new to this jquery stuff.
[jQuery] jQuery site down - docs
Anyone have an alternate URL for the jQuery docs - seems like the site is down and I need help :) Thanks, Jim
[jQuery] ColdFusion/jQuery Ajax Form Variables Question
Hi All, I'm a relative newb when it comes to the Ajax concept so be gentle. :-) Let me tell you what I've got... Main page with a dynamic select box that lists vendors. When I make a selection I'm using $(#vform).load(editvendor.cfm,{vid: $(this).val()}); to load a form into a div on the main page with it's fields populated with the results of a query. Here's where it gets sketchy. When I want to submit the form and run an update query that will return the updated data back to the form I'm running into trouble. Now, just as a head's up in case it matters, I'm not actually doing a submit with the form, I'm just using a regular html button and running the jQuery .load method onclick of it. I guess my question is: are form variables accessible to the page that is being used in the jQuery .load method? When I try to refer to one like I would in a normal CF form submission to do an update query, #form.co_name#, it's telling me it's not defined. Maybe there's a better way to do what I'm trying to do and I'm clueless? Thx, Mike
[jQuery] Re: jquery.ifixpng.js IE 7 Transparency is Black instead of transparent
My IE 7 doesn't seem to support PNGs like yours does. How about in the head: !--[if lt IE 7.] script type=text/javascript src=/jquery/plugins/ jquery.ifixpng.js/script ![endif]-- !--[if gte IE 7.] script defer type=text/javascript src=/javascript/pngfix.js/ script ![endif]-- And and then in $(function(){ //Use jQuery plugin to fix PNG images in IE 6 if( $.browser.msie (jQuery.browser.version 7.) ) { $('[EMAIL PROTECTED]').ifixpng(); } }
[jQuery] Re: HELP with default tooltip
Thank you Karl, is working fine. A question. here is the code I was trying to use. What was wrong in that?? $('#icons_banner a').hover(function(){ $this = $(this); var tip = $(this).attr('title'); $this.attr({title:''}); $('img',$this).attr({alt:''}); $('#toolbanner_map p').html(tip); },function(){ $this.attr({title:tip}); $('img',$this).attr({alt:tip}); }); Thanks Andrea On Nov 15, 11:10 am, tlphipps [EMAIL PROTECTED] wrote: You can have jquery set the title and alt attributes to blank strings in the document.ready Example: $(#someid_or_other_selector).attr(title, ).attr(alt,); On Nov 15, 10:41 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I need to prevent the browsers ( All ) to show the title link and the alt message of img as tootltip. The prevention must be made only on a particular link that wrap an image. Any suggestion? Thanks Andrea
[jQuery] UI Tabs - Close a tab with a separate button
Hi, I'm using the following javascript to to run a fade/slide/close- able UI box with UI tabs: pre script type=text/javascript $(function() { $('#navcontainer ul').tabs({ unselect: true, fxSlide: true, fxFade: true, fxSpeed: 'medium' }); }); /script /pre I would like to add another line that I could attach to a separate button in the UI box itself that would close the currently selected tab when clicked. Can anyone show me the way? Thanks!
[jQuery] Triggering event added by addEventListener
Hello all, I recently started using jQuery in Greasemonkey scripts and am loving it. I have two Greasemonkey scripts running on a page. Script A adds an element to the page and binds a mouseover handler using DOM addEventListener method. This script is not using jQuery. Script B wants to trigger the event on that element added by script A using the jQuery .trigger('mouseover') method. But the event doesn't fire. Looking at jQuery code (1.2.1) and with the help of Firebug, I found that .trigger('...') fires if the event handler was specified using 'on...' attributes to an element. But it doesn't fire if the event handler was bound via addEventListener. This seems to be true whether the element was native to the page or was dynamically added later by Greasemonkey. Is there any way I can make this work, short of merging the two scripts (which I'd rather not do), or rewriting the script A to use jQuery .bind() method to bind the event handler? Thanks for your time. /prakash
[jQuery] Re: HELP with default tooltip
You can have jquery set the title and alt attributes to blank strings in the document.ready Example: $(#someid_or_other_selector).attr(title, ).attr(alt,); On Nov 15, 10:41 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I need to prevent the browsers ( All ) to show the title link and the alt message of img as tootltip. The prevention must be made only on a particular link that wrap an image. Any suggestion? Thanks Andrea
[jQuery] Re: hiding checkbox AND label?
-Original Message- From: Karl Swedberg [mailto:[EMAIL PROTECTED] Forgive me if you've already posted it, but would you mind showing us the HTML? Labels can wrap around an input, but they don't have to, so seeing what the relationship is between the label and the input (checkbox) would help tremendously. Karl - I've refactored this a bit after finding your show/hide example on learningjquery.com: HTML == div class=demo-show cfoutput query=qryTopics group=category h3 class=right#qryTopics.category#/h3 div class=details cfoutput group=topic div label class=label for=topic_#qryTopics.topicid#input type=checkbox value=#qryTopics.topicid# name=topic_#qryTopics.topicid# id=topic_#qryTopics.topicid# #qryTopics.topic#/label/div /cfoutput /div /cfoutput /div jQuery == script type=text/javascript $.fn.extend({ scrollTo : function(speed, easing) { return this.each(function() { var targetOffset = $(this).offset(); $('html,body').animate({scrollTop: targetOffset}, speed, easing); }); } }); $(document).ready(function() { $('div.demo-show:eq(0) div:gt(0)').hide(); $('div.demo-show:eq(0) h3').click(function() { $(this).removeClass('right').addClass('down').siblings('h3').removeClass ('down').addClass('right'); $(this).next('div:hidden').slideDown('fast').siblings('div:visible').sli deUp('fast'); $(this).scrollTo(1000); }); }); /script Now all I'd like to do is when the divs collapse - if there are checked items within it - keep them visible... Jim
[jQuery] Floated content inside droppable list
Hi, I am using Interface droppable code. I have a UL list. Inside each LI I want to have to float a form with a picture to the right. Since the LI has no position property, the form does not position correctly. If I put position:relative on the droppable LIs they do not drop in place but where they are dropped. How do I get this to work? Is it a CSS problem? ul id=list liSome content here..button class=drag div class=imgUploadformuploadform../form/ div /li liSome content here..button class=drag div class=imgUploadformuploadform../form/ div ul lisome subcontent here ./li /li /li /ul I guess this would be the same problem if the draggable object was div with positioned content. /asle
[jQuery] Re: HELP with default tooltip
Hi Andrea, It looks like you defined the variable inside the mouseover function, which forms a closure, so the mouseout function can't access it. Placing the var tip... line before the $('#icons_banner a').hover(... line ensures that both mouseover and mouseout can use it. Does that make sense? Cheers, --Karl On Nov 15, 2007, at 1:11 PM, [EMAIL PROTECTED] wrote: Thank you Karl, is working fine. A question. here is the code I was trying to use. What was wrong in that?? $('#icons_banner a').hover(function(){ $this = $(this); var tip = $(this).attr('title'); $this.attr({title:''}); $('img',$this).attr({alt:''}); $('#toolbanner_map p').html(tip); },function(){ $this.attr({title:tip}); $('img',$this).attr({alt:tip}); }); Thanks Andrea On Nov 15, 11:10 am, tlphipps [EMAIL PROTECTED] wrote: You can have jquery set the title and alt attributes to blank strings in the document.ready Example: $(#someid_or_other_selector).attr(title, ).attr(alt,); On Nov 15, 10:41 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I need to prevent the browsers ( All ) to show the title link and the alt message of img as tootltip. The prevention must be made only on a particular link that wrap an image. Any suggestion? Thanks Andrea
[jQuery] Re: Selectors in IFrame
Dealing with frames can be a bit tricky. The syntax you describe below is an IE-only solution. There are some different ways to access the document within the frame. All browsers support window.frames[] as an indexer. If there is only one frame on the page, window.frames[0] will work. You can also access that indexer by the name of the frame. iframe name='frame1' src='about:blank'/iframe window.frames['frame1'] Will return the document. Unfortunately, you have to have the name property. Only IE can access the iframe document by id that way. Also, if you have the iframe element, all browsers support the contentWindow property. document.getElementById('iframeid').contentWindow.document Will return the document of the frame. All browsers except IE support the contentDocument property. document.getElementById('iframeid').contentDocument I've thrown up a sample page here: http://cobalt.scorpiontechnology.com/texteditor.htm So you can see the results in different browsers. You'll note in the source code for that page that I put the function in a 0-length timeout script. Firefox is picky about accessing the frame document and the $(document).ready function is too soon in the page lifecycle. As another note, Safari 2 on the Mac is a complete horrible beast when it comes to iframes. The simple page I just threw up there worked fine the first time, but when I refreshed it the window.frames indexer crashed. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of chrismarx Sent: Thursday, November 15, 2007 3:26 AM To: jQuery (English) Subject: [jQuery] Selectors in IFrame What would be a jQuery equivalent for this iFrameTable.document.getElementsByTagName(td) if iFrameTable is the id of the iframe?
[jQuery] Re: jQuery site down - docs
You can try http://www.visualjquery.com/ for jQuery 1.1.2, Alex
[jQuery] Re: Browser Exit Event
[EMAIL PROTECTED] wrote on 11/15/2007 8:12 AM: I'd just like to know what the jQuery best practice for catching the browser exit event is? Probably just bind your code to the onunload event. From the jQuery docs: $(window).unload( function () { alert(Bye now!); } ); More info here: http://docs.jquery.com/Events/unload - Bil
[jQuery] Re: hiding checkbox AND label?
Hi Jim, First of all, feel free to change this selector to match some more meaningful HTML on your page: $('div.demo-show:eq(0) ... I doubt you'll need the :eq(0) part, and the demo-show class was for a demo, so you can safely change that in the HTML and match the change in the jQuery. Now, on to your question. :-) To avoid sliding up the divs that have a checked checkbox in them, change this line ... $(this).next('div:hidden').slideDown('fast').siblings ('div:visible').slideUp('fast'); to this ... $(this).next('div:hidden').slideDown('fast').siblings('div:visible:not (:has(input:checked))').slideUp('fast'); ** will not work in jQuery version below 1.2. for 1.1.4.1 and below, you would need to do this instead: $(this).next('div:hidden').slideDown('fast').siblings('div:visible:not ([input:checked])').slideUp('fast'); Hope that gets you where you want to be. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 15, 2007, at 1:51 PM, Priest, James (NIH/NIEHS) [C] wrote: -Original Message- From: Karl Swedberg [mailto:[EMAIL PROTECTED] Forgive me if you've already posted it, but would you mind showing us the HTML? Labels can wrap around an input, but they don't have to, so seeing what the relationship is between the label and the input (checkbox) would help tremendously. Karl - I've refactored this a bit after finding your show/hide example on learningjquery.com: HTML == div class=demo-show cfoutput query=qryTopics group=category h3 class=right#qryTopics.category#/h3 div class=details cfoutput group=topic div label class=label for=topic_#qryTopics.topicid#input type=checkbox value=#qryTopics.topicid# name=topic_#qryTopics.topicid# id=topic_#qryTopics.topicid# #qryTopics.topic#/label/div /cfoutput /div /cfoutput /div jQuery == script type=text/javascript $.fn.extend({ scrollTo : function(speed, easing) { return this.each(function() { var targetOffset = $(this).offset(); $('html,body').animate({scrollTop: targetOffset}, speed, easing); }); } }); $(document).ready(function() { $('div.demo-show:eq(0) div:gt(0)').hide(); $('div.demo-show:eq(0) h3').click(function() { $(this).removeClass('right').addClass('down').siblings ('h3').removeClass ('down').addClass('right'); $(this).next('div:hidden').slideDown('fast').siblings ('div:visible:not(:has(input:checked))').sli deUp('fast'); $(this).scrollTo(1000); }); }); /script Now all I'd like to do is when the divs collapse - if there are checked items within it - keep them visible... Jim
[jQuery] Re: hiding checkbox AND label?
-Original Message- From: Karl Swedberg [mailto:[EMAIL PROTECTED] Forgive me if you've already posted it, but would you mind showing us the HTML? Labels can wrap around an input, but they don't have to, so seeing what the relationship is between the label and the input (checkbox) would help tremendously. Karl - sorry - code would help huh :) I was thinking about wrapping the label around the input - guess I could go either way on that one - but here's my current HTML (this is actually wrapped up in a ColdFusion loop so it outputs a huge list of topics and categories: Topic 1 0 item 1 0 item 2 Topic 2... 0 item 1 0 item 2 etc... HTML == h3 class=rightTOPIC/h3 div class=details div input type=checkbox value=#qryTopics.topicid# name=topic_#qryTopics.topicid# id=topic_#qryTopics.topicid# label class=label for=topic_#qryTopics.topicid##qryTopics.topic#/label /div /div jQuery === // need to make this a function so we can re-apply row striping after collapse/expand?? $('label:odd').removeClass('even').addClass('odd'); $('label:even').removeClass('odd').addClass('even'); // show all unchecked by default? $('h3').click(function() { // show details div $(this).next().toggle(fast); // toggle arrow indicator if expanded $(this).toggleClass('down').toggleClass('right'); // hide unchecked items (need to add some logic to show if none are checked $(this).next('.details').find('input:checkbox').not(':checked').parent() .hide(); }); This 'sort of' works. I can check the boxes - click on the H3 and then when I re-expand the H3 - I only see the checked items. The problem is if the user hides a topic without checking anything - I need to add in some logic - if NONE of them are checked to allow them to see all the unchecked items again - that's todays challenge... ;) Thanks for any insight you can offer! I learned a lot yesterday just in trial and error - but I'm always wondering when I do things in jQuery if it's the 'best' way... :) Jim
[jQuery] .trigger() behaviour revisited
(I originally mistakenly sent this directly to John rather than the mailing list. Sorry!) The old thread at http://groups.google.com/group/jquery-en/browse_thread/thread/5ea3458c3daf660/9552dbee5c8374a9 [which I am apparently unable to reply directly to, hence the accidental send direct-to-John] discusses inconsistent behaviour between manually clicking a checkbox vs. clicking a checkbox via .trigger(). I notice there now exists a function 'triggerHandler' that allows you to only trigger the event handlers for an element, which is great. However, using the standard 'trigger' (or 'click') function still exhibits the original problem that Chris reported. That is, the ordering in which default action and event handlers are fired differs depending on whether a checkbox is clicked manually vs. clicked via jQuery. Is this still a known issue that will be resolved? Or is it something that will be left as-is? FYI, I am using jQuery 1.2.1. Thanks, Cliff
[jQuery] Re: clueTip 'rounded' theme issue with showTitle: false
Do you have a demo with the arrow and the shadowed theme (first set)? I noticed that each version is getting smaller in k size. What's your secret? On Nov 15, 5:48 am, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Geoff, Thanks for checking out the plugin! Example #1 on the Rounded Corners Theme doesn't really work because the content in the clueTip is shifted down, out of vertical alignment within the clueTip. I'm guessing maybe it can be shifted up by playing with the padding? I'll give it a shot here soon. Can you tell me which browser you're using when you see the problem with the content shifted down? I tested in Firefox (mac) and IE 6, and it looked fine to me. I set margin: -18px -12px 0 0; for .cluetip-rounded #cluetip-inner and that seemed to do the trick. Maybe there's a browser inconsistency thing that I'm not aware of, though, so any further information would be much appreciated. Also noticed that using clueTip on forms is problematic because some form elements, especially select boxes, show right though and overlay on top of the clueTip. Rats. Ah, yes. This is something that can be handled quite easily with the bgiframe plugin [http://jquery.com/plugins/project/bgiframe]. I should add that to the FAQ. http://mammoth.t1shopper.com/voip/ internet_phone_service_details.php?p=1 doesn't look like your selector -- $('a.rounded') -- is matching anything, because you have no a class=rounded in the HTML. $ ('ol.rounded a') would work. thanks again for the feedback. --Karl
[jQuery] Re: hiding checkbox AND label?
-Original Message- From: Karl Swedberg [mailto:[EMAIL PROTECTED] $('div.demo-show:eq(0) ... I doubt you'll need the :eq(0) part, and the demo-show class was for a demo, so you can safely change that in the HTML and match the change in the jQuery. Yeah - I just wanted to keep it the same to make sure I wasn't messing something up! :) $(this).next('div:hidden').slideDown('fast').siblings('div:vis ible:not(:has(input:checked))').slideUp('fast'); SO CLOSE! What I really need - is when the div collapses - is to HIDE the unchecked items: Topics 1 0 item 1 0 item 2 0 item 3 Topics 2 Topics 3 So user selects
[jQuery] Re: hiding checkbox AND label?
Sorry - I hate Outlook... -Original Message- From: Karl Swedberg [mailto:[EMAIL PROTECTED] $('div.demo-show:eq(0) ... I doubt you'll need the :eq(0) part, and the demo-show class was for a demo, so you can safely change that in the HTML and match the change in the jQuery. Yeah - I just wanted to keep it the same to make sure I wasn't messing something up! :) $(this).next('div:hidden').slideDown('fast').siblings('div:vis ible:not(:has(input:checked))').slideUp('fast'); SO CLOSE! What I really need - is when the div collapses - is to HIDE the unchecked items: Topics 1 0 item 1 0 item 2 0 item 3 Topics 2 Topics 3 So user selects Topics 1 x item 1 0 item 2 x item 3 Topics 2 Topics 3 And then clicks Topics 2 they would see: Topics 1 x item 1 x item 3 Topics 2 0 item 1 0 item 2 0 item 3 0 item 4 Topics 3 Hope that makes sense... This is really close - I'm going to tinker with it a bit but would love to hear your input! Jim
[jQuery] Find text in a list item, remove it and replace with an image tag.
Hi all, I am a bit stuck here, I've been looking around, but can't seem to find what I'm after. I am fairly new to Jquery and Javascript, so not sure exactly what to look for. Basically I have the following HTML: div id=topNavigation ul class=firstLevel li class=homea href=/index.phpstrongHome/strong/a/li li class=developmenta href=/front-end- development.phpDevelopment/a/li /ul /div I want to use Jquery to go through each list item, delete the text inside the href (not the strong tag though, if there is one), then add an image tag in it's place (whilst retaining the strong tag around the image if it's there). So the generated code would look like this: div id=topNavigation ul class=firstLevel li class=homea href=/index.phpstrongimg src=/images/ topNavHome.gif alt=Home//strong/a/li li class=developmenta href=/front-end-development.phpimg src=/images/topNavDevelopment.gif alt=Development//a/li /ul /div Now, I'm not sure if we can come up with a clever loop that uses the text to create the image name and alt tag? There are only 5 fixed links in the full version, so I can do manually if need be. I've been trying to use the wrap/prepend/append methods described here http://docs.jquery.com/Tutorials:Rounded_Corners, but really I need to strip the text and replace it with the image tag. Also, there is a strong tag inside the HREF sometimes to show a selected link. I need to keep that there and have the image tag inside it. I don't expect anyone to write the code for me, but if you can just send me some links or point me in the direction of tutorials where I can learn from, that would be great. Thanks Paul
[jQuery] Re: OT: Javascript OOP / Class Design
On Nov 16, 1:37 am, Brook Davies [EMAIL PROTECTED] wrote: Hello, This is a bit OT sorry, but I don't know where else to post this JS related question. My question is about using design patterns and OOP principles in Javascript. You could try news:comp.lang.javascript URL: http://groups.google.com.au/group/comp.lang.javascript/topics?lnk=gschghl=en I am trying to determine the best way to build a photo album application, where the user can layout many photos and each photo can have different properties and behaviors. They can also add text and other elements to their photo album. Does it make sense to create a PhotoElement class for each photo added to the album? This might be instantiating between 10-200 of these objects. Each object would manage its own display, and properties etc. The data would be saved back to the server and when it was reloaded, the data would be parsed back into object instances. So does that make sense, or should I just use a MVC pattern where the controller looks at the data (model) which is, say an array of objects (the photos/page elements) and creates an each instance of the photo representation (renders them to the screen only) and handles all of the interaction through conditional processing as opposed to allowing the objects to do their thing and maintain their own properties and behavior. I would prefer the second approach as it requires a single handler on the page which can be available essentially from the moment visitors see any content. It can see where actions come from and work out what to do based on the class of the target element. The first approach infers that visitors must wait until the page has loaded, or you'd need to use a domRead handler (which is problematic in some browsers) or a polling approach to detect images as they are loaded. I also think it's silly to instantiate a whole bunch of objects when only a few of them will ever be required. Others will disagree of course. If you were creating a game with lots of interactivity my opinion might be different. -- Rob
[jQuery] Re: Find text in a list item, remove it and replace with an image tag.
Why would you want to keep the bold tag if it's just going to be wrapped around an image? -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of desmond Sent: Thursday, November 15, 2007 1:00 PM To: jQuery (English) Subject: [jQuery] Find text in a list item, remove it and replace with an image tag. Hi all, I am a bit stuck here, I've been looking around, but can't seem to find what I'm after. I am fairly new to Jquery and Javascript, so not sure exactly what to look for. Basically I have the following HTML: div id=topNavigation ul class=firstLevel li class=homea href=/index.phpstrongHome/strong/a/li li class=developmenta href=/front-end- development.phpDevelopment/a/li /ul /div I want to use Jquery to go through each list item, delete the text inside the href (not the strong tag though, if there is one), then add an image tag in it's place (whilst retaining the strong tag around the image if it's there). So the generated code would look like this: div id=topNavigation ul class=firstLevel li class=homea href=/index.phpstrongimg src=/images/ topNavHome.gif alt=Home//strong/a/li li class=developmenta href=/front-end-development.phpimg src=/images/topNavDevelopment.gif alt=Development//a/li /ul /div Now, I'm not sure if we can come up with a clever loop that uses the text to create the image name and alt tag? There are only 5 fixed links in the full version, so I can do manually if need be. I've been trying to use the wrap/prepend/append methods described here http://docs.jquery.com/Tutorials:Rounded_Corners, but really I need to strip the text and replace it with the image tag. Also, there is a strong tag inside the HREF sometimes to show a selected link. I need to keep that there and have the image tag inside it. I don't expect anyone to write the code for me, but if you can just send me some links or point me in the direction of tutorials where I can learn from, that would be great. Thanks Paul
[jQuery] Re: Transparent PNG backgrounds with superfish
Hi Olivier, AFAIK, IE can only apply one filter at a time, so when you apply the PNG fix that's your one filter used and then Superfish's opacity animations will not work after that. That's why when you change the code so that the PNG fix is applied after the animation it works for that first time but not subsequent times. A workaround could be to avoid fades for Superfish and just animate the height instead: $('ul.nav').superfish({ animation : { height : 'show' } }); Hope this works. Joel Birch.
[jQuery] Re: Triggering event added by addEventListener
The best approach will be to just use jQuery to bind the method if you want to trigger that event. -- Brandon Aaron On Nov 15, 11:49 am, prakash [EMAIL PROTECTED] wrote: Hello all, I recently started using jQuery in Greasemonkey scripts and am loving it. I have two Greasemonkey scripts running on a page. Script A adds an element to the page and binds a mouseover handler using DOM addEventListener method. This script is not using jQuery. Script B wants to trigger the event on that element added by script A using the jQuery .trigger('mouseover') method. But the event doesn't fire. Looking at jQuery code (1.2.1) and with the help of Firebug, I found that .trigger('...') fires if the event handler was specified using 'on...' attributes to an element. But it doesn't fire if the event handler was bound via addEventListener. This seems to be true whether the element was native to the page or was dynamically added later by Greasemonkey. Is there any way I can make this work, short of merging the two scripts (which I'd rather not do), or rewriting the script A to use jQuery .bind() method to bind the event handler? Thanks for your time. /prakash
[jQuery] Re: RELEASE: Easing Plugin 1.3 - Now with default easing
I second that. Kudos to you George for creating this plug-in. I use it for every project. Thanks! -Marshall Glen Lipka wrote: Nice work. You forgot to update the version at the top of the file. Thanks for this great plugin. Glen On Nov 15, 2007 1:57 AM, george.gsgd [EMAIL PROTECTED] wrote: Haha, that good huh? On Nov 13, 9:19 am, " george.gsgd" [EMAIL PROTECTED] wrote: Hi All, I've just updated the easing plugin so you can now specify a default equation for all your animations. http://gsgd.co.uk/sandbox/jquery/easing/ Should make plugin integration much simpler. It overwrites the default swing (renames the standard one to jswing) in order to accomplish this, so just be aware of that. Comments welcome. George.
[jQuery] Selectors in IFrame
What would be a jQuery equivalent for this iFrameTable.document.getElementsByTagName(td) if iFrameTable is the id of the iframe?
[jQuery] Re: I need use bgIframe plugin with ClockPick puglin
Hi Andres, Josh here, the ClockPick plugin creator...both the hour and minute container have a class of CP, so you should be able to use bgIframe on that class without changing the ClockPick plugin itself. Somewhere after you include the ClockPick script, add this: $(.CP).bgIframe(); Give that a try and see how it goes. -- Josh - Original Message - From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, November 15, 2007 12:26 PM Subject: [jQuery] I need use bgIframe plugin with ClockPick puglin Hi, I´m new. I want to use the bgIframe plugin with ClockPick puglin, because I have a select near to the clockPick and when you make a click and the clockpick expands the select is always first in Internet Explorer. I made this change in the ClockPick.js but only fix the div of the hours, not the div of minutes: line 56 of version 1.1 so so $hourcont = jQuery(div id='CP_hourcont' class='CP' /); $hourcont.bgIframe();//this is my line jQuery(body).append($hourcont); binder($hourcont); I hope you can help me and sorry for my bad english. andres.
[jQuery] Re: HELP with default tooltip
yes Karl thanks for explanation. Andrea On Nov 15, 1:45 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Andrea, It looks like you defined the variable inside the mouseover function, which forms a closure, so the mouseout function can't access it. Placing the var tip... line before the $('#icons_banner a').hover(... line ensures that both mouseover and mouseout can use it. Does that make sense? Cheers, --Karl On Nov 15, 2007, at 1:11 PM, [EMAIL PROTECTED] wrote: Thank you Karl, is working fine. A question. here is the code I was trying to use. What was wrong in that?? $('#icons_banner a').hover(function(){ $this = $(this); var tip = $(this).attr('title'); $this.attr({title:''}); $('img',$this).attr({alt:''}); $('#toolbanner_map p').html(tip); },function(){ $this.attr({title:tip}); $('img',$this).attr({alt:tip}); }); Thanks Andrea On Nov 15, 11:10 am, tlphipps [EMAIL PROTECTED] wrote: You can have jquery set the title and alt attributes to blank strings in the document.ready Example: $(#someid_or_other_selector).attr(title, ).attr(alt,); On Nov 15, 10:41 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I need to prevent the browsers ( All ) to show the title link and the alt message of img as tootltip. The prevention must be made only on a particular link that wrap an image. Any suggestion? Thanks Andrea
[jQuery] Re: Scriptdoc-file for jQuery 1.2.1
On Nov 15, 2007 3:47 PM, dehneg [EMAIL PROTECTED] wrote: Scriptdoc file is a good **standard** to integrate documentation in any IDE. It is also a good way to work with documentation. I suppose that Yehuda Katz use the jQuery scriptdoc file to generate is Visual jQuery Documentation (http://www.visualjquery.com). The actual version of Visual jQuery is for jQuery 1.1.2. It would be great to have an up to date version of visualjquery! It's much easier and faster than the wiki where you have to wait for all the page reloads just to see a snippet of code :(. It gets even worse when you don't know what exactly you're looking for. So many links, so many page reloads, so many tabs and relatively little content :(. -- Tom Sieroń. Skype: tom.sieron :: GG 590961 :: T +48 505 034 253 http://www.linkedin.com/pub/dir/tom/sieron
[jQuery] Re: Floated content inside droppable list
Sorry, this is of course SORTABLE and not droppable. Hope this makes the question clearer!
[jQuery] I need use bgIframe plugin with ClockPick puglin
Hi, I´m new. I want to use the bgIframe plugin with ClockPick puglin, because I have a select near to the clockPick and when you make a click and the clockpick expands the select is always first in Internet Explorer. I made this change in the ClockPick.js but only fix the div of the hours, not the div of minutes: line 56 of version 1.1 so so $hourcont = jQuery(div id='CP_hourcont' class='CP' /); $hourcont.bgIframe();//this is my line jQuery(body).append($hourcont); binder($hourcont); I hope you can help me and sorry for my bad english. andres.
[jQuery] Re: [OT] WYSIWYG for Safari
Thanks for getting back to me, after researching the issue, it appears all JavaScript WYSIWYG editors for Safari 2.0.4 and lower can not properly detect the Tab event. After some consideration, we've decided to drop support for Safari 2.0.4 and lower. Thanks for the suggestion though. - jake On Nov 14, 2007 7:57 PM, [EMAIL PROTECTED] wrote: The YUI framework has a Rich Text Editor (RTE) that supports Safari, I'm not sure which version tho. On 11/13/07, Jake McGraw [EMAIL PROTECTED] wrote: Hey all, sorry for the off topic post, but I must be going insane. I read that TinyMCE and FCKeditor now support Safari, but when I download the demos for both neither works when trying to use Safari 2.0.4. I'm looking for a VERY limited selection of functionality, specifically, Bold, Italic, Ordered List and Links. Can anyone recommend a JavaScript WYSIWYG that will work in IE7, IE6, Firefox AND Safari 2? - jake -- Joan Piedra || Frontend web developer http://www.justaquit.com/ || http://www.joanpiedra.com/
[jQuery] Adressing the right area
Hi there, I am a beginner in Jquery and need some help to get started. I would like to create a functionality that provides a button underneath each user comment of a picture reply, that would on clicking it show a reply field. Now this does not sound so hard, does it?! It looks hard to me. The problem is, that there could be 100 user comments and I would only want to add a few lines of JQ code. How can I pass the appropiate reply ID, so that on click it does only show the reply box underneath the comment in querstion? Here is how I tried it: $(document).ready(function() { var $loader = 'form method=post name=comment action=act_insert_pic_comment_reply.php style=margin-bottom:0; padding:0; border:0; margin:0 textarea tabindex=2 name=reply id=R1 class=text_L rows=7 cols=36 style=width:468px wrap=virtual/textareabrinput type=Image src=/g/p/2/ BN_ct_sa_en.gif width=80 height=19 '; $('.RB1').click(function(){ $('#C1').html($loader).fadeIn('slow'); return false; }); }); a href=# class=RB1 id=B1bReply/b/a span id=C1/span a href=# class=RB1 id=B2bReply 2/b/a span id=C2/span Thank you for any help on this! Best regards, Merlin
[jQuery] Re: Changes repository
docs.jquery.com jquery.com/blog On Nov 15, 7:16 pm, ad4m [EMAIL PROTECTED] wrote: Hi! I was wondering where i can find changes history between jquery versions. Actually i need to know changes between version 1.0.x and 1.1.1. Know where i can find such informations? -- Serdecznie pozdrawiam, Adam Ludwinski [EMAIL PROTECTED]://www.ludwinski.net
[jQuery] Re: Error in droppable.js
On Nov 14, 2007 11:42 PM, yogi [EMAIL PROTECTED] wrote: Hi guys , I am using the droppables.js on my site and this js file was directly linked to teh jquery. Today I found a bug in teh droppable.js file.For some resons its giving a helperSize.width javascript error on the browser and also has forced teh functionality to not work. You can also this error on teh following page http://docs.jquery.com/UI/Droppables Just try to drag and drop the element. Any idea on why this has come up and what needs to be done to resolve this. Hi, looks like the problem is in 'ui.mouse.js' which is failing with this error: $(this.helper).outerWidth is not a function ... looking for the root of the problem now. Alex funny aside: I gotta say I laughed out loud reading your post, you had 4 'teh's in a row !!! That deserves recognition of some sort! :)
[jQuery] Re: Scriptdoc-file for jQuery 1.2.1
We moved to the wiki for many good reasons. One of them being it provides a very good mechanism for allowing the community to contribute to the betterment of the docs. Another reason is it provides some necessary flexibility for documenting things like selectors. There are current efforts to get the results from the wiki into xml which will enable sites like Visual jQuery to run again! Please be patient while we transition the docs because soon they will be even better than what they were. -- Brandon Aaron On Nov 15, 8:03 pm, Tom Sieroń [EMAIL PROTECTED] wrote: On Nov 15, 2007 3:47 PM, dehneg [EMAIL PROTECTED] wrote: Scriptdoc file is a good **standard** to integrate documentation in any IDE. It is also a good way to work with documentation. I suppose that Yehuda Katz use the jQuery scriptdoc file to generate is Visual jQuery Documentation (http://www.visualjquery.com). The actual version of Visual jQuery is for jQuery 1.1.2. It would be great to have an up to date version of visualjquery! It's much easier and faster than the wiki where you have to wait for all the page reloads just to see a snippet of code :(. It gets even worse when you don't know what exactly you're looking for. So many links, so many page reloads, so many tabs and relatively little content :(. -- Tom Sieroń. Skype: tom.sieron :: GG 590961 :: T +48 505 034 253http://www.linkedin.com/pub/dir/tom/sieron
[jQuery] Transparent PNG backgrounds with superfish
hi I am trying to get transparent png background to run on the drop-dowm menus of superfish. I tried unsuccessfully to the 2 related jquery plugins : pngfix and ifixpng. Both are resulting in the following error : 'filter.match' is nul or not an object Those scripts are AFAIK hiding the css background and replacing it by the same imaged tranformed through microsoft's sprecial chemistery. I am pretty sure that it conflicts with the way jquery is doing animations, but I do not really understand the jquery code so far, to be sure of what is beieng done there. In superfish there is this piece of code : showSuperfishUl : function(){ return this .addClass(o.hoverClass) .find('ul:hidden') .animate(o.animation,o.speed) .end(); } If I replace it by: showSuperfishUl : function(){ return this .addClass(o.hoverClass) .find('ul:hidden') .show() .end(); } It kinda work. There is then no animations of course, and the background positionning is forced to top left. By modifing the code like that : showSuperfishUl : function(){ return this .addClass(o.hoverClass) .find('ul:hidden') .show() .end() .find('ul').ifixpng(); } I got it running once. It will animate one dropdown with transparency, but at the end it produces an error that I have not be able to track down successfully in jquery. Also I found a related ticket: http://dev.jquery.com/ticket/1627 I'm not sure where to go. Is this fixable at all ? Have I to wait for a new jquery release ? Olivier
[jQuery] Re: jquery.ifixpng.js IE 7 Transparency is Black instead of transparent
cfdvlpr wrote: My IE 7 doesn't seem to support PNGs like yours does. How about in the head: !--[if lt IE 7.] script type=text/javascript src=/jquery/plugins/ jquery.ifixpng.js/script ![endif]-- !--[if gte IE 7.] script defer type=text/javascript src=/javascript/pngfix.js/ script ![endif]-- Why are you doing this: !--[if gte IE 7.] script defer type=text/javascript src=/javascript/pngfix.js/script ![endif]-- IE7 natively supports PNG alpha transparency as background images and normal images. No need to do any png fixing in IE7 and any attempt to do so will probably make things worse.
[jQuery] Re: UI Tabs - Close a tab with a separate button
On Nov 15, 4:03 pm, ccieszyn [EMAIL PROTECTED] wrote: Hi, I'm using the following javascript to to run a fade/slide/close- able UI box with UI tabs: pre script type=text/javascript $(function() { $('#navcontainer ul').tabs({ unselect: true, fxSlide: true, fxFade: true, fxSpeed: 'medium' }); }); /script /pre I would like to add another line that I could attach to a separate button in the UI box itself that would close the currently selected tab when clicked. Can anyone show me the way? Thanks! Try: $(function() { var $tabs = $('#navcontainer ul').tabs({ unselect: true, fxSlide: true, fxFade: true, fxSpeed: 'medium' }); $('#your-button').bind('click', function() { $tabs.tabsClick( $tabs.tabsSelected() ); return false; }); }); --Klaus
[jQuery] AJAX form submission in CakePHP with jQuery Form Plugin?
I was wondering if any of you jQuery + CakePHP users could help me out here... I have a blog-like page that contains a post, comments, and a new comment form. I want the new comment form to submit using ajax and have the newly added comment appear in the comments list. Currently, I'm using the jQuery Form Plugin to submit the form: http://www.malsup.com/jquery/form/. So far, the form submission works, but all that is happening is the data being saved. The view does not show any validation error messages defined in the model and does not show the new comment (I have to refresh the page to get the comment to show up and the validation error messages never show up). How can I fix this so the form not only submits using ajax, but the form data is also rendered in the view if saved, or the appropriate validation error messages appear? Thanks.
[jQuery] Re: Browser Exit Event
On Nov 15, 9:35 pm, Bil Corry [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote on 11/15/2007 8:12 AM: I'd just like to know what the jQuery best practice for catching the browser exit event is? Probably just bind your code to the onunload event. From the jQuery docs: $(window).unload( function () { alert(Bye now!); } ); More info here: http://docs.jquery.com/Events/unload - Bil I doubt persisting data via an Ajax call on the unload event will work cross browser if at all... but I'm not sure about this. --Klaus
[jQuery] Re: Need a cookie to cap the frequency of my sliding div
And the solution is... $(document).ready(function() { initSlideboxes(); function initSlideboxes() { if(!document.cookie.match(slidedToday)){ var oneDay = new Date(); oneDay.setDate(oneDay.getDate()+1); document.cookie=slidedToday=true;path=/;expires=+oneDay.toGMTString(); $('#slidebar').slideDown(1000); setTimeout(function() {$('#slidebar').slideUp(10);}, 5000); } $('#slidebartrigger').click(function(){$ ('#slidebar').slideToggle(); }); }; }); On Oct 27, 12:34 am, somnamblst [EMAIL PROTECTED] wrote: Thanks. Are you saying I should remove this line $('#slidebar').html($('#hidebar').html()); So I have the following? $(document).ready(function() { initSlideboxes(); function initSlideboxes() { $('#slidebar').slideDown(normal); setTimeout(function() { $('#slidebar').slideUp(3000); }, 5000); $('#slidebartrigger').click(function(){$ ('#slidebar').slideToggle(); }); Because the 2 events slideDown slideUp happen without user action, I would like to cap frequency so a returning visitor does not have a div they have already seen that day slide down with out being user initiated. But if so desired I would like the user to have the ability to toggle the div as much as they want. $('#slidebar').slideDown(normal); setTimeout(function() { $('#slidebar').slideUp(3000); - Hide quoted text - - Show quoted text - On Oct 26, 7:17 pm, Wizzud [EMAIL PROTECTED] wrote: Where does frequency come into your script? You have a one-off timeout delay, and 2 durations (on the animations) ... no frequency. I think there may possibly be more script (that's still relevant to the question)? Also, you should avoid setting html() on an element while it's being animated. On Oct 26, 9:56 pm, somnamblst [EMAIL PROTECTED] wrote: I just tried the cookie I used with my scriptaculous sliding div it did not cap frequency. I would like my cookie to cap the frequency of $ ('#slidebar').slideDown(normal); but not prevent a user from using $ ('#slidebartrigger').click(function(){$ ('#slidebar').slideToggle(); }); to interact with the same div. Is this possible? My JQuery function $(document).ready(function() { initSlideboxes(); function initSlideboxes() { $('#slidebar').slideDown(normal); setTimeout(function() { $('#slidebar').slideUp(3000); }, 5000); $('#slidebar').html($('#hidebar').html()); $('#slidebartrigger').click(function(){$ ('#slidebar').slideToggle(); }); }; });- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Draggables IE7 problem
I think I had the same problem you're having. IE sometimes doesn't like absolute positioning to the right. Just change it to left and you'll be ok. On Oct 28, 1:15 am, fiasst [EMAIL PROTECTED] wrote: Hi there, I'm using jQuery for a ecommerce site I'm working on. It's usingDraggables and the site can be found http://www.sibenet.com/limebluehere . Myproblem When viewing inIE7the sidebar menu (semi-transparent menu on the far right) jumps to the left of the screen after it's been dragged. If you only drag it a small distance it won't jump completely off the screen. I'm trying to get this menu to stay in it's current position when released like in FireFox. I've played around with the CSS a lot and it seems IE doesn't like 'position: absolute' on this particular element. Can anyone think of a possible work around for this? I thought a mouse-up event, positioning the block where it should be once you release from dragging could work. But, I'm useless as jQuery and it's a miracle I've got this far! Thanks for reading! Marc -- View this message in context:http://www.nabble.com/Draggables-IE7-problem-tf4703185s27240.html#a13... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jquery Tabs plugin
hi, someone has used this plugin here?, I've looked that at Firefox it works great, but at I.explorer 6 it doen't. Someone know to fix it? I've yet posted a bug at jquery bugtrack site.
[jQuery] each help
Hi, I have this in each row (a couple of rows...) input type=text class=num name=qty[] value= onkeyup=javascript:test(); / input type=text class=num name=price[] value= onkeyup=javascript:test(); / input type=text class=num name=row_sum[] value= disabled / i'd like to calculate the data function test(){ $([EMAIL PROTECTED]).each(function(i){ var price = $([EMAIL PROTECTED]'price[]']).val(); var qty = $([EMAIL PROTECTED]'qty[]']).val(); res = price * qty; $([EMAIL PROTECTED]'row_sum[]']).val(res); }); } but the function doesn't function ;) Help anyone? someone?