[jQuery] Select option value not working
$(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help.
[jQuery] Re: Select option value not working
The SELECT's value is what you want: $(input[name='myselect']).val() The only time you need to check is individual OPTIONs are selected is if you have a multi-select list box. Karl Rudd On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer [EMAIL PROTECTED] wrote: $(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help.
[jQuery] How do I create an auto scaling background?
Take a look at http://ringvemedia.com/shanghai Do you see how if you resize the browser window, the background image automatically scales? How would I do this with jquery?
[jQuery] First add new row, ther re-stripe
Hi I have a table, that I re-render after a click, like this. $(document).ready(function() { $('input[name=category]').click(renderTable); }); Then I remove all existing rows, get new ones, and add the to the table, works fine! // remove old rows $('tbody.tbody_class').children().remove(); // add the new rows $('tbody.tbody_class').html(newTable); Now want to re-stripe the table after the new row are added, how do I do that? any clues? all the best / johannes -- View this message in context: http://www.nabble.com/First-add-new-row%2C-ther-re-stripe-tp20911676s27240p20911676.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: driving me mad - ajax
Thanks for the replies everyone. STILL haveing problems though... put my code here... http://pastebin.com/m25b8f3bd the highlighted line returns the correct number of results in FF etc. IE always returns 0. and here is a sample of my xml... http://pastebin.com/m454b2894 Validated it and its AOK! what is it that is stopping IE processing the xml as expected? G (please make IE8 critical release and make people on OS XP remove IE completely
[jQuery] Re: Select option value not working
$('input[value=GO]').click(function(){}); From: jquery-en@googlegroups.com on behalf of JQueryProgrammer Sent: Tue 09/12/2008 10:32 To: jQuery (English) Subject: [jQuery] Re: Select option value not working Great. Thanks. lso is it possible to select an element based on the value it has. I have an button like input type=button value=GO / I want to attach an event to this button. How can I..? On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote: Heh yeah that too. :) Sorry I missed that detail. Karl Rudd On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote: It could be to do with the select isn't an input tag, it's a select tag, try $(select[name='myselect'] option:selected).val(); instead Rik 2008/12/9 Karl Rudd [EMAIL PROTECTED]: The SELECT's value is what you want: $(input[name='myselect']).val() The only time you need to check is individual OPTIONs are selected is if you have a multi-select list box. Karl Rudd On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer [EMAIL PROTECTED] wrote: $(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help. -- Rik Lomas http://rikrikrik.com http://rikrikrik.com/ This e-mail is intended solely for the addressee and is strictly confidential; if you are not the addressee please destroy the message and all copies. Any opinion or information contained in this email or its attachments that does not relate to the business of Kainos is personal to the sender and is not given by or endorsed by Kainos. Kainos is the trading name of Kainos Software Limited, registered in Northern Ireland under company number: NI19370, having its registered offices at: Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland. Registered in the UK for VAT under number: 454598802 and registered in Ireland for VAT under number: 9950340E. This email has been scanned for all known viruses by MessageLabs but is not guaranteed to be virus free; further terms and conditions may be found on our website - www.kainos.com
[jQuery] Re: Select option value not working
or more specificly, i think, $(':button[value=GO]').click(... From: jquery-en@googlegroups.com on behalf of JQueryProgrammer Sent: Tue 09/12/2008 10:32 To: jQuery (English) Subject: [jQuery] Re: Select option value not working Great. Thanks. lso is it possible to select an element based on the value it has. I have an button like input type=button value=GO / I want to attach an event to this button. How can I..? On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote: Heh yeah that too. :) Sorry I missed that detail. Karl Rudd On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote: It could be to do with the select isn't an input tag, it's a select tag, try $(select[name='myselect'] option:selected).val(); instead Rik 2008/12/9 Karl Rudd [EMAIL PROTECTED]: The SELECT's value is what you want: $(input[name='myselect']).val() The only time you need to check is individual OPTIONs are selected is if you have a multi-select list box. Karl Rudd On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer [EMAIL PROTECTED] wrote: $(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help. -- Rik Lomas http://rikrikrik.com http://rikrikrik.com/ This e-mail is intended solely for the addressee and is strictly confidential; if you are not the addressee please destroy the message and all copies. Any opinion or information contained in this email or its attachments that does not relate to the business of Kainos is personal to the sender and is not given by or endorsed by Kainos. Kainos is the trading name of Kainos Software Limited, registered in Northern Ireland under company number: NI19370, having its registered offices at: Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland. Registered in the UK for VAT under number: 454598802 and registered in Ireland for VAT under number: 9950340E. This email has been scanned for all known viruses by MessageLabs but is not guaranteed to be virus free; further terms and conditions may be found on our website - www.kainos.com
[jQuery] Superfish pre-selected
Then I reload the menu page how I set a menu option to default selected(and into nav-bar sub menu item too)?
[jQuery] Superfish
Then I reload the menu page how I set a menu option to default selected(and into nav-bar sub menu item too)?
[jQuery] Ajax request in loop
Hi, I try get some results from ajax using while loop, but it doesn't work in IE7 and Safari. Here's example code: function get_results(foo){ return $.ajax({ type: GET, url: some_url.php/+foo, dataType: json }).responseText; }; ... ... var result = 0; var i = 0; while(result==0 i=49){ result = get_results(i); i++; } ... Although it works fine in Firefox and Opera (in firebug I can see every single request), but in IE and Safari not. Those browsers not responding after run this code. What's wrong and how can I fix it ? Regards ps.sorry for my poor english ;)
[jQuery] XML find element with special attribute
Hey, this is the code that works perfectly to show all XML Elements: $.ajax({ type: GET, url: events.xml, dataType: xml, success: function(xml) { $(xml).find('event').each(function(){ var name = $(this).attr('name'); $('option value='+name+'/option').html(name).appendTo ('#select_event'); }); } }); Now, i only want to show the elements where the event attribute name is like test. Thanks in advance for your help Florian
[jQuery] need help
i've been surfing over net to find a slide show similar to http://www.frontpageslideshow.net/ i checked the jquery site, almost entire one, couldn't find similar. can someone provide any link which is totally based on css and javascript? i've very short time and want this solution. http://www.frontpageslideshow.net/ need php, i want css and js. thanks in advance.
[jQuery] Re: driving me mad - ajax
Hi ToonMariner, This article might help you: http://www.think2loud.com/2008/09/reading-xml-with-jquery/ Rik 2008/12/9 ToonMariner [EMAIL PROTECTED]: Thanks for the replies everyone. STILL haveing problems though... put my code here... http://pastebin.com/m25b8f3bd the highlighted line returns the correct number of results in FF etc. IE always returns 0. and here is a sample of my xml... http://pastebin.com/m454b2894 Validated it and its AOK! what is it that is stopping IE processing the xml as expected? G (please make IE8 critical release and make people on OS XP remove IE completely -- Rik Lomas http://rikrikrik.com
[jQuery] Image.css(display) not working
image id=myimage myimgid=myimageid src=baloon.jpg / I want to check the style display for this image. I am doing as: $(image[myimgid='myimageid']).css(display); but its coming undefined. I cannot check it with id as my id is getting runtime generated. Please help.
[jQuery] Re: Newbie: Please Help- Ajax Trouble
Hey, There's more details about it here: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F http://www.learningjquery.com/2008/05/working-with-events-part-2 Rik 2008/12/9 Harshal [EMAIL PROTECTED]: Hi, I have used the '.load' function to load a HTML page into a division through AJAX. But i noticed that if I insert any other jquery scripts/plugins in the page that is loaded through AJAX, then they are not executed. As an example i loaded a page using Ajax into a div, from a link in that page i wanted to open a lightbox, but instead the content would just open as a usual html page rather than open in a lightbox. Is it possible to include more javascripts in a page loaded thropugh AJAX? Please help me out, as the problem mite seem trivial, but I can't seem to find a solution. -- Rik Lomas http://rikrikrik.com
[jQuery] Re: need help
Advice: meaningful subject lines = better/quicker help On Dec 9, 6:38 am, Hassan Ali [EMAIL PROTECTED] wrote: i've been surfing over net to find a slide show similar tohttp://www.frontpageslideshow.net/ i checked the jquery site, almost entire one, couldn't find similar. can someone provide any link which is totally based on css and javascript? i've very short time and want this solution.http://www.frontpageslideshow.net/ need php, i want css and js. thanks in advance.
[jQuery] Re: First add new row, ther re-stripe
// add the new rows $('tbody.tbody_class').html(newTable).find(tr:odd).css(background- color, #eee); or whatever other code you use to restripe and to note: there's no need to do the remove() if you are using html(newTable) as that second line will effectively wipe out all existing HTML before putting the results of newTable in there On Dec 9, 4:54 am, johannesf [EMAIL PROTECTED] wrote: Hi I have a table, that I re-render after a click, like this. $(document).ready(function() { $('input[name=category]').click(renderTable); }); Then I remove all existing rows, get new ones, and add the to the table, works fine! // remove old rows $('tbody.tbody_class').children().remove(); // add the new rows $('tbody.tbody_class').html(newTable); Now want to re-stripe the table after the new row are added, how do I do that? any clues? all the best / johannes -- View this message in context:http://www.nabble.com/First-add-new-row%2C-ther-re-stripe-tp20911676s... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Zooming and clicking
Ok, but how would I be able to zoom this background-image and all the overlay a elements? Can this be done with JQuery? On Dec 8, 3:57 pm, ricardobeat [EMAIL PROTECTED] wrote: area elements have no display properties, so you can't do any styling. An alternative is to use transparent a elements instead, if your areas are all squares/rectangles. - ricardo On Dec 8, 9:27 am, Paul [EMAIL PROTECTED] wrote: Hi there, I'm brainstorming about something and was hoping you guys (and girls) could help me... Picture this: - When a visitor moves his/her mouse over a thumb image (say a map), the magnified part of that image appears in another DIV. I can do this with jQZoom.. - Then when the visitor is satisfied with the magnified map he sees, he clicks and the map freezes. Now he/she moves the mousepointer to the magnified map, which is devided into several smaller blocks (grid). By moving over these blocks, they highlight (for instance - border color) and can be clicked to go to the page of that particular block. My problem: I could use the HTML area tag to make the blocks, but can't apply a css :hover class to them. Is there an easier way to get to where I want? Please help.
[jQuery] Re: [TUTORIAL] Create an amazing music player using mouse gestures hotkeys in jQuery
Thanks for reply Isaak ;) On Dec 5, 5:24 pm, Isaak Malik [EMAIL PROTECTED] wrote: you'll notice* On Fri, Dec 5, 2008 at 5:24 PM, Isaak Malik [EMAIL PROTECTED] wrote: If you read the entire tutorial you'll noticed that he mentions it's just an interface and he has plans to integrate it with plusmusicahttp://www.plusmusica.com/(request for an invitation) On Fri, Dec 5, 2008 at 5:11 PM, Jean [EMAIL PROTECTED] wrote: 4 me too On Fri, Dec 5, 2008 at 7:29 AM, Mika Tuupola [EMAIL PROTECTED] wrote: On Dec 4, 2008, at 7:28 PM, AdrianMG wrote: You can see the tutorial over here: http://yensdesign.com/2008/12/create-an-amazing-music-player-using-mo... Should there be music too? It is silent for me FF3 Safari in OSX? -- Mika Tuupola http://www.appelsiini.net/ -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com -- Isaak Malik Web Developer -- Isaak Malik Web Developer
[jQuery] Re: Zooming and clicking
Ok, but how would I be able to zoom this background-image and all the overlay a elements? Can this be done with JQuery? On Dec 8, 3:57 pm, ricardobeat [EMAIL PROTECTED] wrote: area elements have no display properties, so you can't do any styling. An alternative is to use transparent a elements instead, if your areas are all squares/rectangles. - ricardo On Dec 8, 9:27 am, Paul [EMAIL PROTECTED] wrote: Hi there, I'm brainstorming about something and was hoping you guys (and girls) could help me... Picture this: - When a visitor moves his/her mouse over a thumb image (say a map), the magnified part of that image appears in another DIV. I can do this with jQZoom.. - Then when the visitor is satisfied with the magnified map he sees, he clicks and the map freezes. Now he/she moves the mousepointer to the magnified map, which is devided into several smaller blocks (grid). By moving over these blocks, they highlight (for instance - border color) and can be clicked to go to the page of that particular block. My problem: I could use the HTML area tag to make the blocks, but can't apply a css :hover class to them. Is there an easier way to get to where I want? Please help.
[jQuery] Re: Treeview
not sure this will help or not, but generally speaking one can improve browser performance on repeating backgrounds by making the repeating image at least 16 or 32px wide. the image will compress nearly as well, and the browser will only have to render the cloning operation a dozen times rather than hundreds. just a thought! n On Dec 2, 11:43 am, Nick Voss [EMAIL PROTECTED] wrote: I've been having some problems implementing a simpletreeview. In firefox or chrome the animation renders very quickly, but in IE 7 any expansion or contraction is slow and choppy at best. I've found that the culprit seems to be that the page's background is a 1px wide gradient (gif) that is repeated horizontally. If I take out the background then it renders perfectly in IE. Any help making IE behave better would be much appreciated. Thanks, Nick
[jQuery] Beginner question about toogeling a status
Hi, this is my first post, I hope I do everything right! I have a list of users and for each user I have a little img showing the actual status which is eather - active - in-active - active but no login On click on this little img icon, I want to call a ajax php script which toogles the status. Therefore I need to parse 2 variables to my script, the user's ID and the current status ID. At the moment my link looks like this: img src=/img/online.gif alt= id={$hersteller_daten[her].her_id} name={$hersteller_daten[her].status} width=15 height=15 border=0 class=statusimg style=cursor: pointer; My Jquery is this at the moment: $(document).ready(function(){ $('img.statusimg').click(function() { var her_id = this.id; var status = this.name; $.ajax({ type: POST, url: /admin/ajax_toogle_manufacturer_status.php, data: her_id= +her_id+ status= + status, success: function(msg){ alert( Rückgabewert: + msg ); $('.statusimg').attr(src, /img/offline.gif); } }); }) }); For the moment I toogle only active into inactive. Because I do not know how to send 2 information (user's ID and the current status ID) to my jquery function. Can you help me with this please? Thanks! Heidi
[jQuery] Equal Columns After DOM
I'm trying to use jquery to keep my columns equal in height. The problem is that when I expand something in my menu in one of those columns, the height doesn't re-adjust. I'm thinking it's because it's only called when document.ready... I don't know the event very well, but is there a way I could call this so when the height adjusts? code: function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight tallest) { tallest = thisHeight; } }); group.height(tallest); } $(document).ready(function() { equalHeight($(.column)); });
[jQuery] Re: Image.css(display) not working
I don't think you're not really understanding the selector syntax. The 'id' is unique (or is supposed to be) and starts with a '#', and the css syntax uses a name and value pair to set the attribute. So: $(#myimage).css('display, inline); // or block or try this alternative: $(#myimage).show(); or possibly: $(#myimage).toggle() The last one displays when hidden and hides if already visible. I assume that 'myimg' is not something you really intended to use for the selector. On Dec 9, 7:16 am, JQueryProgrammer [EMAIL PROTECTED] wrote: image id=myimage myimgid=myimageid src=baloon.jpg / I want to check the style display for this image. I am doing as: $(image[myimgid='myimageid']).css(display); but its coming undefined. I cannot check it with id as my id is getting runtime generated. Please help.
[jQuery] Re: Image.css(display) not working
I don't think you're really understanding the selector syntax. The 'id' is unique (or is supposed to be) and starts with a '#' in a selector, and the css syntax uses a name and value pair to set the attribute. So: $(#myimage).css('display, inline); // or block or try this alternative: $(#myimage).show(); or possibly: $(#myimage).toggle() The last one displays when hidden and hides if already visible. I assume that 'myimg' is not something you really intended to use for the selector. On Dec 9, 7:16 am, JQueryProgrammer [EMAIL PROTECTED] wrote: image id=myimage myimgid=myimageid src=baloon.jpg / I want to check the style display for this image. I am doing as: $(image[myimgid='myimageid']).css(display); but its coming undefined. I cannot check it with id as my id is getting runtime generated. Please help.
[jQuery] Re: Select option value not working
Great. Thanks. lso is it possible to select an element based on the value it has. I have an button like input type=button value=GO / I want to attach an event to this button. How can I..? On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote: Heh yeah that too. :) Sorry I missed that detail. Karl Rudd On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote: It could be to do with the select isn't an input tag, it's a select tag, try $(select[name='myselect'] option:selected).val(); instead Rik 2008/12/9 Karl Rudd [EMAIL PROTECTED]: The SELECT's value is what you want: $(input[name='myselect']).val() The only time you need to check is individual OPTIONs are selected is if you have a multi-select list box. Karl Rudd On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer [EMAIL PROTECTED] wrote: $(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help. -- Rik Lomas http://rikrikrik.com
[jQuery] Re: Nested value for callback
It worked fine for me in Firefox. In order to make it work in IE self = this; should be var self = this; Module = function() { should be var Module = function() { $dialog = $(#my_dialog); should be var $dialog = $(#my_dialog); - Richard On Tue, Dec 9, 2008 at 12:37 AM, Göran Törnquist [EMAIL PROTECTED] wrote: Hi, I'm in over my head with this one, and I can't seem to find the solution to make it work. I've taken some time to break out the code for the problem, and below is the code that manifests my dilemma. This code presents a simple table with rows that are tagged with row id's. When the user clicks on a link inside a row I present a confirmation dialog and then if the user clicks Yes, then I'll execute the provided callback. What is going wrong is that the last alert (from the callback) only works correctly once - namely the first time. Whatever value the alert presents the first time, is also what will be presented the following times until reload of script. I would be most grateful for some help. /Göran ?xml version=1.0 encoding=utf-8? !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; xml:lang=sv lang=sv head meta http-equiv=content-type content=text/html; charset=utf-8 / link rel=Stylesheet href=jquery/themes/default/ui.all.css type=text/css media=all hreflang=css/all charset=utf-8 / script src=jquery/jquery-1.2.6.js language=Javascript charset=utf-8/script script src=jquery/ui/jquery.ui.all.js language=Javascript charset=utf-8/script /head body table class=sometable tr id=rec_1tda href=#First record/a/td/tr tr id=rec_2tda href=#Second record/a/td/tr tr id=rec_3tda href=#Third record/a/td/tr tr id=rec_4tda href=#Fourth record/a/td/tr tr id=rec_5tda href=#Fifth record/a/td/tr tr id=rec_6tda href=#Sixth record/a/td/tr tr id=rec_7tda href=#Seventh record/a/td/tr /table script type=text/javascript Module = function() { self = this; return { //Present a dialog with Yes and No buttons. Execute provided callback for respective button. confirm: function(msg, yesCB, noCB, options) { $dialog = $(#my_dialog); if($dialog.length == 0) { $(body).append('div id=my_dialogp/p/div'); $dialog = $(#my_dialog); } var buttons = {}; buttons[Yes] = function(){ $dialog.dialog(close); if($.isFunction(yesCB)) yesCB(); }; buttons[No] = function(){ $dialog.dialog(close); if($.isFunction(noCB)) noCB(); }; var myOptions = { buttons: buttons, modal: true, overlay: { opacity: 0.7, background-color: #000 } }; $.extend(myOptions, options); $dialog.find(p).html(msg); $dialog.dialog(myOptions).dialog(open); } } }(); $(function() { $(.sometable a).click(function() { var $parentTR = $(this).parents('tr').eq(0); //select the first occurrence of a tr that is a parent of this var id = $parentTR.attr('id').replace(/rec_(.*)/i,$1); //grab the integer part of the id alert(Click: + $parentTR.attr(id)); Module.confirm(id,//call the piggybacked script function() { alert(You said yes to record + id);// = HERE is the problem } ); }) }); /script /body /html -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
[jQuery] Re: jQuery.uploader released: Flash based jQuery uploader
Nice script.. I used the swfupload before, but i switched immediately :) I've got 1 question: Can u set a FOLDER to store the files? U can set the backend file, who upload your files.. But I want to specify a folder, before upload starts, where the files can be stored. I need to send that variabele into my upload file. Tnx in advance, Michel On Nov 28, 4:17 pm, Gilles (Webunity) [EMAIL PROTECTED] wrote: Hi guys, Short memo;http://jQuery.webunity.nl/ Check it out, 2 demo's online! -- Gilles
[jQuery] Re: jQuery with prototype - RTFM but still problem
The source of the problem is that they both use $ as a shortcut. But there are several ways to make the work together, I used prototype +jquery+scriptaculous together in several projects One of the most surefire ways to do this, but probably not the most elegant is the following: 1. Include prototype/scriptaculous before jQuery 2. In the very beginning of your onload.js(or equivalent) file add jQuery.noConflict(); Make sure onload.js is included before any JS file that uses the previously includes prototype/other libraries. 3. do a Search/Replace in your onload.js for $ and replace with jQuery. DO NOT do a Replace All, quickly check each find manually and go through them, as $ could be used for other things in code besides the $ shortcut functionality. Be especially careful if you have both jquery/prototype code in the same JS file, because you have to replace '$' only for Jquery function calls On Dec 8, 10:03 pm, Balazs Endresz [EMAIL PROTECTED] wrote: Older versions of scriptaculous conflict with jQuery, try using 1.8+ http://groups.google.com/group/jquery-en/browse_thread/thread/1c06102... On Dec 8, 5:18 pm, dpoakaspine [EMAIL PROTECTED] wrote: Hello, I read every clue to implement the 2 above libraries. Unfortunately it is still not working. I tried first including prototype then jquery. First jquery then prototype. noConflict() etc. ... Could y'all take a look athttp://www.cjd-rz.deandtell me what's wrong? I can't see an error! Help would be appreciated, Stefan
[jQuery] Re: JQuery events + ajax question
Cleaning that up is not Jquery's job as far as I know but the JScript garbage collector (which basically depends on the browser). The garbage collector is pretty smart so it shouldn't be any leak... serious leaks used to happen only on Circular References especially in IE6 for example, but even that has been mostly fixed with patches. Also I hope you are aware that if you do Step 2 then the click event defined in Step 1 won't work on the elements in #container div anymore. You'd have to add Step 1 again after Step 2. On Dec 8, 9:13 pm, gotnoboss [EMAIL PROTECTED] wrote: Hi, I've got a question I was hoping someone could shed some light on for me. Suppose you have a div like so: div id=container input type=checkbox name=check value=1 One br/ input type=checkbox name=check value=2 Two br/ input type=checkbox name=check value=3 Three br/ /div 1) Suppose you have bound a 'click' event to every checkbox in the above: $(#container input).click(function() {alert('hi');}); 2) Then, you carte blance replace all the html in the div as the result of an ajax request: $(#container).html(htmlReturnedFromServer); What happens to the events registered in step 1? Are they leaked? Does JQuery know to unbind them before replacing the HTML? Does it even have to do that to avoid a memory leak? Do I need to unbind them myself before replacing the HTML? Thanks for the insight, Erik
[jQuery] Re: jQuery with prototype - RTFM but still problem
Actually your prototype include path gives 404 error. http://www.cjd-rz.de/wp-content/plugins/wp-cal/js/prototype.js The following are also inexsitent/wrong paths: http://www.cjd-rz.de/wp-content/plugins/wp-cal/js/scriptaculous.js http://www.cjd-rz.de/wp-content/plugins/wp-cal/js/cal.js http://www.cjd-rz.de/1http://www.cjd-rz.de/wp-content/themes/cjd/style.css Use Firefox 3 with Firebug to identify problems like this in 1 minute. On Dec 9, 3:37 pm, Beres Botond [EMAIL PROTECTED] wrote: The source of the problem is that they both use $ as a shortcut. But there are several ways to make the work together, I used prototype +jquery+scriptaculous together in several projects One of the most surefire ways to do this, but probably not the most elegant is the following: 1. Include prototype/scriptaculous before jQuery 2. In the very beginning of your onload.js(or equivalent) file add jQuery.noConflict(); Make sure onload.js is included before any JS file that uses the previously includes prototype/other libraries. 3. do a Search/Replace in your onload.js for $ and replace with jQuery. DO NOT do a Replace All, quickly check each find manually and go through them, as $ could be used for other things in code besides the $ shortcut functionality. Be especially careful if you have both jquery/prototype code in the same JS file, because you have to replace '$' only for Jquery function calls On Dec 8, 10:03 pm, Balazs Endresz [EMAIL PROTECTED] wrote: Older versions of scriptaculous conflict with jQuery, try using 1.8+ http://groups.google.com/group/jquery-en/browse_thread/thread/1c06102... On Dec 8, 5:18 pm, dpoakaspine [EMAIL PROTECTED] wrote: Hello, I read every clue to implement the 2 above libraries. Unfortunately it is still not working. I tried first including prototype then jquery. First jquery then prototype. noConflict() etc. ... Could y'all take a look athttp://www.cjd-rz.deandtellme what's wrong? I can't see an error! Help would be appreciated, Stefan
[jQuery] Re: fadeIn something from JSON
Well if you want to fade in something it has to be hidden first. If the example with hide() doesn't work, just hide it straight from html. $.getJSON(urlForDescription, function(data) { $div = $(div class='info' style='display:none;' + data + /div); $element.after($div).fadeIn(); }); On Dec 9, 12:06 am, Jan Limpens [EMAIL PROTECTED] wrote: On Mon, Dec 8, 2008 at 7:20 PM, MorningZ [EMAIL PROTECTED] wrote: you'll have to do the fadeIn inside the callback of getJSON var showDescription = function() { $element = $(a.info, this); if ($element.next(div.info).length == 0) { var urlForDescription = $element.attr('href') + '/descricao'; $.getJSON(urlForDescription, function(data) { $div = $(div class='info' + data + /div); $element.after($div).fadeIn(); }); } else { $element.next(div.info).fadeIn(); } } also, just pops up. :( -- Jan
[jQuery] Re: Selector filters using less-than/greater-than operators?
Cool, thanks. On Dec 9, 8:13 pm, ricardobeat [EMAIL PROTECTED] wrote: The simplest alternative is to write a filter function: $(element).filter(function(){ return $(this).attr('attribute') = x; }); - ricardo On Dec 8, 11:56 pm,mgl[EMAIL PROTECTED] wrote: Hello everyone, I'm wondering if there is a way to select element with an attribute filter that uses greater-than, or less-than operators. Something like this: $(element[attribute=value]); I don't see anything equivalent in the documentation...if this doesn't exist, are there any simple alternatives (other than looping through elements and checking the values)? Thanks for any suggestions.
[jQuery] Re: Select option value not working
Ok. I got the answer. its like $(input[value='GO']) BUt now my problem is that while rendering the button is rendered as: input type=button value=GO onclick=myFunc(); / no I want to attach my event and cancel the default event, ie. I do not want to call the myFunc. But instead my own function that I have attached as: $(input[value='GO']).click(function(event) { event.preventDefault(); alert(Default Event Cancelled); }); But still its not canceling the default event. On Dec 9, 3:32 pm, JQueryProgrammer [EMAIL PROTECTED] wrote: Great. Thanks. lso is it possible to select an element based on the value it has. I have an button like input type=button value=GO / I want to attach an event to this button. How can I..? On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote: Heh yeah that too. :) Sorry I missed that detail. Karl Rudd On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote: It could be to do with the select isn't an input tag, it's a select tag, try $(select[name='myselect'] option:selected).val(); instead Rik 2008/12/9 Karl Rudd [EMAIL PROTECTED]: The SELECT's value is what you want: $(input[name='myselect']).val() The only time you need to check is individual OPTIONs are selected is if you have a multi-select list box. Karl Rudd On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer [EMAIL PROTECTED] wrote: $(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help. -- Rik Lomas http://rikrikrik.com --~--~-~--~~~---~--~~ 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] Re: How do I create an auto scaling background?
This is done just using css. Take a look at http://ringvemedia.com/g/a.css line 13: #bg img{min-height:50%;min-width:50%;margin:0 auto} - Richard On Tue, Dec 9, 2008 at 4:27 AM, BigFisch [EMAIL PROTECTED] wrote: Take a look at http://ringvemedia.com/shanghai Do you see how if you resize the browser window, the background image automatically scales? How would I do this with jquery?
[jQuery] Re: how to image cache using jQuery?
Naaah, I've check this one... it still load all the image in view port... what I want to achieve is that some sort of var imgtemp = new Image(); which will cache image however this only works for img tags not background... I cant find API nor plugins for this solution. does anyone have any idea or a workaround? Best Regards Darwin Liem --- On Tue, 12/9/08, Karl Swedberg [EMAIL PROTECTED] wrote: From: Karl Swedberg [EMAIL PROTECTED] Subject: [jQuery] Re: how to image cache using jQuery? To: jquery-en@googlegroups.com Date: Tuesday, December 9, 2008, 8:37 AM the Lazy Load plugin might help: http://www.appelsiini.net/projects/lazyload --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Dec 9, 2008, at 12:12 AM, darwin liem wrote: Hi, Sorry for my unclear question... What I'm try to resolve here to load the page first in term of layout without loading all the images, then after all layout and modules loaded, the jQuery can start fill all backgrounds and images with preassigned image (the image should be finished loaded before set on the container -- tags or object to contain image - in term of background or img tags). this will faster the page load and people can read the content earlier before the image is shown and can see the images assigned to the page later. Best Regards Darwin Liem --- On Mon, 12/8/08, Richard D. Worth [EMAIL PROTECTED] wrote: From: Richard D. Worth [EMAIL PROTECTED] Subject: [jQuery] Re: how to image cache using jQuery? To: jquery-en@googlegroups.com Date: Monday, December 8, 2008, 6:33 AM What do you mean by do image caching from jQuery? It would help if you could provide a little more detail about what you're doing or a problem you're trying to solve. - Richard On Sun, Dec 7, 2008 at 11:52 PM, darwin liem [EMAIL PROTECTED] wrote: hi, I'm new in jQuery... can someone help me to understand how to do Image caching from jQuery. thanks...
[jQuery] Newbie: Please Help- Ajax Trouble
Hi, I have used the '.load' function to load a HTML page into a division through AJAX. But i noticed that if I insert any other jquery scripts/plugins in the page that is loaded through AJAX, then they are not executed. As an example i loaded a page using Ajax into a div, from a link in that page i wanted to open a lightbox, but instead the content would just open as a usual html page rather than open in a lightbox. Is it possible to include more javascripts in a page loaded thropugh AJAX? Please help me out, as the problem mite seem trivial, but I can't seem to find a solution.
[jQuery] Re: how to image cache using jQuery?
the Lazy Load plugin might help: http://www.appelsiini.net/projects/lazyload --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Dec 9, 2008, at 12:12 AM, darwin liem wrote: Hi, Sorry for my unclear question... What I'm try to resolve here to load the page first in term of layout without loading all the images, then after all layout and modules loaded, the jQuery can start fill all backgrounds and images with preassigned image (the image should be finished loaded before set on the container -- tags or object to contain image - in term of background or img tags). this will faster the page load and people can read the content earlier before the image is shown and can see the images assigned to the page later. Best Regards Darwin Liem --- On Mon, 12/8/08, Richard D. Worth [EMAIL PROTECTED] wrote: From: Richard D. Worth [EMAIL PROTECTED] Subject: [jQuery] Re: how to image cache using jQuery? To: jquery-en@googlegroups.com Date: Monday, December 8, 2008, 6:33 AM What do you mean by do image caching from jQuery? It would help if you could provide a little more detail about what you're doing or a problem you're trying to solve. - Richard On Sun, Dec 7, 2008 at 11:52 PM, darwin liem [EMAIL PROTECTED] wrote: hi, I'm new in jQuery... can someone help me to understand how to do Image caching from jQuery. thanks...
[jQuery] DOMWindow resizable.
Hallo all. I use DOMWindow (http://swip.codylindley.com/DOMWindowDemo.html) to display some content loaded via ajax call. I have a problem with DOMWindow similare to this http://codylindley.com/thickboxforum/comments.php?DiscussionID=1301page=1#Item_1 Any idea? The content is not an image, is an html page. Kind regards Massimo
[jQuery] Re: need help
Try jQuery Cycle Plugin. It is incredibly flexible. Even if you don't see an exact match from one of its many, many examples, I'm sure it can be used to create a slideshow like the one you linked to. http://malsup.com/jquery/cycle/ --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Dec 9, 2008, at 6:38 AM, Hassan Ali wrote: i've been surfing over net to find a slide show similar to http://www.frontpageslideshow.net/ i checked the jquery site, almost entire one, couldn't find similar. can someone provide any link which is totally based on css and javascript? i've very short time and want this solution. http://www.frontpageslideshow.net/ need php, i want css and js. thanks in advance.
[jQuery] Re: Select option value not working
Heh yeah that too. :) Sorry I missed that detail. Karl Rudd On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote: It could be to do with the select isn't an input tag, it's a select tag, try $(select[name='myselect'] option:selected).val(); instead Rik 2008/12/9 Karl Rudd [EMAIL PROTECTED]: The SELECT's value is what you want: $(input[name='myselect']).val() The only time you need to check is individual OPTIONs are selected is if you have a multi-select list box. Karl Rudd On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer [EMAIL PROTECTED] wrote: $(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help. -- Rik Lomas http://rikrikrik.com
[jQuery] Jquery Tabs 2 CSS styles?
Hi, I am using JQuery tabs and I have a problem as I want to sets of tabs on the same page, I need to specify 2 different css styles for the tabs specifically the container width. I read a reply by your to a similar issue in google groups but didnt understand it as im quite new to css and JQuery. Here is my CSS and script for the 1st set which is working .tabs-container { margin-top:0px; margin-left:2px; /* declare background color for container to avoid distorted fonts in IE while fading */ background-color:transparent; width:636px; } script type=text/javascript $(function() { $('#container-1').tabs(); }); /script div id=container-1 ul style=margin-top:167px; lia href=#fragment-1span style=width:55px;/ span/a/li lia href=#fragment-2span style=width:60px;/ span/a/li /ul div id=fragment-1 Test div /div Here is my CSS and script for the ndt set which is working .tabs-container2 { margin-top:0px; margin-left:2px; /* declare background color for container to avoid distorted fonts in IE while fading */ background-color:transparent; width:100px; } script type=text/javascript $(function() { $('#container2').tabs(); }); /script div id=container2 ul style=margin-top:50px; lia href=#fragment-1span style=width:15px;/ span/a/li lia href=#fragment-2span style=width:15px;/ span/a/li /ul div id=fragment-1 Test 2 div /div The 2nd tabs take the css defined for the 1st tabs with the contaier width set to 646 instead of the desired 150px f you could point out my error or give me an example of how to achieve this i would be very grateful. Thanking You Mike Walshe
[jQuery] Re: Select option value not working
It could be to do with the select isn't an input tag, it's a select tag, try $(select[name='myselect'] option:selected).val(); instead Rik 2008/12/9 Karl Rudd [EMAIL PROTECTED]: The SELECT's value is what you want: $(input[name='myselect']).val() The only time you need to check is individual OPTIONs are selected is if you have a multi-select list box. Karl Rudd On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer [EMAIL PROTECTED] wrote: $(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help. -- Rik Lomas http://rikrikrik.com
[jQuery] Re: driving me mad - ajax
This is not a solution, as I haven't encountered this issue yet, just possible pointers to find the source of the problem. http://pastebin.com/m7a986ddf On Dec 9, 1:48 pm, Rik Lomas [EMAIL PROTECTED] wrote: Hi ToonMariner, This article might help you:http://www.think2loud.com/2008/09/reading-xml-with-jquery/ Rik 2008/12/9 ToonMariner [EMAIL PROTECTED]: Thanks for the replies everyone. STILL haveing problems though... put my code here... http://pastebin.com/m25b8f3bd the highlighted line returns the correct number of results in FF etc. IE always returns 0. and here is a sample of my xml... http://pastebin.com/m454b2894 Validated it and its AOK! what is it that is stopping IE processing the xml as expected? G (please make IE8 critical release and make people on OS XP remove IE completely -- Rik Lomashttp://rikrikrik.com
[jQuery] Re: Making a UL simulate an option box?
Dave... First of all, thank you for checking out my code. Second, you just answered a question that I've had since I started using jQuery, namely why does the animation queue up endlessly, or keep going after my mouse moves out. I assume that all you have to do is to add in the .stop() method to accomplish that? andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dave Methvin Sent: Monday, December 08, 2008 7:00 PM To: jQuery (English) Subject: [jQuery] Re: Making a UL simulate an option box? I noticed that the page didn't work right with IE and also didn't stop the animation if you did mouseover/out quickly. This version works a bit better: var $cont = $('#scrollMe'); var parentHeight = $cont.height(); var childHeight = $cont.find('li:first').height(); $cont.height(childHeight); $cont.hover(function(){ $cont.stop().animate({ height: parentHeight },'slow'); },function(){ $cont.stop().animate({ height: childHeight },'slow'); });
[jQuery] Re: Object Oriented Form Handling
Thanks everyone. I found a solution for my situation. On Dec 6, 9:16 am, Dan Switzer [EMAIL PROTECTED] wrote: Will, Does anyone know of a way to use class like objects in event handling using jQuery? For Example, input type='button' value='Button' onclick='Record.show()' / where .show() is a method of the Record object. This would be really cool to be able to reuse the method name .show() but with different objects verses just coding a huge list of functions that are hard to organize and end up with long names. You can always build objects around jQuery elements. Depending on your needs, you might be able to get by with just caching your jQuery objects: Record = $(#some_div); Now, Record:show() would show the record. I generally find building full OO-based objects out of everything a bit overkill, since the majority of operations your doing is just to change the state of a DOM element (or elements.) -Dan
[jQuery] Re: Functions and variables
Thanks. I ready an article somewhere and it mentioned not combining old coding forms with new in reference to jQuery. It didn't make much sense to me and this confirms it. I'll continue to code with functions and such and just supplement with jQuery where beneficial. Thanks On Dec 4, 6:36 pm, Michael Geary [EMAIL PROTECTED] wrote: jQuery isn't a separate language with its own rules. It's still JavaScript code, just like any other JavaScript code. Functions, variables, reusable code, those are all good practice, and none of it changes because you're using jQuery. Could you give a specific example of some jQuery code that doesn't look good, and then we can talk about how to clean it up? -Mike From: Will I'm sure this is dealt with somewhere in the jQuery tutorials but I have not been able to find it. I'm new to jQuery and used to working with functions and variables so that I can create reusable code and not have to hard code every event that could happen. This is pretty much basic programming. For Example, function action(id) { //do something. } Short of using this method of traditionally programming is there a better way of doing this in jQuery?
[jQuery] Re: Jquery Tabs 2 CSS styles?
Well, it can't work because nowhere in your HTML is a class named tabs-container2. The plugin itself (older versions) adds the class tabs-container to the tab panels - that's why you're not seeing it in the initial HTML and why that width is applied to both tab sets. You can see that class though if you use Firebug to inspect the (altered) HTML source. Try using the already existing ids to apply styles by context: #container-1 .tabs-container { width: 636px; } #container2 .tabs-container { width: 100px; } Or, even less, just apply the width to the outer containers and simply let the content inside expand: #container-1 { width: 636px; } #container2 { width: 100px; } The special fix for IE doesn't work with background-color: transparent, thus you can as well remove it. I also recommend to remove inline styles... --Klaus On 9 Dez., 14:18, toopix [EMAIL PROTECTED] wrote: Hi, I am using JQuery tabs and I have a problem as I want to sets of tabs on the same page, I need to specify 2 different css styles for the tabs specifically the container width. I read a reply by your to a similar issue in google groups but didnt understand it as im quite new to css and JQuery. Here is my CSS and script for the 1st set which is working .tabs-container { margin-top:0px; margin-left:2px; /* declare background color for container to avoid distorted fonts in IE while fading */ background-color:transparent; width:636px;} script type=text/javascript $(function() { $('#container-1').tabs(); }); /script div id=container-1 ul style=margin-top:167px; lia href=#fragment-1span style=width:55px;/ span/a/li lia href=#fragment-2span style=width:60px;/ span/a/li /ul div id=fragment-1 Test div /div Here is my CSS and script for the ndt set which is working .tabs-container2 { margin-top:0px; margin-left:2px; /* declare background color for container to avoid distorted fonts in IE while fading */ background-color:transparent; width:100px;} script type=text/javascript $(function() { $('#container2').tabs(); }); /script div id=container2 ul style=margin-top:50px; lia href=#fragment-1span style=width:15px;/ span/a/li lia href=#fragment-2span style=width:15px;/ span/a/li /ul div id=fragment-1 Test 2 div /div The 2nd tabs take the css defined for the 1st tabs with the contaier width set to 646 instead of the desired 150px f you could point out my error or give me an example of how to achieve this i would be very grateful. Thanking You Mike Walshe
[jQuery] Re: Selector filters using less-than/greater-than operators?
You don't have to wrap all and everything in a jQuery object and so can make the parser a tiny little faster. For certain attributes though you may have to use the attr method as it normalizes browser inconsistencies. $('element').filter(function() { return this.attribute = x; }); --Klaus On 9 Dez., 08:13, ricardobeat [EMAIL PROTECTED] wrote: The simplest alternative is to write a filter function: $(element).filter(function(){ return $(this).attr('attribute') = x; }); - ricardo On Dec 8, 11:56 pm, mgl [EMAIL PROTECTED] wrote: Hello everyone, I'm wondering if there is a way to select element with an attribute filter that uses greater-than, or less-than operators. Something like this: $(element[attribute=value]); I don't see anything equivalent in the documentation...if this doesn't exist, are there any simple alternatives (other than looping through elements and checking the values)? Thanks for any suggestions.
[jQuery] Re: Nested value for callback
Thanks Richard. I obviously made some errors in the process of breaking out the offending piece of code. However, the error remains for me. I'm using Firefox 3 on Mac OS X 10.4. I put up a sample page here: http://www.cortland.se/callback-frenzy/ /Göran Richard D. Worth wrote: It worked fine for me in Firefox. In order to make it work in IE self = this; should be var self = this; Module = function() { should be var Module = function() { $dialog = $(#my_dialog); should be var $dialog = $(#my_dialog); - Richard On Tue, Dec 9, 2008 at 12:37 AM, Göran Törnquist [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, I'm in over my head with this one, and I can't seem to find the solution to make it work. I've taken some time to break out the code for the problem, and below is the code that manifests my dilemma. This code presents a simple table with rows that are tagged with row id's. When the user clicks on a link inside a row I present a confirmation dialog and then if the user clicks Yes, then I'll execute the provided callback. What is going wrong is that the last alert (from the callback) only works correctly once - namely the first time. Whatever value the alert presents the first time, is also what will be presented the following times until reload of script. I would be most grateful for some help. /Göran ?xml version=1.0 encoding=utf-8? !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; xml:lang=sv lang=sv head meta http-equiv=content-type content=text/html; / link rel=Stylesheet href=jquery/themes/default/ui.all.css type=text/css media=all hreflang=css/all charset=utf-8 / script src=jquery/jquery-1.2.6.js language=Javascript charset=utf-8/script script src=jquery/ui/jquery.ui.all.js language=Javascript charset=utf-8/script /head body table class=sometable tr id=rec_1tda href=#First record/a/td/tr tr id=rec_2tda href=#Second record/a/td/tr tr id=rec_3tda href=#Third record/a/td/tr tr id=rec_4tda href=#Fourth record/a/td/tr tr id=rec_5tda href=#Fifth record/a/td/tr tr id=rec_6tda href=#Sixth record/a/td/tr tr id=rec_7tda href=#Seventh record/a/td/tr /table script type=text/javascript Module = function() { self = this; return { //Present a dialog with Yes and No buttons. Execute provided callback for respective button. confirm: function(msg, yesCB, noCB, options) { $dialog = $(#my_dialog); if($dialog.length == 0) { $(body).append('div id=my_dialogp/p/div'); $dialog = $(#my_dialog); } var buttons = {}; buttons[Yes] = function(){ $dialog.dialog(close); if($.isFunction(yesCB)) yesCB(); }; buttons[No] = function(){ $dialog.dialog(close); if($.isFunction(noCB)) noCB(); }; var myOptions = { buttons: buttons, modal: true, overlay: { opacity: 0.7, background-color: #000 } }; $.extend(myOptions, options); $dialog.find(p).html(msg); $dialog.dialog(myOptions).dialog(open); } } }(); $(function() { $(.sometable a).click(function() { var $parentTR = $(this).parents('tr').eq(0); //select the first occurrence of a tr that is a parent of this var id = $parentTR.attr('id').replace(/rec_(.*)/i,$1); //grab the integer part of the id alert(Click: + $parentTR.attr(id)); Module.confirm(id,//call the piggybacked script function() { alert(You said yes to record + id);// = HERE is the problem } ); }) }); /script /body /html -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by *MailScanner* http://www.mailscanner.info/, and is believed to be clean.
[jQuery] Re: Ajax request in loop
Hi vorp, your English is fine, don't worry about that. :-) I'm trying to understand the purpose of your code, though. Why do you want to fire off 50 Ajax requests all at once like that? Also, these Ajax requests are *asynchronous*. That is, $.ajax() returns immediately without waiting for the response from the server. So it's almost certain that the responseText property of the XMLHttpRequest object does not yet have a value. Instead of testing the return value from $.ajax(), you need give it a success callback. This function will be called when the Ajax request receives a response from the server. Could you explain what it is you want to accomplish here, and then we could talk about the best way to code it? Whatever it is, you can probably do it with a single Ajax request instead of 50 of them. -Mike From: vorp Hi, I try get some results from ajax using while loop, but it doesn't work in IE7 and Safari. Here's example code: function get_results(foo){ return $.ajax({ type: GET, url: some_url.php/+foo, dataType: json }).responseText; }; ... ... var result = 0; var i = 0; while(result==0 i=49){ result = get_results(i); i++; } ... Although it works fine in Firefox and Opera (in firebug I can see every single request), but in IE and Safari not. Those browsers not responding after run this code. What's wrong and how can I fix it ? Regards ps.sorry for my poor english ;)
[jQuery] show/hide opacity gets stuck sometimes
I'm working on a page where once you hover over a small photo, a bigger photo should appear underneath it with a small text. The box holding the photo does appear, and once you slowly move towards another photo it works fine. But once you quickly move from the top left to the top right, it get a bit weird. Sometimes the box with the big photo disappears completely or it get stuck with the opacity not set to full visibility. And in IE7 there's another thing going on, the moment you place your mouse on the small photo it first seems to be disappearing, but it later does come up the way its supposed to be. I did set the z-index on both of the div's, but I have the feeling it doesn't have anything to do with the z-index. You can see it in action here - http://www.tijmensmit.com/dev/intranet/test.html $(#smoelenboek li).hover(function() { var $list_class = $(this).attr(class); $(#smoelenboek).find('li.' + $list_class).addClass (on); $(this).find(div).stop().animate({opacity: show, top: 30px}, slow); }, function () { $(this).find(div).stop().animate({opacity: hide, top: 20px}, fast); $(#smoelenboek li).removeClass(on); }); I know I could change the .stop().animate() to a simple .hide()/.show (), which works fine. But I would like to keep the animate opacity effect, but then without them sometimes disappearing :) Any idea's how to fix this problem? Thanks! Tijmen
[jQuery] Re: Autocomplete with JSON contacting the server frequently
On Dec 8, 9:30 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: I have noted that the JSON version/usagehttp://jquery.bassistance.de/autocomplete/demo/json.htmlis contacting the server frequently. The standard version is not unnecessarily contacting the server. It's contacting the server whenever a key is pressed. What could be the reason and any solution? TIA Should I rephrase my question? Is it not clear? -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
[jQuery] Re: How to achieve 2 moo gallery effects?
Have a look at these two plugins: Galleria - http://devkick.com/lab/galleria/ Cycle - http://malsup.com/jquery/cycle/ Paul On Dec 9, 5:57 am, expat101 [EMAIL PROTECTED] wrote: I am looking for gallery and slideshow effects like these, can i achieve them with jquery and how please http://tools.yootheme.com/yootools/extensions/yoogallery.html http://smoothgallery.jondesign.net/showcase/gallery/#myGallery-picture(4)
[jQuery] Odd behavior with 'this'?
Here's some behavior I've run into that is not quite what I expected. So the question is, should I expect something different or is this a bug / gotcha? I'm working on a plugin for manipulating tables (the ones that are published do not suit my needs). So I have the following inside my plugin: $.fn.myplugin = function(opts) { do_something(this); $(this).children('thead th:last').click(function() { do_something_else(this); }; }; function do_something_else(obj) { my_clicked = $(obj).parents('thead'); }; An example table: table thead thA/ththB/th /thead tbody /tbody /table Now, I expect that my_clicked will be an object for thead, but in actuality, it isn't anything, because obj is an object for thead, not for thB/th as I expect it to be (since that was what was clicked, and should have been passed as 'this'). Could someone please explain why it's working that way to me, and how I might get what I expect instead of what it is getting?
[jQuery] Re: show/hide opacity gets stuck sometimes
I've never worked with the .stop function before, so I searched for it in google (jquery .stop) to read up on it to see if that might shed some light... One of the very first links I found was this: http://www.pengoworks.com/workshop/jquery/stop_bug.htm Glancing over it, I think this is what is causing your problem. The individual who created that page links to a patch they created for the issue, and has a fairly straightforward demonstration. Hope that helps. On Dec 9, 11:11 am, Tijmen Smit [EMAIL PROTECTED] wrote: I'm working on a page where once you hover over a small photo, a bigger photo should appear underneath it with a small text. The box holding the photo does appear, and once you slowly move towards another photo it works fine. But once you quickly move from the top left to the top right, it get a bit weird. Sometimes the box with the big photo disappears completely or it get stuck with the opacity not set to full visibility. And in IE7 there's another thing going on, the moment you place your mouse on the small photo it first seems to be disappearing, but it later does come up the way its supposed to be. I did set the z-index on both of the div's, but I have the feeling it doesn't have anything to do with the z-index. You can see it in action here -http://www.tijmensmit.com/dev/intranet/test.html $(#smoelenboek li).hover(function() { var $list_class = $(this).attr(class); $(#smoelenboek).find('li.' + $list_class).addClass (on); $(this).find(div).stop().animate({opacity: show, top: 30px}, slow); }, function () { $(this).find(div).stop().animate({opacity: hide, top: 20px}, fast); $(#smoelenboek li).removeClass(on); }); I know I could change the .stop().animate() to a simple .hide()/.show (), which works fine. But I would like to keep the animate opacity effect, but then without them sometimes disappearing :) Any idea's how to fix this problem? Thanks! Tijmen
[jQuery] Unobtrusively passing data
I'm building a rails app and I've been trying to keep my html as unobtrusive as possible and my application.js as general as possible. Up until now I've been able to build re-usable page components by creating specific layout structure with the occasional custom attribute. Now I'm trying to integrate an autocomplete into my pages and am looking for a clean way to get data to the autocomplete component. Here's what I do... In my view html I create the form element for autocomplete with class='autocompleter' With javascript I add the data source to a global array that is indexed by element id. This lets me pass arrays etc. In my application.js I added the following function called from my ready function. var autocomplete_data = []; function load_autocompleters() { $(.autocompleted).each(function() { $(this).autocomplete(autocomplete_data[this.id], { matchContains: true, minChars: 0 }); }); } This works just fine, but is there a better way to do this?
[jQuery] Re: how to image cache using jQuery?
On Tue, Dec 9, 2008 at 9:03 AM, darwin liem [EMAIL PROTECTED] wrote: Naaah, I've check this one... it still load all the image in view port... what I want to achieve is that some sort of var imgtemp = new Image(); which will cache image however this only works for img tags not background... I cant find API nor plugins for this solution. does anyone have any idea or a workaround? So, create the Image objects and, when they've loaded, assign the src attribute to the background of whatever elements you wish to have them. Something like: var imgtemp = new Image(); imgtemp.src = '...'; I'm not sure if you could set the following as a load() handler on imgTemp, as it's not in the DOM. $('some_element').css('backgroundImage','url(' + imgTemp.src +')');
[jQuery] Re: DOMWindow resizable.
see here: http://sonspring.com/journal/jquery-iframe-sizing On Tue, Dec 9, 2008 at 9:10 AM, m.ugues [EMAIL PROTECTED] wrote: Hallo all. I use DOMWindow (http://swip.codylindley.com/DOMWindowDemo.html) to display some content loaded via ajax call. I have a problem with DOMWindow similare to this http://codylindley.com/thickboxforum/comments.php?DiscussionID=1301page=1#Item_1 Any idea? The content is not an image, is an html page. Kind regards Massimo
[jQuery] Re: Functions and variables
On Tue, Dec 9, 2008 at 10:12 AM, Will [EMAIL PROTECTED] wrote: Thanks. I ready an article somewhere and it mentioned not combining old coding forms with new in reference to jQuery. It didn't make much sense to me and this confirms it. I'll continue to code with functions and such and just supplement with jQuery where beneficial. Again, if you have any specific code that you can post, maybe someone could help you refactor it.
[jQuery] Re: Odd behavior with 'this'?
Change .children('thead th:last') to .find('thead th:last') - Richard On Tue, Dec 9, 2008 at 11:34 AM, Leanan [EMAIL PROTECTED] wrote: Here's some behavior I've run into that is not quite what I expected. So the question is, should I expect something different or is this a bug / gotcha? I'm working on a plugin for manipulating tables (the ones that are published do not suit my needs). So I have the following inside my plugin: $.fn.myplugin = function(opts) { do_something(this); $(this).children('thead th:last').click(function() { do_something_else(this); }; }; function do_something_else(obj) { my_clicked = $(obj).parents('thead'); }; An example table: table thead thA/ththB/th /thead tbody /tbody /table Now, I expect that my_clicked will be an object for thead, but in actuality, it isn't anything, because obj is an object for thead, not for thB/th as I expect it to be (since that was what was clicked, and should have been passed as 'this'). Could someone please explain why it's working that way to me, and how I might get what I expect instead of what it is getting?
[jQuery] Re: Autocomplete with JSON contacting the server frequently
On Tue, Dec 9, 2008 at 11:11 AM, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Dec 8, 9:30 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: I have noted that the JSON version/usagehttp://jquery.bassistance.de/autocomplete/demo/json.htmlis contacting the server frequently. The standard version is not unnecessarily contacting the server. It's contacting the server whenever a key is pressed. What could be the reason and any solution? TIA Should I rephrase my question? Is it not clear? Sure, and perhaps post some code.
[jQuery] jQuery.get filtered JavaScript Tag
When using jQuery.get to fetch remote contents, the content inside the script tag will be removed and therefore not executed. Is it possible to incluce the script tag and run it automcatically when using jQuery.get ? Thanks.
[jQuery] show JSP using dialog plugin
Hi, I want to show JSP as a dialog using dialog plugin. I dont prefer to keep div elements in the page and show the dialog because user can see all hidden divs using View Source. Can I pass URL in dialog() and show the JSP as a modal window using JQuery? Thanks, Bhavin
[jQuery] Re: show/hide opacity gets stuck sometimes
Thanks a lot :) The clearQueue option for the stop() did the trick, for some reason I completely missed it on docs.jquery.com On Dec 9, 6:04 pm, Leanan [EMAIL PROTECTED] wrote: I've never worked with the .stop function before, so I searched for it in google (jquery .stop) to read up on it to see if that might shed some light... One of the very first links I found was this: http://www.pengoworks.com/workshop/jquery/stop_bug.htm Glancing over it, I think this is what is causing your problem. The individual who created that page links to a patch they created for the issue, and has a fairly straightforward demonstration. Hope that helps. On Dec 9, 11:11 am, Tijmen Smit [EMAIL PROTECTED] wrote: I'm working on a page where once you hover over a small photo, a bigger photo should appear underneath it with a small text. The box holding the photo does appear, and once you slowly move towards another photo it works fine. But once you quickly move from the top left to the top right, it get a bit weird. Sometimes the box with the big photo disappears completely or it get stuck with the opacity not set to full visibility. And in IE7 there's another thing going on, the moment you place your mouse on the small photo it first seems to be disappearing, but it later does come up the way its supposed to be. I did set the z-index on both of the div's, but I have the feeling it doesn't have anything to do with the z-index. You can see it in action here -http://www.tijmensmit.com/dev/intranet/test.html $(#smoelenboek li).hover(function() { var $list_class = $(this).attr(class); $(#smoelenboek).find('li.' + $list_class).addClass (on); $(this).find(div).stop().animate({opacity: show, top: 30px}, slow); }, function () { $(this).find(div).stop().animate({opacity: hide, top: 20px}, fast); $(#smoelenboek li).removeClass(on); }); I know I could change the .stop().animate() to a simple .hide()/.show (), which works fine. But I would like to keep the animate opacity effect, but then without them sometimes disappearing :) Any idea's how to fix this problem? Thanks! Tijmen
[jQuery] Re: Ajax request in loop
Well ok, I try to explain what I want to do. At first I forgot to tell, that I have setup all ajax requests in synchronous mode ( $.ajaxSetup({async: false}) ) so after call my get_results() function browser should wait for response. Inside while loop is not only function call, but additionally displaying get_results() results. This is a part of biggest script and inside while loop I increase variable i. Next I call get_results(i). This function gets google search results (var i is a google page number) and return to me info about results. So I must use loop, because I must check on which page number my searching results are. Now in FF everything is ok. After start, table rows with results are added at bottom of table, but in Safari when I start script, I see only rainbow circle (browser thinking ;) ) and after few seconds (minutes) completly table with results is displayed (not step by step like in FF). My English is poor. I know that, but I hope you (and others) understand what I wrote ;)
[jQuery] Re: show/hide opacity gets stuck sometimes
You're welcome. Glad it proved useful. On Dec 9, 1:22 pm, Tijmen Smit [EMAIL PROTECTED] wrote: Thanks a lot :) The clearQueue option for the stop() did the trick, for some reason I completely missed it on docs.jquery.com On Dec 9, 6:04 pm, Leanan [EMAIL PROTECTED] wrote: I've never worked with the .stop function before, so I searched for it in google (jquery .stop) to read up on it to see if that might shed some light... One of the very first links I found was this: http://www.pengoworks.com/workshop/jquery/stop_bug.htm Glancing over it, I think this is what is causing your problem. The individual who created that page links to a patch they created for the issue, and has a fairly straightforward demonstration. Hope that helps. On Dec 9, 11:11 am, Tijmen Smit [EMAIL PROTECTED] wrote: I'm working on a page where once you hover over a small photo, a bigger photo should appear underneath it with a small text. The box holding the photo does appear, and once you slowly move towards another photo it works fine. But once you quickly move from the top left to the top right, it get a bit weird. Sometimes the box with the big photo disappears completely or it get stuck with the opacity not set to full visibility. And in IE7 there's another thing going on, the moment you place your mouse on the small photo it first seems to be disappearing, but it later does come up the way its supposed to be. I did set the z-index on both of the div's, but I have the feeling it doesn't have anything to do with the z-index. You can see it in action here -http://www.tijmensmit.com/dev/intranet/test.html $(#smoelenboek li).hover(function() { var $list_class = $(this).attr(class); $(#smoelenboek).find('li.' + $list_class).addClass (on); $(this).find(div).stop().animate({opacity: show, top: 30px}, slow); }, function () { $(this).find(div).stop().animate({opacity: hide, top: 20px}, fast); $(#smoelenboek li).removeClass(on); }); I know I could change the .stop().animate() to a simple .hide()/.show (), which works fine. But I would like to keep the animate opacity effect, but then without them sometimes disappearing :) Any idea's how to fix this problem? Thanks! Tijmen
[jQuery] Re: show/hide opacity gets stuck sometimes
On Dec 9, 2008, at 1:22 PM, Tijmen Smit wrote: The clearQueue option for the stop() did the trick, for some reason I completely missed it on docs.jquery.com Not your fault. The note about the .stop() options looked almost like a footnote. Quite easy to miss. I've just updated the page to place the options in their proper place. http://docs.jquery.com/Effects/stop#clearQueuegotoEnd --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Dec 9, 6:04 pm, Leanan [EMAIL PROTECTED] wrote: I've never worked with the .stop function before, so I searched for it in google (jquery .stop) to read up on it to see if that might shed some light... One of the very first links I found was this: http://www.pengoworks.com/workshop/jquery/stop_bug.htm Glancing over it, I think this is what is causing your problem. The individual who created that page links to a patch they created for the issue, and has a fairly straightforward demonstration. Hope that helps. On Dec 9, 11:11 am, Tijmen Smit [EMAIL PROTECTED] wrote: I'm working on a page where once you hover over a small photo, a bigger photo should appear underneath it with a small text. The box holding the photo does appear, and once you slowly move towards another photo it works fine. But once you quickly move from the top left to the top right, it get a bit weird. Sometimes the box with the big photo disappears completely or it get stuck with the opacity not set to full visibility. And in IE7 there's another thing going on, the moment you place your mouse on the small photo it first seems to be disappearing, but it later does come up the way its supposed to be. I did set the z-index on both of the div's, but I have the feeling it doesn't have anything to do with the z-index. You can see it in action here -http://www.tijmensmit.com/dev/intranet/test.html $(#smoelenboek li).hover(function() { var $list_class = $(this).attr(class); $(#smoelenboek).find('li.' + $list_class).addClass (on); $(this).find(div).stop().animate({opacity: show, top: 30px}, slow); }, function () { $(this).find(div).stop().animate({opacity: hide, top: 20px}, fast); $(#smoelenboek li).removeClass(on); }); I know I could change the .stop().animate() to a simple .hide()/.show (), which works fine. But I would like to keep the animate opacity effect, but then without them sometimes disappearing :) Any idea's how to fix this problem? Thanks! Tijmen
[jQuery] Re: show JSP using dialog plugin
Using SimpleModal, you can do something like: $.get(page.jsp, function(data) { $.modal(data); }); On Dec 9, 9:50 am, Bhavin [EMAIL PROTECTED] wrote: Hi, I want to show JSP as a dialog using dialog plugin. I dont prefer to keep div elements in the page and show the dialog because user can see all hidden divs using View Source. Can I pass URL in dialog() and show the JSP as a modal window using JQuery? Thanks, Bhavin
[jQuery] TableSorter vs Zebra Stripes
I want to create a table that features sortable columns and alternate row colors. I found scripts that do one or the other, but when I implement both, the row color function is impaired. First, I downloaded the JQuery TableSorter plugin; hence the links to jquery-1.2.6.min.js and jquery.tablesorter.js below. Below that is the JavaScript for the Zebra Stripes function. When used together, the table exhibits no row colors except when I mouseover a row. Does anyone know how I can fix this? Thanks. * * * * * script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script type=text/javascript var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj['e'+type+fn] = fn; obj[type+fn] = function() { obj['e'+type+fn](window.event); } obj.attachEvent('on'+type,obj[type+fn]); } else obj.addEventListener(type,fn,false); }, remove: function(obj,type,fn) { if (obj.detachEvent) { obj.detachEvent('on'+type,obj[type+fn]); obj[type+fn] = null; } else obj.removeEventListener(type,fn,false); } } function $() { var elements = new Array(); for (var i=0;iarguments.length;i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,); } function addClassName(el,className) { removeClassName(el,className); el.className = (el.className + + className).trim(); } function removeClassName(el,className) { el.className = el.className.replace(className,).trim(); } var ZebraTable = { bgcolor: '', classname: '', stripe: function(el) { if (!$(el)) return; var rows = $(el).getElementsByTagName('tr'); for (var i=1,len=rows.length;ilen;i++) { if (i % 2 == 0) rows[i].className = 'alt'; Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); }); Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); }); } }, mouseover: function(row) { this.bgcolor = row.style.backgroundColor; this.classname = row.className; addClassName(row,'over'); }, mouseout: function(row) { removeClassName(row,'over'); addClassName(row,this.classname); row.style.backgroundColor = this.bgcolor; } } window.onload = function() { ZebraTable.stripe('myTable'); } /script
[jQuery] Re: TableSorter vs Zebra Stripes
Yuck If you want to use Tablesorter, why not use the way it's supposed to be used? one simple setting of the widgets in the .tablesorter call would wire up all alternate rows with the class odd (and it's done!) On Dec 9, 3:01 pm, David Blomstrom [EMAIL PROTECTED] wrote: I want to create a table that features sortable columns and alternate row colors. I found scripts that do one or the other, but when I implement both, the row color function is impaired. First, I downloaded the JQuery TableSorter plugin; hence the links to jquery-1.2.6.min.js and jquery.tablesorter.js below. Below that is the JavaScript for the Zebra Stripes function. When used together, the table exhibits no row colors except when I mouseover a row. Does anyone know how I can fix this? Thanks. * * * * * script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script type=text/javascript var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj['e'+type+fn] = fn; obj[type+fn] = function() { obj['e'+type+fn](window.event); } obj.attachEvent('on'+type,obj[type+fn]); } else obj.addEventListener(type,fn,false); }, remove: function(obj,type,fn) { if (obj.detachEvent) { obj.detachEvent('on'+type,obj[type+fn]); obj[type+fn] = null; } else obj.removeEventListener(type,fn,false); } } function $() { var elements = new Array(); for (var i=0;iarguments.length;i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,); } function addClassName(el,className) { removeClassName(el,className); el.className = (el.className + + className).trim(); } function removeClassName(el,className) { el.className = el.className.replace(className,).trim(); } var ZebraTable = { bgcolor: '', classname: '', stripe: function(el) { if (!$(el)) return; var rows = $(el).getElementsByTagName('tr'); for (var i=1,len=rows.length;ilen;i++) { if (i % 2 == 0) rows[i].className = 'alt'; Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); }); Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); }); } }, mouseover: function(row) { this.bgcolor = row.style.backgroundColor; this.classname = row.className; addClassName(row,'over'); }, mouseout: function(row) { removeClassName(row,'over'); addClassName(row,this.classname); row.style.backgroundColor = this.bgcolor; } } window.onload = function() { ZebraTable.stripe('myTable'); } /script
[jQuery] Re: TableSorter vs Zebra Stripes
The zebra code you have seems to be based on another library (Prototype ?), so it wont run using without it. Anyway, there's a zebra plugin included by default in the tablesorter. just do: $(table).tablesorter({ widgets: ['zebra','repeatHeaders'] }); Olivier On Tue, Dec 9, 2008 at 9:01 PM, David Blomstrom [EMAIL PROTECTED]wrote: I want to create a table that features sortable columns and alternate row colors. I found scripts that do one or the other, but when I implement both, the row color function is impaired. First, I downloaded the JQuery TableSorter plugin; hence the links to jquery-1.2.6.min.js and jquery.tablesorter.js below. Below that is the JavaScript for the Zebra Stripes function. When used together, the table exhibits no row colors except when I mouseover a row. Does anyone know how I can fix this? Thanks. * * * * * script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script type=text/javascript var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj['e'+type+fn] = fn; obj[type+fn] = function() { obj['e'+type+fn](window.event); } obj.attachEvent('on'+type,obj[type+fn]); } else obj.addEventListener(type,fn,false); }, remove: function(obj,type,fn) { if (obj.detachEvent) { obj.detachEvent('on'+type,obj[type+fn]); obj[type+fn] = null; } else obj.removeEventListener(type,fn,false); } } function $() { var elements = new Array(); for (var i=0;iarguments.length;i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,); } function addClassName(el,className) { removeClassName(el,className); el.className = (el.className + + className).trim(); } function removeClassName(el,className) { el.className = el.className.replace(className,).trim(); } var ZebraTable = { bgcolor: '', classname: '', stripe: function(el) { if (!$(el)) return; var rows = $(el).getElementsByTagName('tr'); for (var i=1,len=rows.length;ilen;i++) { if (i % 2 == 0) rows[i].className = 'alt'; Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); }); Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); }); } }, mouseover: function(row) { this.bgcolor = row.style.backgroundColor; this.classname = row.className; addClassName(row,'over'); }, mouseout: function(row) { removeClassName(row,'over'); addClassName(row,this.classname); row.style.backgroundColor = this.bgcolor; } } window.onload = function() { ZebraTable.stripe('myTable'); } /script
[jQuery] Re: TableSorter vs Zebra Stripes
sry. wrong paste: $(table).tablesorter({ widgets: ['zebra'] }); On Tue, Dec 9, 2008 at 9:18 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: The zebra code you have seems to be based on another library (Prototype ?), so it wont run using without it. Anyway, there's a zebra plugin included by default in the tablesorter. just do: $(table).tablesorter({ widgets: ['zebra','repeatHeaders'] }); Olivier On Tue, Dec 9, 2008 at 9:01 PM, David Blomstrom [EMAIL PROTECTED] wrote: I want to create a table that features sortable columns and alternate row colors. I found scripts that do one or the other, but when I implement both, the row color function is impaired. First, I downloaded the JQuery TableSorter plugin; hence the links to jquery-1.2.6.min.js and jquery.tablesorter.js below. Below that is the JavaScript for the Zebra Stripes function. When used together, the table exhibits no row colors except when I mouseover a row. Does anyone know how I can fix this? Thanks. * * * * * script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script type=text/javascript var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj['e'+type+fn] = fn; obj[type+fn] = function() { obj['e'+type+fn](window.event); } obj.attachEvent('on'+type,obj[type+fn]); } else obj.addEventListener(type,fn,false); }, remove: function(obj,type,fn) { if (obj.detachEvent) { obj.detachEvent('on'+type,obj[type+fn]); obj[type+fn] = null; } else obj.removeEventListener(type,fn,false); } } function $() { var elements = new Array(); for (var i=0;iarguments.length;i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,); } function addClassName(el,className) { removeClassName(el,className); el.className = (el.className + + className).trim(); } function removeClassName(el,className) { el.className = el.className.replace(className,).trim(); } var ZebraTable = { bgcolor: '', classname: '', stripe: function(el) { if (!$(el)) return; var rows = $(el).getElementsByTagName('tr'); for (var i=1,len=rows.length;ilen;i++) { if (i % 2 == 0) rows[i].className = 'alt'; Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); }); Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); }); } }, mouseover: function(row) { this.bgcolor = row.style.backgroundColor; this.classname = row.className; addClassName(row,'over'); }, mouseout: function(row) { removeClassName(row,'over'); addClassName(row,this.classname); row.style.backgroundColor = this.bgcolor; } } window.onload = function() { ZebraTable.stripe('myTable'); } /script
[jQuery] jquery-based typing test?
Hi All, I'm about to put together a js-based typing test and am wondering if anyone might know of a plugin or code drop that might give me a head start? Basic process: 1. user sees an image of a block of text 2. clicks a button to start a timer 3. types into a textarea 4. textarea becomes disabled when timer runs out 5. some calcs are performed (words per minute, accuracy) and available via js (for setting into hidden form fields) Thanks, Jack
[jQuery] Re: fadeIn something from JSON
@karl: works great! thank you!! @botondus: that's exactly what I had before that, but then, out of some reason, the first hover would not show the item at all, only the second. On Tue, Dec 9, 2008 at 11:19 AM, botondus [EMAIL PROTECTED] wrote: Well if you want to fade in something it has to be hidden first. If the example with hide() doesn't work, just hide it straight from html. $.getJSON(urlForDescription, function(data) { $div = $(div class='info' style='display:none;' + data + /div); $element.after($div).fadeIn(); }); On Dec 9, 12:06 am, Jan Limpens [EMAIL PROTECTED] wrote: On Mon, Dec 8, 2008 at 7:20 PM, MorningZ [EMAIL PROTECTED] wrote: you'll have to do the fadeIn inside the callback of getJSON var showDescription = function() { $element = $(a.info, this); if ($element.next(div.info).length == 0) { var urlForDescription = $element.attr('href') + '/descricao'; $.getJSON(urlForDescription, function(data) { $div = $(div class='info' + data + /div); $element.after($div).fadeIn(); }); } else { $element.next(div.info).fadeIn(); } } also, just pops up. :( -- Jan -- Jan
[jQuery] Re: TableSorter vs Zebra Stripes
Thanks. I changed my code accordingly... script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script $(table).tablesorter({ widgets: ['zebra'] }); /script * * * * * But it works just as before; there are no table colors except when I mouseover a row. I'm assuming I only need to add the proper CSS. According to this page - http://docs.jquery.com/Tutorials:Zebra_Striping_Made_Easy - I need to create CSS styles for .alt and .over. In fact, I already have those styles, yet there's no background color. Any tips? Thanks. On Tue, Dec 9, 2008 at 12:19 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: sry. wrong paste: $(table).tablesorter({ widgets: ['zebra'] }); On Tue, Dec 9, 2008 at 9:18 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: The zebra code you have seems to be based on another library (Prototype ?), so it wont run using without it. Anyway, there's a zebra plugin included by default in the tablesorter. just do: $(table).tablesorter({ widgets: ['zebra','repeatHeaders'] }); Olivier On Tue, Dec 9, 2008 at 9:01 PM, David Blomstrom [EMAIL PROTECTED] wrote: I want to create a table that features sortable columns and alternate row colors. I found scripts that do one or the other, but when I implement both, the row color function is impaired. First, I downloaded the JQuery TableSorter plugin; hence the links to jquery-1.2.6.min.js and jquery.tablesorter.js below. Below that is the JavaScript for the Zebra Stripes function. When used together, the table exhibits no row colors except when I mouseover a row. Does anyone know how I can fix this? Thanks. * * * * * script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script type=text/javascript var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj['e'+type+fn] = fn; obj[type+fn] = function() { obj['e'+type+fn](window.event); } obj.attachEvent('on'+type,obj[type+fn]); } else obj.addEventListener(type,fn,false); }, remove: function(obj,type,fn) { if (obj.detachEvent) { obj.detachEvent('on'+type,obj[type+fn]); obj[type+fn] = null; } else obj.removeEventListener(type,fn,false); } } function $() { var elements = new Array(); for (var i=0;iarguments.length;i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,); } function addClassName(el,className) { removeClassName(el,className); el.className = (el.className + + className).trim(); } function removeClassName(el,className) { el.className = el.className.replace(className,).trim(); } var ZebraTable = { bgcolor: '', classname: '', stripe: function(el) { if (!$(el)) return; var rows = $(el).getElementsByTagName('tr'); for (var i=1,len=rows.length;ilen;i++) { if (i % 2 == 0) rows[i].className = 'alt'; Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); }); Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); }); } }, mouseover: function(row) { this.bgcolor = row.style.backgroundColor; this.classname = row.className; addClassName(row,'over'); }, mouseout: function(row) { removeClassName(row,'over'); addClassName(row,this.classname); row.style.backgroundColor = this.bgcolor; } } window.onload = function() { ZebraTable.stripe('myTable'); } /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs Zebra Stripes
ok. do that instead: script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter( widgets: ['zebra'] ); } ); /script On Tue, Dec 9, 2008 at 9:43 PM, David Blomstrom [EMAIL PROTECTED]wrote: Thanks. I changed my code accordingly... script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script $(table).tablesorter({ widgets: ['zebra'] }); /script * * * * * But it works just as before; there are no table colors except when I mouseover a row. I'm assuming I only need to add the proper CSS. According to this page - http://docs.jquery.com/Tutorials:Zebra_Striping_Made_Easy - I need to create CSS styles for .alt and .over. In fact, I already have those styles, yet there's no background color. Any tips? Thanks. On Tue, Dec 9, 2008 at 12:19 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: sry. wrong paste: $(table).tablesorter({ widgets: ['zebra'] }); On Tue, Dec 9, 2008 at 9:18 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: The zebra code you have seems to be based on another library (Prototype ?), so it wont run using without it. Anyway, there's a zebra plugin included by default in the tablesorter. just do: $(table).tablesorter({ widgets: ['zebra','repeatHeaders'] }); Olivier On Tue, Dec 9, 2008 at 9:01 PM, David Blomstrom [EMAIL PROTECTED] wrote: I want to create a table that features sortable columns and alternate row colors. I found scripts that do one or the other, but when I implement both, the row color function is impaired. First, I downloaded the JQuery TableSorter plugin; hence the links to jquery-1.2.6.min.js and jquery.tablesorter.js below. Below that is the JavaScript for the Zebra Stripes function. When used together, the table exhibits no row colors except when I mouseover a row. Does anyone know how I can fix this? Thanks. * * * * * script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script type=text/javascript var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj['e'+type+fn] = fn; obj[type+fn] = function() { obj['e'+type+fn](window.event); } obj.attachEvent('on'+type,obj[type+fn]); } else obj.addEventListener(type,fn,false); }, remove: function(obj,type,fn) { if (obj.detachEvent) { obj.detachEvent('on'+type,obj[type+fn]); obj[type+fn] = null; } else obj.removeEventListener(type,fn,false); } } function $() { var elements = new Array(); for (var i=0;iarguments.length;i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,); } function addClassName(el,className) { removeClassName(el,className); el.className = (el.className + + className).trim(); } function removeClassName(el,className) { el.className = el.className.replace(className,).trim(); } var ZebraTable = { bgcolor: '', classname: '', stripe: function(el) { if (!$(el)) return; var rows = $(el).getElementsByTagName('tr'); for (var i=1,len=rows.length;ilen;i++) { if (i % 2 == 0) rows[i].className = 'alt'; Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); }); Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); }); } }, mouseover: function(row) { this.bgcolor = row.style.backgroundColor; this.classname = row.className; addClassName(row,'over'); }, mouseout: function(row) { removeClassName(row,'over'); addClassName(row,this.classname); row.style.backgroundColor = this.bgcolor; } } window.onload = function() { ZebraTable.stripe('myTable'); } /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs Zebra Stripes
Sorry, I missed the messag that references class odd. Yet when I insert the following style... tr.odd td { background: #ff0; } ...there are still no colored rows.
[jQuery] creating unique IDs
or: DOMWindow -- open with selector I'm writing a plugin that creates a div with a form and attaches it to the document, hidden. There may be several of these on the page so I dispensed with IDs, choosing to use class selectors to get at them to display, etc.. So far, this has been fine. However, I'd like to have the option to use a DOMWindow to display these divs. I'd like to assign a click handler to my button which would open the corresponding div. The problem is that DOMWindow only seems to accept an ID for the div from which to get the inline content. There doesn't appear to be any way to pass it a selector string (both strange and unfortunate). It looks like I'll need to add IDs to my hidden divs, though, as I said, there's no telling how many will be created on a page. I've read that appending datetime to an ID string isn't guaranteed to provide unique strings. Does anyone have any hints for a bullet-proof way to do that? Or, should I just hack this feature into DOMWindow and get on with things? [1] http://swip.codylindley.com/
[jQuery] Re: TableSorter vs Zebra Stripes
Sorry, when I pasted that script in, there were still no row colors, plus the sorting function sstopped working. On Tue, Dec 9, 2008 at 12:46 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: ok. do that instead: script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter( widgets: ['zebra'] ); } ); /script On Tue, Dec 9, 2008 at 9:43 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks. I changed my code accordingly... script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script $(table).tablesorter({ widgets: ['zebra'] }); /script * * * * * But it works just as before; there are no table colors except when I mouseover a row. I'm assuming I only need to add the proper CSS. According to this page - http://docs.jquery.com/Tutorials:Zebra_Striping_Made_Easy - I need to create CSS styles for .alt and .over. In fact, I already have those styles, yet there's no background color. Any tips? Thanks. On Tue, Dec 9, 2008 at 12:19 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: sry. wrong paste: $(table).tablesorter({ widgets: ['zebra'] }); On Tue, Dec 9, 2008 at 9:18 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: The zebra code you have seems to be based on another library (Prototype ?), so it wont run using without it. Anyway, there's a zebra plugin included by default in the tablesorter. just do: $(table).tablesorter({ widgets: ['zebra','repeatHeaders'] }); Olivier On Tue, Dec 9, 2008 at 9:01 PM, David Blomstrom [EMAIL PROTECTED] wrote: I want to create a table that features sortable columns and alternate row colors. I found scripts that do one or the other, but when I implement both, the row color function is impaired. First, I downloaded the JQuery TableSorter plugin; hence the links to jquery-1.2.6.min.js and jquery.tablesorter.js below. Below that is the JavaScript for the Zebra Stripes function. When used together, the table exhibits no row colors except when I mouseover a row. Does anyone know how I can fix this? Thanks. * * * * * script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script type=text/javascript var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj['e'+type+fn] = fn; obj[type+fn] = function() { obj['e'+type+fn](window.event); } obj.attachEvent('on'+type,obj[type+fn]); } else obj.addEventListener(type,fn,false); }, remove: function(obj,type,fn) { if (obj.detachEvent) { obj.detachEvent('on'+type,obj[type+fn]); obj[type+fn] = null; } else obj.removeEventListener(type,fn,false); } } function $() { var elements = new Array(); for (var i=0;iarguments.length;i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,); } function addClassName(el,className) { removeClassName(el,className); el.className = (el.className + + className).trim(); } function removeClassName(el,className) { el.className = el.className.replace(className,).trim(); } var ZebraTable = { bgcolor: '', classname: '', stripe: function(el) { if (!$(el)) return; var rows = $(el).getElementsByTagName('tr'); for (var i=1,len=rows.length;ilen;i++) { if (i % 2 == 0) rows[i].className = 'alt'; Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); }); Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); }); } }, mouseover: function(row) { this.bgcolor = row.style.backgroundColor; this.classname = row.className; addClassName(row,'over'); }, mouseout: function(row) { removeClassName(row,'over'); addClassName(row,this.classname); row.style.backgroundColor = this.bgcolor; } } window.onload = function() { ZebraTable.stripe('myTable'); } /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs Zebra Stripes
My bad. I forgot the {} so there is a js error now . corrected code : script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script On Tue, Dec 9, 2008 at 9:54 PM, David Blomstrom [EMAIL PROTECTED]wrote: Sorry, when I pasted that script in, there were still no row colors, plus the sorting function sstopped working. On Tue, Dec 9, 2008 at 12:46 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: ok. do that instead: script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter( widgets: ['zebra'] ); } ); /script On Tue, Dec 9, 2008 at 9:43 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks. I changed my code accordingly... script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script $(table).tablesorter({ widgets: ['zebra'] }); /script * * * * * But it works just as before; there are no table colors except when I mouseover a row. I'm assuming I only need to add the proper CSS. According to this page - http://docs.jquery.com/Tutorials:Zebra_Striping_Made_Easy - I need to create CSS styles for .alt and .over. In fact, I already have those styles, yet there's no background color. Any tips? Thanks. On Tue, Dec 9, 2008 at 12:19 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: sry. wrong paste: $(table).tablesorter({ widgets: ['zebra'] }); On Tue, Dec 9, 2008 at 9:18 PM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: The zebra code you have seems to be based on another library (Prototype ?), so it wont run using without it. Anyway, there's a zebra plugin included by default in the tablesorter. just do: $(table).tablesorter({ widgets: ['zebra','repeatHeaders'] }); Olivier On Tue, Dec 9, 2008 at 9:01 PM, David Blomstrom [EMAIL PROTECTED] wrote: I want to create a table that features sortable columns and alternate row colors. I found scripts that do one or the other, but when I implement both, the row color function is impaired. First, I downloaded the JQuery TableSorter plugin; hence the links to jquery-1.2.6.min.js and jquery.tablesorter.js below. Below that is the JavaScript for the Zebra Stripes function. When used together, the table exhibits no row colors except when I mouseover a row. Does anyone know how I can fix this? Thanks. * * * * * script src=/1A/JS/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/JS/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter(); } ); /script script type=text/javascript var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj['e'+type+fn] = fn; obj[type+fn] = function() { obj['e'+type+fn](window.event); } obj.attachEvent('on'+type,obj[type+fn]); } else obj.addEventListener(type,fn,false); }, remove: function(obj,type,fn) { if (obj.detachEvent) { obj.detachEvent('on'+type,obj[type+fn]); obj[type+fn] = null; } else obj.removeEventListener(type,fn,false); } } function $() { var elements = new Array(); for (var i=0;iarguments.length;i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,); } function addClassName(el,className) { removeClassName(el,className); el.className = (el.className + + className).trim(); } function removeClassName(el,className) { el.className = el.className.replace(className,).trim(); } var ZebraTable = { bgcolor: '', classname: '', stripe: function(el) { if (!$(el)) return; var rows = $(el).getElementsByTagName('tr'); for (var i=1,len=rows.length;ilen;i++) { if (i % 2 == 0) rows[i].className = 'alt'; Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); }); Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); }); } }, mouseover: function(row) { this.bgcolor = row.style.backgroundColor; this.classname = row.className; addClassName(row,'over'); }, mouseout: function(row) { removeClassName(row,'over'); addClassName(row,this.classname);
[jQuery] Re: TableSorter vs Zebra Stripes
...there are still no colored rows You *really* should download firebug (http://www.getfirebug.com) so you can see what your code (and/or the code you use) is actually doing the zebra widget adds the class to the tr tag, not the td tag, hence your css of tr.odd td { background: #ff0; } simply isn't valid On Dec 9, 3:47 pm, David Blomstrom [EMAIL PROTECTED] wrote: Sorry, I missed the messag that references class odd. Yet when I insert the following style... tr.odd td { background: #ff0; } ...there are still no colored rows.
[jQuery] Re: TableSorter vs Zebra Stripes
Awesome - it works! Thanks so much for all the tips.
[jQuery] Re: creating unique IDs
Why not just define a global variable, like script type=text/javascriptvar divID = 0;/script and use that when assigning the ID, while incrementing the value for the next.. So a super quick example http://paste.pocoo.org/show/94617/ On Dec 9, 3:51 pm, brian [EMAIL PROTECTED] wrote: or: DOMWindow -- open with selector I'm writing a plugin that creates a div with a form and attaches it to the document, hidden. There may be several of these on the page so I dispensed with IDs, choosing to use class selectors to get at them to display, etc.. So far, this has been fine. However, I'd like to have the option to use a DOMWindow to display these divs. I'd like to assign a click handler to my button which would open the corresponding div. The problem is that DOMWindow only seems to accept an ID for the div from which to get the inline content. There doesn't appear to be any way to pass it a selector string (both strange and unfortunate). It looks like I'll need to add IDs to my hidden divs, though, as I said, there's no telling how many will be created on a page. I've read that appending datetime to an ID string isn't guaranteed to provide unique strings. Does anyone have any hints for a bullet-proof way to do that? Or, should I just hack this feature into DOMWindow and get on with things? [1]http://swip.codylindley.com/
[jQuery] Re: TableSorter vs Zebra Stripes
ps... looking at your CSS again, it is indeed not valid, but not because of what i first thought, heh background isn't a valid property, it's background-color On Dec 9, 4:14 pm, David Blomstrom [EMAIL PROTECTED] wrote: Awesome - it works! Thanks so much for all the tips.
[jQuery] Timed Modal (or whatever)
I just know that this is going to be one of those dumbo questions but I have been trolling for a plugin to do what I need without luck. Basically I want a modal style display that I can open after the page has been loaded for a certain amount of time, display the modal and then fade/slide/whatever it away. My use is for our gaming site, I would like to pop something up (basically like a pop over ad) with a graphic and a bit of text as a tease. I can see how to do everything but get rid of it automatically .. I don't want to force them to clear the display with a click. We do railway stuff so as an example we would show a train flying through a station leaving a stranded passenger with a tease Don't forget to stop for your passengers at Patterson. Thanks, Larry
[jQuery] Updating the DOM after .load
I'm trying to load new contnet using the .load function in JQuery which works fine but the new content isn't being update with some javascript which should re-render the HTML into an image (sparklines) $(document).ready(function(){ $('.new_pie').click(function() { $('#orange').load('newcontent.html') return false; }); }); Here is a link to the problem URL: http://seanlandry.com/sparklines/ Some user groups have suggested using LiveQuery, which I've loaded into the directory as well. But for the life of me I can't figure out how to use it to bind the events. Any suggestions? Thanks!
[jQuery] DOM not updating after .load
I'm trying to load new contnet using the .load function in JQuery which works fine but the new content isn't being update with some javascript which should re-render the HTML into an image (sparklines) $(document).ready(function(){ $('.new_pie').click(function() { $('#orange').load('newcontent.html') return false; }); }); Here is a link to the problem URL: http://seanlandry.com/sparklines/ Some user groups have suggested using LiveQuery, which I've loaded into the directory as well. But for the life of me I can't figure out how to use it to bind the events. Any suggestions? Thanks! -- View this message in context: http://www.nabble.com/DOM-not-updating-after-.load-tp20920620s27240p20920620.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Problem with jQuery: AJAX interface / ajaxForm plugin file upload combo.
Dear Jquery devs, I got a slight but complex problem. and I think I need someone experienced with ajaxForm for it. I use the nifty AJAX interface ( http://www.visionmasterdesigns.com/tutorial-ajax-interface-menu-using-jqueryphp/ ), and i'd like to make my CMS (webshop) in this interface. For this I use Jquery and PHP. Everything so far has worked out quite good. Only 1 slight problem : the $_FILES['fileimage'] variable doesn't seem te get posted. Normal $_POST variables such as $_POST['txtname'] do get posted. Working code with a link for stuff inside the content: $('.content a').click(function() { var content_show = $(this).attr(title); var id = $(this).attr(id); $.ajax({ type: get,url: includes/admin/mediator.php,data: page=+content_show + sleep=0 + id= + id, success: function(html){ $(.content).html(html); } }); }); Now with the form: var options = { beforeSubmit: showRequest }; $('#addcategoryform').ajaxForm(options); function showRequest(formData, jqForm, options) { var queryString = $.param(formData); alert(queryString); $.ajax({ type: post, url: includes/admin/mediator.php, data: queryString + page=procescategorysleep=1, success: function(html){ $(.content).html(html); } }); return false; } For me the problem is obvious, if you look at the data: argument, the file doesn't get put into the arguments. The normal arguments do get posted through and I can use them in the procescategory page. Does anyone know how to post a file manually or a work-around? I already tried ajaxSubmit, but doesn't seem to work either.
[jQuery] Columnize Plugin + ToggleSlide = problems in IE
I'm working on a page that uses the Columnize plugin to organize a set of divs into two columns. The behavior that I want (and which works in FF Safari) is this: when the page loads, all .speakers divs are hidden except for one (specified by script). Clicking on an H3 toggles the visibility of the next .speakers div and hides the one that is open. In IE 7 6, this only works if I turn delete this line: jQuery('.columns').columnize({ columns: 2 }); To be more specific: clicking on the first H3 closes opens the visible .speakers div. Clicking on any other H3 does nothing. If columnizing is disabled, the slideUp/slideDown functions work fine. Ideas or work arounds would be much-appreciated! Thanks, Esther URL: http://verbatimlectures.com/wordpress/ideas/ The divs follow this format: div id=issue-# class=issue h3Issue Name/h3 div id=speakers-issue-# class=speakers div id=speaker-#-issue-# class=speaker headshot src h4 class=entry-title speaker-permalink Speaker Name /h4 p class=taglineTagline text/p div class=clearfixnbsp;/div /div !-- #speaker-% -- /div !-- #speakers-% -- /div !-- .isssue -- Here is my script: jQuery(document).ready(function() { !-- Columns Toggling -- jQuery('.issue').addClass(dontsplit); jQuery('.speakers').addClass(dontsplit); jQuery('.columns').columnize({ columns: 2 }); jQuery('.speaker-excerpt').addClass(dontsplit); jQuery('div.speakers').hide(); jQuery('div#speakers-business').slideToggle(fast); jQuery('.issue h3').click(function () { jQuery('div.speakers').slideUp(fast); jQuery(this).next('div.speakers:hidden').slideDown(fast); }); }); -- View this message in context: http://www.nabble.com/Columnize-Plugin-%2B-ToggleSlide-%3D-problems-in-IE-tp20918586s27240p20918586.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Updating the DOM after .load
I'm trying to load new contnet using the .load function in JQuery which works fine but the new content isn't being update with some javascript which should re-render the HTML into an image (sparklines) $(document).ready(function(){ $('.new_pie').click(function() { $('#orange').load('newcontent.html') return false; }); }); Here is a link to the problem URL: http://seanlandry.com/sparklines/ Some user groups have suggested using LiveQuery, which I've loaded into the directory as well. But for the life of me I can't figure out how to use it to bind the events. Any suggestions?
[jQuery] Re: jQuery Form Plugin - success callback function isn't called
Actually if you put a debugger; statement there and debug with firebug you will see that it actually gets called. But for some reason the alert does not work. But other js code will work so you can show your messages somewhere else on the page if you want or need to. On 7 nov, 15:34, Mike Alsup [EMAIL PROTECTED] wrote: Theformsubmits as it should, using an AJAX call. When I add a beforeSubmitcallbackfunction to the options array, that gets called as well, as it should. Only the successcallback(the alert) isn't called and I don't know why. Maybe the call wasn't successful. Can you post a link?
[jQuery] Re: jQuery Form Plugin - success callback function isn't called
I have the same problem here and the call sure is successful, because the rest of the commands get executed. The weird thing is that only the alert that does not get executed. I have even inspected the response with firebug and repeated the tests using selenium with and without the alert so I´m sure that the alert does not work on these callbacks (including error and complete ones either). On 7 nov, 15:34, Mike Alsup [EMAIL PROTECTED] wrote: The form submits as it should, using an AJAX call. When I add a beforeSubmit callback function to the options array, that gets called as well, as it should. Only the success callback (the alert) isn't called and I don't know why. Maybe the call wasn't successful. Can you post a link?
[jQuery] Make script global (for every ajax page)
Hello, I have a problem, i have this script: $(document).ready(function() { var requestURL = index.php; $(a).click(function() { var params = $(this).attr(data); $(#content).slideUp(slow); $.ajax({ type: post, url: requestURL, data: new=ypage=+params, beforeSend: function() { $(#loading).slideDown(fast); }, success: function(response) { $(#content).html(response); $(#content).slideDown(slow); }, complete: function() { $(#loading).slideUp(fast); } }); }); }); i added it to my index.php, but when i open a new ajax page with it, the script dissappears... to make it work again, i have to add that script on every ajax page i open... so my question is: is it possible to make the script above global (make it work without calling it again)?
[jQuery] Simultaneous $.load() calls wait for eachother
I have a (stupid) problem: i have the follwing short script: $(window).load(function() { $(#div1).load('/xmlHttp.php?action=getLoad'); $(#div2).load(/xmlHttp.php?action=+ $(input [name='selectType']).val()); }); What this does: it calls the central xmlHttp url to fetch data. Simple right? Except that the first call can stall the second? The second call will finish only when the first is already done? It seems that the second call waits for the first to be done? (ór its just a widly strange coincidence that the two calls each take the exact amount of time according to firebug) the overall settings are as follows: $.ajaxSetup({cache: false}); If i rearrange the first call áfter the second the results are as expected: #div2 is filled quickly while div1 is still loading... Is this a bug or something else?
[jQuery] [validate] Having an issue with validator clearing file input fields onfocus in IE
Hi, i'm having an issue when using the validate plugin. When the plugin is applied to the form, if I select a file in my file input field then focus on another field in the form it removes the value. This only seems to happen in IE and only to file input fields. Any ideas as to why this would be happening? Thanks!
[jQuery] jQuery Star Rating plugin v2.5 displaying values over star images
I've studied the code of the demo pages and I can't see any difference between that and my own (my own implementation is built using the zip download, unmodified!) The stars get created fine, but each one has it's value displayed above it - where the same code on the example page does not do this? I'm a bit stumped, can anyone think of what might cause this. Sorry I can't post a URL currently... but hopefully my explanation of whats happening might trigger someones thoughts? Cheers, Rob
[jQuery] Cycle plugin: some images not loading
I am having a problem with some of my images not loading when using Mike Alsup's Cycle plugin. When my page loads and the images begin to cycle, some of them just show as a small white rectangle (presumable the border used for the images) while other images look fine. It's acting as though the images are not getting cached in the browser before Cycle does its thing. To recreate the problem, I clear my cache and refresh the page. The first image shows fine, but then when the images start to cycle, all subsequent images just show as a small white box. Then when I refresh the page, the images typically appear just fine. I have had some instances where some, but not all, of the images show. I am seeing this problem as described above in both Firefox 3 and Safari 3. In Opera 9.6, I see the subsequent images, but they are displayed only about 20px tall. In IE7, everything seems to work fine. I am using the minified version of jQuery 1.2.6 and the full version of Cycle 2.30. Javascript: $(document).ready(function() { $('.pics').cycle({ fx: 'zoom', random: 1, pause: 1, delay: -1000, timeout: 6000, next: '.pics' }); }); HTML: div class=pics img src=images/photos/1.jpg width=185 height=277 / img src=images/photos/2.jpg width=185 height=277 / img src=images/photos/3.jpg width=185 height=261 / img src=images/photos/4.jpg width=185 height=276 / img src=images/photos/5.jpg width=185 height=277 / img src=images/photos/6.jpg width=185 height=277 / img src=images/photos/7.jpg width=185 height=280 / img src=images/photos/8.jpg width=185 height=276 / img src=images/photos/9.jpg width=185 height=246 / img src=images/photos/10.jpg width=185 height=276 / img src=images/photos/11.jpg width=185 height=276 / img src=images/photos/12.jpg width=185 height=277 / img src=images/photos/13.jpg width=185 height=277 / img src=images/photos/14.jpg width=185 height=276 / img src=images/photos/15.jpg width=185 height=277 / img src=images/photos/16.jpg width=185 height=277 / /div UPDATE: As I have been writing this message, I have been trying some other options to see if I can resolve the issue myself. It looks like the problem is solved by setting explicit height and width properties in CSS. Mike, if you are out there: is this expected behavior?
[jQuery] Re: jQuery Form Plugin - success callback function isn't called
Actually if you put a debugger; statement there and debug with firebug you will see that it actually gets called. But for some reason the alert does not work. But other js code will work so you can show your messages somewhere else on the page if you want or need to. Post a link so we can see it in action.
[jQuery] Re: Overlapping BlockUIs
Is it possible to display one blockUI over another Maybe, but you'd probably need to hack at the plugin. It was designed to display a single page block at a time.