[jQuery] Re: Performance penalty for creating dom element from a string?
You confuse the text representation of the DOM tree with HTML source code. Single tags in XHTML must have the '/'. However, if you insert a tag using Javascript you are not writing XHTML!!! So what you see e.g. in Firebug is NOT XHTML source code, it is a CUSTOM (arbitrary) representation of the (binary) DOM tree structure. If the '/' is missing there it simply means the code showing the DOM tree as text leaves out the '/' - which doesn't have any representation in the DOM tree anyway, it only belongs in the source code from which the tree was created. Regards, Michael On Jan 15, 4:39 am, RWF mgor...@gmail.com wrote: This also confused me. I tried creating the element as the1.3 docs show (as noted in the OP) and then appending it to a div and it did not generate a closing tag. This is what I did: var image=$(img/); image.alt=hello world; $(#maindiv).append(image); The result was a single img without a / like this: div id=maindivimg/div Am I misunderstanding something? On Jan 14, 3:13 pm, Ricardo Tomasi ricardob...@gmail.com wrote: With the string, jQuery has to parse it, to find the tagname and any attributes. For a dozen elements it doesn't make any real difference, but when you get to the hundreds or thousands of elements it's significant: 100 elements: String: 34ms DOMElement: 5ms 1000 elements: String: 339ms DOMElement: 40ms This in Firefox 3, Core 2 Duo 1.6ghz, using Firebug (code below). cheers, - ricardo (function(){ var i=1001, r=i; console.time('string'); while(--i){ $('div/');} console.timeEnd('string'); i=r; console.time('DOMEl'); while(--i){ $(document.createElement('div'));}; console.timeEnd('DOMEl'); })(); On Jan 14, 3:04 pm, thomasvsundert thomas.vansund...@gmail.com wrote: Hi, the new documentation for jQuery 1.3 states that: To create a span use $(span/). As of jQuery 1.3 this syntax is completely equivalent to $(document.createElement(span)). First of all, what does this mean? What was the difference before? My real question is, what is the performance penalty for using $(div/ ) vs $(document.createElement(div))
[jQuery] Re: append changes width of select boxes in ie7
I see that i am not the only person who had this problem This post was sent two months ago with two additional persons who had the problem. http://groups.google.com/group/jquery-en/browse_thread/thread/92a792d07dab48a5/f2864e63fc595e25?lnk=gstq=append++select#f2864e63fc595e25 Can someone please help and explain the problem? On Jan 14, 7:26 pm, david michaelg...@gmail.com wrote: Hi all, I have written a control of 2 select boxes with buttons where i can move options from left to right and vice versa. In ie7 when i make the action of moving from left to right, the select boxes shrink suddenly. I narrowed the problem to theappendfunction here is the code from right to left: var left = $(this).parent().parent().find('#select_left'); var right = $(this).parent().parent().find('#select_right'); var rightOpts = $(this).parent().parent().find('#select_right option'); left.append(rightOpts); The problem just appears when i define thewidthof the select boxes in % not in pixels. Thanks in advance, David
[jQuery] Re: append changes width of select boxes in ie7
I see it is a problem in ie7: It is a regression in it. http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/thread/400656b5-6b3b-4a60-8265-1d82aad0cbcb/ Even then, is it possible to make something that append should work cross browser ? On Jan 15, 10:44 am, david michaelg...@gmail.com wrote: I see that i am not the only person who had this problem This post was sent two months ago with two additional persons who had the problem.http://groups.google.com/group/jquery-en/browse_thread/thread/92a792d... Can someone please help and explain the problem? On Jan 14, 7:26 pm, david michaelg...@gmail.com wrote: Hi all, I have written a control of 2 select boxes with buttons where i can move options from left to right and vice versa. In ie7 when i make the action of moving from left to right, the select boxes shrink suddenly. I narrowed the problem to theappendfunction here is the code from right to left: var left = $(this).parent().parent().find('#select_left'); var right = $(this).parent().parent().find('#select_right'); var rightOpts = $(this).parent().parent().find('#select_right option'); left.append(rightOpts); The problem just appears when i define thewidthof the select boxes in % not in pixels. Thanks in advance, David
[jQuery] Re: append changes width of select boxes in ie7
Do you have an example of what it's doing so we can get a better idea of what you mean? On Jan 15, 2:48 am, david michaelg...@gmail.com wrote: I see it is a problem in ie7: It is a regression in it.http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/thread... Even then, is it possible to make something that append should work cross browser ? On Jan 15, 10:44 am, david michaelg...@gmail.com wrote: I see that i am not the only person who had this problem This post was sent two months ago with two additional persons who had the problem.http://groups.google.com/group/jquery-en/browse_thread/thread/92a792d... Can someone please help and explain the problem? On Jan 14, 7:26 pm, david michaelg...@gmail.com wrote: Hi all, I have written a control of 2 select boxes with buttons where i can move options from left to right and vice versa. In ie7 when i make the action of moving from left to right, the select boxes shrink suddenly. I narrowed the problem to theappendfunction here is the code from right to left: var left = $(this).parent().parent().find('#select_left'); var right = $(this).parent().parent().find('#select_right'); var rightOpts = $(this).parent().parent().find('#select_right option'); left.append(rightOpts); The problem just appears when i define thewidthof the select boxes in % not in pixels. Thanks in advance, David
[jQuery] Re: IE Problem with (function($)
Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya...@gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; })(); $(EYE.init); })(jQuery); I think that's about the most obfuscated thing I've seen this week. I hope you're doing something cool. Let us know if that helps. On Jan 14, 11:57 pm, Sagar Arya sagararya...@gmail.com wrote: Hello, I tried changing the braces.. It seems they were proper... Here i am attaching all the files... Can anyone help me out pls... its perfectly running in mozilla, chrome.. but not in IE.. :( Cheers ! Sagar On Wed, Jan 14, 2009 at 12:08 PM, Sagar Arya sagararya...@gmail.com wrote: hey thanks so much.. :-) Cheers ! Aryan On Wed, Jan 14, 2009 at 10:26 AM, Karl Swedberg k...@englishrules.comwrote: good eye, Ricardo! thanks for the back up. :-) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:54 PM, Ricardo Tomasi wrote: You're missing a parenthesis when closing the anonymous function: }(); should be })(); And I'm guessing '$' is there for jQuery, so that should actually be })(jQuery); - ricardo On Jan 13, 3:56 pm, Sagar Arya sagararya...@gmail.com wrote: may be i should check with the other files and let you know... thanks for the information.. Cheers ! Aryan On Tue, Jan 13, 2009 at 7:06 PM, Karl Swedberg k...@englishrules.com wrote: I'm not seeing anything obvious. Taking a stab in the dark here ... I've received a similar error in the past when a reference to one of my JavaScript files was resulting in a 404. The browser would try to parse the file as JavaScript, but of course it would be met with a syntax error on line 1. Is it possible that the problem is not with this file, but with another one that you're trying to include? Just a guess. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:35 AM, Aryan wrote: I have a problem with Internet Explorer ( all versions ) . The following is my JQuery Code , which executes perfectly in mozilla and chrome.. But it doesn't work in Internet Explorer. It says : Syntax error ( line 1 )... Can anyone help me out here.. Thanks for your time in reading this. (function($){ var EYE = window.EYE = function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn){ fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; }(); $(EYE.init); })(jQuery); colorpicker.js 22KViewDownload eye.js 1KViewDownload jquery.js 136KViewDownload layout.js 2KViewDownload utils.js 9KViewDownload
[jQuery] Re: IE Problem with (function($)
Hello, Yes I included the jQuery file before the colorpicker.js file. And it works fine in Mozilla and chrome.. but it doesn't turn up in IE. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:03 PM, jQuery Lover ilovejqu...@gmail.com wrote: Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya...@gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; })(); $(EYE.init); })(jQuery); I think that's about the most obfuscated thing I've seen this week. I hope you're doing something cool. Let us know if that helps. On Jan 14, 11:57 pm, Sagar Arya sagararya...@gmail.com wrote: Hello, I tried changing the braces.. It seems they were proper... Here i am attaching all the files... Can anyone help me out pls... its perfectly running in mozilla, chrome.. but not in IE.. :( Cheers ! Sagar On Wed, Jan 14, 2009 at 12:08 PM, Sagar Arya sagararya...@gmail.com wrote: hey thanks so much.. :-) Cheers ! Aryan On Wed, Jan 14, 2009 at 10:26 AM, Karl Swedberg k...@englishrules.comwrote: good eye, Ricardo! thanks for the back up. :-) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:54 PM, Ricardo Tomasi wrote: You're missing a parenthesis when closing the anonymous function: }(); should be })(); And I'm guessing '$' is there for jQuery, so that should actually be })(jQuery); - ricardo On Jan 13, 3:56 pm, Sagar Arya sagararya...@gmail.com wrote: may be i should check with the other files and let you know... thanks for the information.. Cheers ! Aryan On Tue, Jan 13, 2009 at 7:06 PM, Karl Swedberg k...@englishrules.com wrote: I'm not seeing anything obvious. Taking a stab in the dark here ... I've received a similar error in the past when a reference to one of my JavaScript files was resulting in a 404. The browser would try to parse the file as JavaScript, but of course it would be met with a syntax error on line 1. Is it possible that the problem is not with this file, but with another one that you're trying to include? Just a guess. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:35 AM, Aryan wrote: I have a problem with Internet Explorer ( all versions ) . The following is my JQuery Code , which executes perfectly in mozilla and chrome.. But it doesn't work in Internet Explorer. It says : Syntax error ( line 1 )... Can anyone help me out here.. Thanks for your time in reading this. (function($){ var EYE = window.EYE = function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn){ fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; }
[jQuery] Re: append changes width of select boxes in ie7
Hi Thanks, Here is a mockup. It is not nice. I just wanted to show you the problem html head style type=text/css select {width:30%; float:left} .select {width:500px; float:left} fieldset input { clear:left; margin:5px 0; text-align:center; width:100%; } fieldset { border:0 none; height:100px; padding:75px 5px 5px; width:3%; } .select { border:0 none; display:block; float:left; margin-bottom:10px; padding:0; text-align:center; width:100%; } /style script type=text/javascript src=jquery-latest.js/script script type=text/javascript $(document).ready(function() { $('.add').click(function(){ var left = $('#select1'); var leftOpts = left.find('option:selected'); var right = $('#select2'); right.append(leftOpts); }); }); /script /head body div fieldset class=select select id=select1 name=select1 size=12 multiple=multiple class=s option/option optionb/option optionc/option optiond/option optione/option /select fieldset input type=button class=add value= / input type=button class=remove value= / /fieldset select id=select2 name=select2 size=12 multiple=multiple class=s /select /fieldset /div /body /html select options from the first select and press the right button. in ie7 it will shrink. Thanks, David On Jan 15, 11:03 am, emmj...@gmail.com emmj...@gmail.com wrote: Do you have an example of what it's doing so we can get a better idea of what you mean? On Jan 15, 2:48 am, david michaelg...@gmail.com wrote: I see it is a problem in ie7: It is a regression in it.http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/thread... Even then, is it possible to make something that append should work cross browser ? On Jan 15, 10:44 am, david michaelg...@gmail.com wrote: I see that i am not the only person who had this problem This post was sent two months ago with two additional persons who had the problem.http://groups.google.com/group/jquery-en/browse_thread/thread/92a792d... Can someone please help and explain the problem? On Jan 14, 7:26 pm, david michaelg...@gmail.com wrote: Hi all, I have written a control of 2 select boxes with buttons where i can move options from left to right and vice versa. In ie7 when i make the action of moving from left to right, the select boxes shrink suddenly. I narrowed the problem to theappendfunction here is the code from right to left: var left = $(this).parent().parent().find('#select_left'); var right = $(this).parent().parent().find('#select_right'); var rightOpts = $(this).parent().parent().find('#select_right option'); left.append(rightOpts); The problem just appears when i define thewidthof the select boxes in % not in pixels. Thanks in advance, David
[jQuery] Re: $(area) not working in IE (sorry if this is a repost)
Did you solve the problem? My FF and IE show the same border and act the same way (except FF has fade in/out effect). I'm using IE7. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 10:44 AM, Chrisw chris.p.wel...@gmail.com wrote: Let me try to clear this up in FF when you hover over a state (an area element) one (or more) of the images below should get a border around them, however, in IE nothing happens.. and I put an alert box in to see if anything was going on when you hover a state but in IE the alert box never showed, and in FF the alert did show up. -c On Jan 14, 9:36 pm, Chrisw chris.p.wel...@gmail.com wrote: Sorry about all the alert boxes they should be gone now, also thank you for the shorter code I was going to make the code shorter once I got this error worked out and you just saved me sometime ;) ... but I still have the same issue I cannot get $(area).hover(or mouseover) to work in IE. On Jan 14, 9:00 pm, James Van Dyke jame...@gmail.com wrote: Ok... that's a hard page to get away from with all those alert boxes. I know... no Firebug in IE. Poo. I believe that class is not what IE calls that attribute. For instance, element.class will return nothing. element.className is the correct property. Try that. Plus, you could shorten your code and make it a bit more readable: $(area).mouseover( function(){ $(# . $(this).attr(class)).addClass('selected');}.mouseout( function() { $(# . $(this).attr(class)).removeClass('selected'); }; Let me know how that works out. On Jan 14, 6:30 pm, Chrisw chris.p.wel...@gmail.com wrote: sorry if this is a repost but I didn't see it in the group and I didn't get a copy in my email. I am working with an image map and i am using the maphilight plugin and I want to add a border to an image below the image map when a user hovers over an area (based on the iamges ID and the area's class)(see code below) I got it to work in FF but I cannot get it to work in IE. Any help? URL:http://oregonstate.edu/admissions/firstyear/recruitmap/map/ Code: $(area).hover(function(){ var stateClass; stateClass = $(this).attr(class); var stateClassQuery; stateClassQuery = #+stateClass; alert(stateClassQuery);//for testing $(stateClassQuery).addClass('selected'); //mouse out }, function(){ var stateClass; stateClass = $(this).attr(class); var stateClassQuery; stateClassQuery = #+stateClass; $(stateClassQuery).removeClass('selected'); }
[jQuery] Re: Covering multiple elements with a single function, but passing a variable?
This really depends on the exact html structure you have. Ideally I would put the 'ul' and it's related 'a' within the same div. But if you have it exactly like in the example above, this will work: $('a.additem').click(function() { var list_id = $(this).prev('ul').eq(0).attr('id') $('#'+list_id).append('lidata/li'); }); Look for 'prev' and 'eq' in documentation, to understand exactly why/ how it works On Jan 14, 9:47 pm, Shawn smmcbr...@gmail.com wrote: Hi. I'm stuck trying to figure out the jQuery way to code this functionality I have in my project. Below is a stripped down example of what I'm trying to do. When I click the Add Item link below any list, I want to just append a new element to the end of that list. What I do now is just use an onclick element for each anchor tag, and call addItem and pass the specific list_id for that list. The function then dynamically locates that specific list and appends a new item. What I have here works (excuse any typos, I'm writing from memory), but I'd like to make it cleaner by getting rid of the onclick calls and just having jQuery bind a function to the additem class. I just can't figure out how to pull in the list_id variable in each case. Any ideas? ... function addItem(list_id) { $('#list_'+list_id+' ul').append('lidata/li'); return false; } ... ul id=list_1 lidata/li lidata/li /ul a class=additem href=# onclick=addItem(1);return false;Add Item/a ul id=list_2 lidata/li lidata/li /ul a class=additem href=# onclick=addItem(2);return false;Add Item/a ...
[jQuery] Re: getJSON - how to retrieve plain text?
Documentation quote: As of jQuery 1.2, you can load JSON data located on another domain if you specify a JSONP callback, which can be done like so: myurl?callback=?. jQuery automatically replaces the ? with the correct method name to call, calling your specified callback. About JSONP: http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/ Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 10:30 AM, James Van Dyke jame...@gmail.com wrote: It's almost certainly giving you an error about cross-domain XHR requests. Simply, you can't call URL's that start with http://; or else it will throw an error. Someone else may know how to get around that, but if you're referring to your own host, just use a relative path. To debug the issue, you may just want to wrap the getJSON() call inside a try block and catch any errors. Then, you can just use an alert box to read the message. If the message is too long, use jQuery to insert it inside an existing visible element. Good luck. On Jan 14, 7:08 pm, MorningZ morni...@gmail.com wrote: So i want to see what the plaintext is that's returned in the success callback Use Fiddler (http://www.fiddlertool.com) and it will show you exactly what IE is seeing when it makes the AJAX request and gets a result back On Jan 14, 6:51 pm, Rene Veerman rene7...@gmail.com wrote: I have a getJSON call that works fine in FF, but bugs in IE. I get no data. :( So i want to see what the plaintext is that's returned in the success callback.. Using the new 1.3 jQuery, btw.. code: var rc = $('select#regions_countries')[0]; var rr = $('select#regions_regions')[0]; var url = 'http://www.myhost.com/members/ajax_fetch_regions_for_countries.php'; var countries = []; for (var i=0; irc.options.length; i++) { if (rc.options[i].selected) { countries[countries.length] = rc.options[i].text; } }; $.getJSON (url, {countries:countries.join('|-|')}, function (data, ts) { var regions = data.regions.split('|-|').sort(); var html = ''; for (var i=0; iregions.length; i++) { html+='option value='+regions[i].replace(/\s\(.*\)/,'')+''+regions[i]+'/option'; } rr.innerHTML = html; });
[jQuery] Re: IE Problem with (function($)
Is it possible to have your page published somewhere? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:44 PM, Sagar Arya sagararya...@gmail.com wrote: Hello, Yes I included the jQuery file before the colorpicker.js file. And it works fine in Mozilla and chrome.. but it doesn't turn up in IE. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:03 PM, jQuery Lover ilovejqu...@gmail.com wrote: Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya...@gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; })(); $(EYE.init); })(jQuery); I think that's about the most obfuscated thing I've seen this week. I hope you're doing something cool. Let us know if that helps. On Jan 14, 11:57 pm, Sagar Arya sagararya...@gmail.com wrote: Hello, I tried changing the braces.. It seems they were proper... Here i am attaching all the files... Can anyone help me out pls... its perfectly running in mozilla, chrome.. but not in IE.. :( Cheers ! Sagar On Wed, Jan 14, 2009 at 12:08 PM, Sagar Arya sagararya...@gmail.com wrote: hey thanks so much.. :-) Cheers ! Aryan On Wed, Jan 14, 2009 at 10:26 AM, Karl Swedberg k...@englishrules.comwrote: good eye, Ricardo! thanks for the back up. :-) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:54 PM, Ricardo Tomasi wrote: You're missing a parenthesis when closing the anonymous function: }(); should be })(); And I'm guessing '$' is there for jQuery, so that should actually be })(jQuery); - ricardo On Jan 13, 3:56 pm, Sagar Arya sagararya...@gmail.com wrote: may be i should check with the other files and let you know... thanks for the information.. Cheers ! Aryan On Tue, Jan 13, 2009 at 7:06 PM, Karl Swedberg k...@englishrules.com wrote: I'm not seeing anything obvious. Taking a stab in the dark here ... I've received a similar error in the past when a reference to one of my JavaScript files was resulting in a 404. The browser would try to parse the file as JavaScript, but of course it would be met with a syntax error on line 1. Is it possible that the problem is not with this file, but with another one that you're trying to include? Just a guess. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:35 AM, Aryan wrote: I have a problem with Internet Explorer ( all versions ) . The following is my JQuery Code , which executes perfectly in mozilla and chrome.. But it doesn't work in Internet Explorer. It says : Syntax error ( line 1 )... Can anyone help me out here.. Thanks for your time in reading this. (function($){ var EYE = window.EYE = function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn){ fn.call(); }); }, extend: function(prop) { for (var i in prop) {
[jQuery] Re: .append() into style element causes error in IE only
Hi, Yea, I went for adding a new style element for every new style, which works, but isn't as neat as I was hoping for. I was trying to append a string into the style element: HTML style type=text/css body{color:#333;} /style JS $(style).append(#content{color:#f00;}); In Firefox, this adds #content(color:#f00;} beneath the body declaration. Which is what I would expect to happen. In IE I get an error thrown in jquery-1.3b2.js It may well be that my expectations of append are wrong, if so, it would be a useful thing for me to know as I am quite new to jQuery. Many thanks for your time, Ant Ricardo Tomasi wrote: What are you trying to append? You can only append textnodes to a style element. Why not use the stylesheet object directly: document.styleSheets[0].insertRule(#wrapper {display:none}, 0) // 'addRule' on IE Or, for a hassle-free alternative, create a new style element for it: $('style type=text/css/style').text(myClass).appendTo('head'); On Jan 14, 12:05�pm, Ant kalli...@gmail.com wrote: Hi, I am trying to append css into a pre existing style element. $(style).append(myClass); This works as expected in Firefox, but not IE. The HTML on the page validates to HTML strict, so I'm fairly sure that it's not the issue with IE that append() won't work on incorrectly written elements. If I change my code to $(p).append(myClass); it works as expected. Was just wondering if this is a know issue with IE or jQuery and if anyone had a work around, I am out of ideas that don't involve considerable effort :) Thanks, Ant
[jQuery] Imade fade loop on mouseenter
Hi Guys, I'm having some trouble looping through images by fading one into the next. This is the jQuery $(ul.list li a).bind(mouseenter, function () { var a; var max_img = $(this).children().size(); for(a=0;a=max_img;a++) { $(this).children(img).eq(a).next().fadeIn(3000) } //end of for-loop }); and the html is this ul class=list lia href=# img src=assets/images/portfoliostrip/testimg.gif alt=test width=74 height=42style=display:block; / img src=assets/images/portfoliostrip/testimg1.gif alt=test width=74 height=42 style=display:none; / img src=assets/images/portfoliostrip/testimg2.gif alt=test width=74 height=42 style=display:none; / /a/li /ul These images will be pulled from a database, and I don't know how many there will be. Right now, when I hover over the image, it just fades in the last image in the list. Can anyone explain why this isn't working and maybe post some code that will please. Thanks, Liam
[jQuery] Re: IE Problem with (function($)
Hello,I am very sorry.. I am not supposed to publish the code.. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:28 PM, jQuery Lover ilovejqu...@gmail.com wrote: Is it possible to have your page published somewhere? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:44 PM, Sagar Arya sagararya...@gmail.com wrote: Hello, Yes I included the jQuery file before the colorpicker.js file. And it works fine in Mozilla and chrome.. but it doesn't turn up in IE. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:03 PM, jQuery Lover ilovejqu...@gmail.com wrote: Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya...@gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; })(); $(EYE.init); })(jQuery); I think that's about the most obfuscated thing I've seen this week. I hope you're doing something cool. Let us know if that helps. On Jan 14, 11:57 pm, Sagar Arya sagararya...@gmail.com wrote: Hello, I tried changing the braces.. It seems they were proper... Here i am attaching all the files... Can anyone help me out pls... its perfectly running in mozilla, chrome.. but not in IE.. :( Cheers ! Sagar On Wed, Jan 14, 2009 at 12:08 PM, Sagar Arya sagararya...@gmail.com wrote: hey thanks so much.. :-) Cheers ! Aryan On Wed, Jan 14, 2009 at 10:26 AM, Karl Swedberg k...@englishrules.comwrote: good eye, Ricardo! thanks for the back up. :-) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:54 PM, Ricardo Tomasi wrote: You're missing a parenthesis when closing the anonymous function: }(); should be })(); And I'm guessing '$' is there for jQuery, so that should actually be })(jQuery); - ricardo On Jan 13, 3:56 pm, Sagar Arya sagararya...@gmail.com wrote: may be i should check with the other files and let you know... thanks for the information.. Cheers ! Aryan On Tue, Jan 13, 2009 at 7:06 PM, Karl Swedberg k...@englishrules.com wrote: I'm not seeing anything obvious. Taking a stab in the dark here ... I've received a similar error in the past when a reference to one of my JavaScript files was resulting in a 404. The browser would try to parse the file as JavaScript, but of course it would be met with a syntax error on line 1. Is it possible that the problem is not with this file, but with another one that you're trying to include? Just a guess. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:35 AM, Aryan wrote: I have a problem with Internet Explorer ( all versions ) . The following is my JQuery Code , which executes perfectly in mozilla and chrome.. But it doesn't work in Internet Explorer. It says : Syntax error ( line 1 )... Can anyone help me out here.. Thanks for your time
[jQuery] Re: How best to create Google Calendar functionality in Jquery?
You may also want to check out the jQuery UI selectable plugin. With it you could have a grid of DIVs or a table and with the mouse you can drag a lasso around cells to select and it will highlight them. See here for some demos: http://ui.jquery.com/demos/selectable - Richard On Fri, Jan 9, 2009 at 9:37 AM, jQuery Lover ilovejqu...@gmail.com wrote: jQuery UI already has what you need. First use a container div with bg image of time. Then create a dragable and resizable div that can only be dragged/resized horizontally. Then use jquery.offset() to get where the div's left and right sides are and easily calculate start and end dates. Similar with the vertical time spanning case. jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Jan 9, 2009 at 12:02 PM, Val vagost...@gmail.com wrote: Hi, I'm rather new to Jquery and hope someone can point me in the right direction here. In my current project I need to implement some calendar event functionality (similar to Google Calendar or Mobile Me calendar). In a nutshell, I need to be able to: - Create new div with click and drag - Resize div by clicking on handles (while updating start and end times) - Drag divs to reposition on day grid (while updating new start and end times) I know that JQuery UI offers some basic dragging and resizing, but I've been looking all over for a plug-in or other project that would provide the more advanced calendar functionality of tracking start and end times as a div is moved or resized. I haven't been able to find any such project in Google, however. Can anyone point me in the direction on where to start for this type of thing? Thanks for your help, Val
[jQuery] Re: sortable jQuery 1.3 don't work well
jQuery UI 1.6rc4 is not compatible with jQuery 1.3. You can either grab the svn trunk http://docs.jquery.com/UI/Subversion or wait until tomorrow as 1.6rc5 (which will be compatible with 1.3) is coming today. - Richard On Wed, Jan 14, 2009 at 7:27 PM, Alexsandro_xpt bagul...@gmail.com wrote: Now I'm using the great 1.3 version, but some plugins don't work very well such as Sortable which no trigger update callback if the DOM position has changed and Tab UI which trigger a JS error in Firebug when try access a disabled Tab. And Now What We can do? Thz... Happy birthday jQuery!!! I wish you lot of years and sucess!!!
[jQuery] Re: Form plugin and ui-dialog issue (never submits)
Your issue may be related to the fact the when you call .dialog(), it moves the element it wraps (the dialog content) to the end of the body (no other way to get it to be on top in IE). This trips up some people because they'll turn a part of a form (say a fieldset or a div inside a form) into a dialog and elements will actually be ripped out of the form, breaking the form. I noticed that's not what you're doing below, since you've got a div around your form and you're turning that into a dialog, but that's my best guess. Anyway, I hope that helps you isolate the problem. If you're able to post a full page online, I'd be happy to look at it. Also note, there's a dedicated jQuery UI mailing list: http://groups.google.com/group/jquery-ui - Richard On Wed, Jan 14, 2009 at 3:59 PM, cmulist guru.manda...@gmail.com wrote: I am using the Form plugin to do an ajaxSubmit on a form that contains a file upload. The form submits fine on a regular HTML page, but when I use the form on a dialog (http://docs.jquery.com/UI/Dialog), the form churns and never submits. Relevant code below Form div id=addDocument class=hideElement form id=incidentDocumentForm method=POST enctype=multipart/form-datainput type=hidden name=MAX_FILE_SIZE value=10 / div class=formlblDescription:/div div class=formColinput type=text name=fileDescription id=fileDescription size=30 //div div class=newlinenbsp;/div div class=formlblFile:/div div class=formColinput type=file name=file id=file size=60 //div div class=newline_paranbsp;/div div class=formlblinput type=submit value=Submit id=sd // div /form/div javascript that fires the dialog function addDocument() { $(#addDocument).dialog(close); $(#addDocument).removeClass(hideElement).dialog( {draggable: true, bgiframe: false, resizable: false, title:'Add A Supporting Document', width: 500, height: 280}); } Submit ( ajaxSubmit() ) Code $('form#incidentDocumentForm').submit(function(){ var oldhtml = $('#addDocument').html(); var errorSendingMsg = 'Your document could not be saved. Please try again'; var loadingImgSrc = '${pageContext.request.contextPath}/styles/images/indicator.gif'; var options = { //url: 'ajax.do?serviceName=saveLegalCommentserviceType=xml', url: 'ajax.do', type: 'POST', dataType: 'html', iframe: true, target: '#addDocument', timeout: 1, beforeSubmit: function(formData, jqForm, options) { $('#addDocument').html(div class=\newline_para\nbsp;/div +loadingImgSrc+ ); return true; }, error: function(){ $('#addDocument').html(oldhtml); alert(errorSendingMsg); }, success: function(response){ $(#addDocument).dialog(close); //location.reload(); } }; $(this).ajaxSubmit(options); return false; }); Thoughts?
[jQuery] new fisheye menu ?
hi to all, I'm looking for a fisheye menu that would be integrated in jquery (ui ?). I already know fisheye from Interface. It seems this menu doesn't exist yet. May be someone can tell us more ? regards, f.
[jQuery] Re: Issue upgrading to 1.3
Those aren't nested ids. The comma separates it into two (effectively) separate queries ul#loginSection li#emilyLogin:not(.loggedIn) ul#loginSection li#joeLogin:not(.loggedIn) and should join the results. - Richard On Wed, Jan 14, 2009 at 11:42 PM, James Van Dyke jame...@gmail.com wrote: Try $(#emilyLogin:not(.loggedIn), #joeLogin:not(.loggedIn)).click( function(){} ); I'm thinking that the nested IDs are causing issues that the new selector engine can't handle. Since IDs are supposed to be unique per page, listing a hierarchy is unnecessary. Multiple IDs on a page would violate W3C standards. On Jan 14, 3:32 pm, Joe Morgan thewast...@gmail.com wrote: Hello, When I attempt to upgrade my site from 1.2.6 to 1.3, I get an unresponsive script error that causes my browser (both IE7 and FF3) to hang if the script is not stopped. I've tracked down the bit of script causing the problem: $(ul#loginSection li#emilyLogin:not(.loggedIn), ul#loginSection li#joeLogin:not(.loggedIn)).click( function(){} ); As you can see, the problem exists even when the function defined for the click event is empty, leading me to wonder if it is some problem in the CSS selector that is being used, given the engine changes from 1.2.6 to 1.3. Am I doing something incorrectly? - Joe
[jQuery] Re: jQuery Tabs
jQuery UI 1.6rc4 is not compatible with jQuery 1.3. You can either grab the svn trunk http://docs.jquery.com/UI/Subversion or wait until tomorrow as 1.6rc5 (which will be compatible with 1.3) is coming today. - Richard On Wed, Jan 14, 2009 at 11:30 AM, Eric Garside gars...@gmail.com wrote: Anyone having trouble with getting tab event callbacks to work? I'm on jQuery 1.3 and jQuery UI 1.6rc4 and none of the tab event callbacks are working.
[jQuery] Re: IE Problem with (function($)
Hello, This completely works fine.. How ever it was a v v v v vv simple mistake when i include the .js files... there shouldn't be any spaces between the double() codes.. Eg: style=javascript src== Illegal In IE. ( Really Sucks ! ) style=javascript src= = Legal in FF ( Smooth !) style=javascript src= = Legal In both IE and FF Please make sure that there is no single damn space between double codes.. because the IE sucks more when it sees that.. Thanks a lot for everyone, who helped me realize this... Hof Cheers ! Aryan On Thu, Jan 15, 2009 at 3:44 PM, Sagar Arya sagararya...@gmail.com wrote: Hello,I am very sorry.. I am not supposed to publish the code.. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:28 PM, jQuery Lover ilovejqu...@gmail.comwrote: Is it possible to have your page published somewhere? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:44 PM, Sagar Arya sagararya...@gmail.com wrote: Hello, Yes I included the jQuery file before the colorpicker.js file. And it works fine in Mozilla and chrome.. but it doesn't turn up in IE. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:03 PM, jQuery Lover ilovejqu...@gmail.com wrote: Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya...@gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; })(); $(EYE.init); })(jQuery); I think that's about the most obfuscated thing I've seen this week. I hope you're doing something cool. Let us know if that helps. On Jan 14, 11:57 pm, Sagar Arya sagararya...@gmail.com wrote: Hello, I tried changing the braces.. It seems they were proper... Here i am attaching all the files... Can anyone help me out pls... its perfectly running in mozilla, chrome.. but not in IE.. :( Cheers ! Sagar On Wed, Jan 14, 2009 at 12:08 PM, Sagar Arya sagararya...@gmail.com wrote: hey thanks so much.. :-) Cheers ! Aryan On Wed, Jan 14, 2009 at 10:26 AM, Karl Swedberg k...@englishrules.comwrote: good eye, Ricardo! thanks for the back up. :-) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:54 PM, Ricardo Tomasi wrote: You're missing a parenthesis when closing the anonymous function: }(); should be })(); And I'm guessing '$' is there for jQuery, so that should actually be })(jQuery); - ricardo On Jan 13, 3:56 pm, Sagar Arya sagararya...@gmail.com wrote: may be i should check with the other files and let you know... thanks for the information.. Cheers ! Aryan On Tue, Jan 13, 2009 at 7:06 PM, Karl Swedberg k...@englishrules.com wrote: I'm not seeing anything obvious. Taking a stab in the dark here ... I've received a similar error in the past when a reference to one of my JavaScript files was resulting in a 404. The browser would try to parse the file as JavaScript, but of course it would be met with a syntax error on line 1.
[jQuery] Re: IE Problem with (function($)
Oops.. tat was a mistake.. double quotes i must notice that... :) Those 3 examples are exactly the same? : Nope... notice that there's a small space after the ending double quote.. ( got it ? ) :) tat's where IE sucks ! Cheers ! Aryan On Thu, Jan 15, 2009 at 5:05 PM, Liam Potter radioactiv...@gmail.comwrote: Those 3 examples are exactly the same? Also, they are double quotes, not doube codes. Sagar Arya wrote: Hello, This completely works fine.. How ever it was a v v v v vv simple mistake when i include the .js files... there shouldn't be any spaces between the double() codes.. Eg: style=javascript src== Illegal In IE. ( Really Sucks ! ) style=javascript src= = Legal in FF ( Smooth !) style=javascript src= = Legal In both IE and FF Please make sure that there is no single damn space between double codes.. because the IE sucks more when it sees that.. Thanks a lot for everyone, who helped me realize this... Hof Cheers ! Aryan On Thu, Jan 15, 2009 at 3:44 PM, Sagar Arya sagararya.mv http://sagararya.mv@gmail.com http://gmail.com wrote: Hello, I am very sorry.. I am not supposed to publish the code.. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:28 PM, jQuery Lover ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com wrote: Is it possible to have your page published somewhere? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:44 PM, Sagar Arya sagararya.mv http://sagararya.mv@gmail.com http://gmail.com wrote: Hello, Yes I included the jQuery file before the colorpicker.js file. And it works fine in Mozilla and chrome.. but it doesn't turn up in IE. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:03 PM, jQuery Lover ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com wrote: Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya.mv http://sagararya.mv@gmail.com http://gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com mailto:jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; })(); $(EYE.init); })(jQuery); I think that's about the most obfuscated thing I've seen this week. I hope you're doing something cool. Let us know if that helps. On Jan 14, 11:57 pm, Sagar Arya sagararya...@gmail.com mailto:sagararya...@gmail.com wrote: Hello, I tried changing the braces.. It seems they were proper... Here i am attaching all the files... Can anyone help me out pls... its perfectly running in mozilla, chrome.. but not in IE.. :( Cheers !
[jQuery] Alternative stylesheet for jQuery.com
Any chance of getting an alternative stylesheet added to jquery.com? I've got a small 1024x600 display, and the heading of jquery.com, nice as it is, takes up a lot of space. I'd just like to suggest adding the following as an alternative (using link rel=alternate stylesheet ...) for folk with vertically impaired screens: #jq-secondaryNavigation { margin-top: 4px; } #jq-secondaryNavigation ul, #jq-footerNavigation ul { width: auto; } #jq-siteLogo { top: 14px; } #jq-header { height: 80px; } body#jq-interior #jq-header { height:102px; } #jq-content { padding-top: 1em; } #jq-header h1, #jq-primarySearchForm { bottom: 4px; } At the minute I use greasemonkey to add this, but I thought others may benefit too. Regards - Mark Gibson
[jQuery] Re: IE Problem with (function($)
I see it now, and I also noticed you put it in style tags, you should use script tags script type=text/javascript src= /script That's how you would include a script. Sagar Arya wrote: Oops.. tat was a mistake.. double quotes i must notice that... :) Those 3 examples are exactly the same? : Nope... notice that there's a small space after the ending double quote.. ( got it ? ) :) tat's where IE sucks ! Cheers ! Aryan On Thu, Jan 15, 2009 at 5:05 PM, Liam Potter radioactiv...@gmail.com mailto:radioactiv...@gmail.com wrote: Those 3 examples are exactly the same? Also, they are double quotes, not doube codes. Sagar Arya wrote: Hello, This completely works fine.. How ever it was a v v v v vv simple mistake when i include the .js files... there shouldn't be any spaces between the double() codes.. Eg: style=javascript src== Illegal In IE. ( Really Sucks ! ) style=javascript src= = Legal in FF ( Smooth !) style=javascript src= = Legal In both IE and FF Please make sure that there is no single damn space between double codes.. because the IE sucks more when it sees that.. Thanks a lot for everyone, who helped me realize this... Hof Cheers ! Aryan On Thu, Jan 15, 2009 at 3:44 PM, Sagar Arya sagararya.mv http://sagararya.mv http://sagararya.mv@gmail.com http://gmail.com http://gmail.com wrote: Hello, I am very sorry.. I am not supposed to publish the code.. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:28 PM, jQuery Lover ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com wrote: Is it possible to have your page published somewhere? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:44 PM, Sagar Arya sagararya.mv http://sagararya.mv http://sagararya.mv@gmail.com http://gmail.com http://gmail.com wrote: Hello, Yes I included the jQuery file before the colorpicker.js file. And it works fine in Mozilla and chrome.. but it doesn't turn up in IE. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:03 PM, jQuery Lover ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com wrote: Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya.mv http://sagararya.mv http://sagararya.mv@gmail.com http://gmail.com http://gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com mailto:jame...@gmail.com mailto:jame...@gmail.com mailto:jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] =
[jQuery] Re: Alternative stylesheet for jQuery.com
you should give stylish a try to do client side CSS changes rather then greasemonkey. https://addons.mozilla.org/en-US/firefox/addon/2108 Mark Gibson wrote: Any chance of getting an alternative stylesheet added to jquery.com? I've got a small 1024x600 display, and the heading of jquery.com, nice as it is, takes up a lot of space. I'd just like to suggest adding the following as an alternative (using link rel=alternate stylesheet ...) for folk with vertically impaired screens: #jq-secondaryNavigation { margin-top: 4px; } #jq-secondaryNavigation ul, #jq-footerNavigation ul { width: auto; } #jq-siteLogo { top: 14px; } #jq-header { height: 80px; } body#jq-interior #jq-header { height:102px; } #jq-content { padding-top: 1em; } #jq-header h1, #jq-primarySearchForm { bottom: 4px; } At the minute I use greasemonkey to add this, but I thought others may benefit too. Regards - Mark Gibson
[jQuery] Re: IE Problem with (function($)
Those 3 examples are exactly the same? Also, they are double quotes, not doube codes. Sagar Arya wrote: Hello, This completely works fine.. How ever it was a v v v v vv simple mistake when i include the .js files... there shouldn't be any spaces between the double() codes.. Eg: style=javascript src== Illegal In IE. ( Really Sucks ! ) style=javascript src= = Legal in FF ( Smooth !) style=javascript src= = Legal In both IE and FF Please make sure that there is no single damn space between double codes.. because the IE sucks more when it sees that.. Thanks a lot for everyone, who helped me realize this... Hof Cheers ! Aryan On Thu, Jan 15, 2009 at 3:44 PM, Sagar Arya sagararya.mv http://sagararya.mv@gmail.com http://gmail.com wrote: Hello, I am very sorry.. I am not supposed to publish the code.. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:28 PM, jQuery Lover ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com wrote: Is it possible to have your page published somewhere? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:44 PM, Sagar Arya sagararya.mv http://sagararya.mv@gmail.com http://gmail.com wrote: Hello, Yes I included the jQuery file before the colorpicker.js file. And it works fine in Mozilla and chrome.. but it doesn't turn up in IE. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:03 PM, jQuery Lover ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com wrote: Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya.mv http://sagararya.mv@gmail.com http://gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com mailto:jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; })(); $(EYE.init); })(jQuery); I think that's about the most obfuscated thing I've seen this week. I hope you're doing something cool. Let us know if that helps. On Jan 14, 11:57 pm, Sagar Arya sagararya...@gmail.com mailto:sagararya...@gmail.com wrote: Hello, I tried changing the braces.. It seems they were proper... Here i am attaching all the files... Can anyone help me out pls... its perfectly running in mozilla, chrome.. but not in IE.. :( Cheers ! Sagar On Wed, Jan 14, 2009 at 12:08 PM, Sagar Arya sagararya...@gmail.com mailto:sagararya...@gmail.com wrote: hey thanks so much.. :-) Cheers ! Aryan On Wed, Jan 14, 2009 at 10:26 AM, Karl Swedberg
[jQuery] propagation in 1.3
First of all, thanks to all jQuery members for the new release! is a great gift! With this release, one of the main features is the new event propagation logic. As I can understand, it seems that, for example, if I have a div(inside) inside other div(outside) and I attach a click event to the inside div. The outside div will trigger it's events too... and it's parent, parent of the parent, etc until it reach the body element. Is this ok? If this is the logic, then maybe there is a little overhead on the browser for a simple event attachment on the most inner div if there is no need for this propagation (to work like 1.2.6 I mean)... or not? Thanks to all!
[jQuery] Re: IE Problem with (function($)
Geees.. script type=text/javascript src= /script Cheers ! Aryan On Thu, Jan 15, 2009 at 5:19 PM, Liam Potter radioactiv...@gmail.comwrote: I see it now, and I also noticed you put it in style tags, you should use script tags script type=text/javascript src= /script That's how you would include a script. Sagar Arya wrote: Oops.. tat was a mistake.. double quotes i must notice that... :) Those 3 examples are exactly the same? : Nope... notice that there's a small space after the ending double quote.. ( got it ? ) :) tat's where IE sucks ! Cheers ! Aryan On Thu, Jan 15, 2009 at 5:05 PM, Liam Potter radioactiv...@gmail.commailto: radioactiv...@gmail.com wrote: Those 3 examples are exactly the same? Also, they are double quotes, not doube codes. Sagar Arya wrote: Hello, This completely works fine.. How ever it was a v v v v vv simple mistake when i include the .js files... there shouldn't be any spaces between the double() codes.. Eg: style=javascript src== Illegal In IE. ( Really Sucks ! ) style=javascript src= = Legal in FF ( Smooth !) style=javascript src= = Legal In both IE and FF Please make sure that there is no single damn space between double codes.. because the IE sucks more when it sees that.. Thanks a lot for everyone, who helped me realize this... Hof Cheers ! Aryan On Thu, Jan 15, 2009 at 3:44 PM, Sagar Arya sagararya.mv http://sagararya.mv http://sagararya.mv@gmail.com http://gmail.com http://gmail.com wrote: Hello, I am very sorry.. I am not supposed to publish the code.. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:28 PM, jQuery Lover ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com wrote: Is it possible to have your page published somewhere? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:44 PM, Sagar Arya sagararya.mv http://sagararya.mv http://sagararya.mv@gmail.com http://gmail.com http://gmail.com wrote: Hello, Yes I included the jQuery file before the colorpicker.js file. And it works fine in Mozilla and chrome.. but it doesn't turn up in IE. Cheers ! Sagar On Thu, Jan 15, 2009 at 3:03 PM, jQuery Lover ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com mailto:ilovejqu...@gmail.com wrote: Well, it says jQuery is undefined. Have you put your jquery.js file before colorpicker.js ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 2:27 PM, Sagar Arya sagararya.mv http://sagararya.mv http://sagararya.mv@gmail.com http://gmail.com http://gmail.com wrote: Hello, It doesn't seem to work even after adding the braces. It works fine in mozzila but the same syntax error in IE. ( IE suck more ! )... I have attached the screen shots.. Cheers ! Aryan On Thu, Jan 15, 2009 at 10:44 AM, James Van Dyke jame...@gmail.com mailto:jame...@gmail.com mailto:jame...@gmail.com mailto:jame...@gmail.com wrote: The initial (function($) { was never closed. Here's how I formatted it so everything lines up: (function($){ var EYE = window.EYE = (function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn) { fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] !=
[jQuery] Re: To check if an element value is of a particular class type
thanks Ricardo for the genuine help On Jan 13, 8:16 pm, Ricardo Tomasi ricardob...@gmail.com wrote: $('.emailSuffix').click(function(){ var field = $('#element'); if(field.val() == 'something'){ //ok } else { //not ok } }); On Jan 13, 7:39 am, Santo pujari.sant...@gmail.com wrote: Hello All This is what I am trying to do. I have defined an email suffix class for a particular textboxelementso that it accepts values for that particular class. Whenever there is a different value inserted, it displays a jquery error. Now, there also is an Add button which should add the value and display it in a widget listifit is a valid value. So, I need tocheckand insert anifelse block on the click event of the add button tocheckifthe value inserted in the textbox is a valid email suffix type. How do Icheckthat something like if($(#element_id).val.className == emailSuffix) { ... } else { ... }
[jQuery] Re: sortable jQuery 1.3 don't work well
Thanks Richard Worth, I will wating for. Thz.. On 15 jan, 08:30, Richard D. Worth rdwo...@gmail.com wrote: jQuery UI 1.6rc4 is not compatible with jQuery 1.3. You can either grab the svn trunk http://docs.jquery.com/UI/Subversion or wait until tomorrow as 1.6rc5 (which will be compatible with 1.3) is coming today. - Richard On Wed, Jan 14, 2009 at 7:27 PM, Alexsandro_xpt bagul...@gmail.com wrote: Now I'm using the great 1.3 version, but some plugins don't work very well such as Sortable which no trigger update callback if the DOM position has changed and Tab UI which trigger a JS error in Firebug when try access a disabled Tab. And Now What We can do? Thz... Happy birthday jQuery!!! I wish you lot of years and sucess!!!
[jQuery] Re: To check if an element value is of a particular class type
thanks a lot MorningZ... will check and get back to you... On Jan 13, 9:05 pm, MorningZ morni...@gmail.com wrote: Your problem isn't very clear but regardless, there is a .hasClass function http://docs.jquery.com/Attributes/hasClass#class so $(#element_id).hasClass(emailSuffix) would give you true/false . . . On Jan 13, 4:39 am, Santo pujari.sant...@gmail.com wrote: Hello All This is what I am trying to do. I have defined an email suffix class for a particular textboxelementso that it accepts values for that particular class. Whenever there is a different value inserted, it displays a jquery error. Now, there also is an Add button which should add the value and display it in a widget listifit is a valid value. So, I need tocheckand insert anifelse block on the click event of the add button tocheckifthe value inserted in the textbox is a valid email suffix type. How do Icheckthat something like if($(#element_id).val.className == emailSuffix) { ... } else { ... }
[jQuery] Re: blockUI - Bug overlapping fixed elements
Hey, Yea I can, its my private test site so its all still really unstable but it shows the bug: http://www.new.fetchmp3.com/dev/search.php?q=Fall+Out+Boy user: admin pass: google123 Once its loaded change to the myspace tab and you will see that the overlay overlaps the bar at the bottom... is there anyway around this? (Note ive commented out the unblock function so the element stays blocked for debugging) Thanks for any help! --Sam On Jan 14, 12:55 am, Mike Alsup mal...@gmail.com wrote: There seems to be a bug that when you have a fixed element attached to the bottom of the window and then try to block an element that goes below the bottom of the window (scrolls) it overlaps onto the fixed element.. its easier to show a picture:http://i44.tinypic.com/2z4wocn.jpg Any ideas as to how I could resolve this? --Sam Sam, could you post a link?
[jQuery] Re: Imade fade loop on mouseenter
Ok, so now I know it's just the loop isn't waiting for the fadeIn animation to complete before moving on. I'm trying to use a setTimeout, but I can't put this into a function because when I do $(this) no longer relates to what I need it to. I tried changing it to this function doThis() { var current = 0; var max_img = $(this).children().size(); for(current=1;current=max_img;current++) { setTimeout(doThis,3000); $(ul.list li a).children(img).eq(current).fadeIn(fSpeed, function () { }) } //end of for-loop } doThis(); but then it doesn't even run.. This is rather urgent and I'm really strugling here, so if anyone has any suggestions, please suggest away. - Liam Liam Potter wrote: I've just taken another look and it is actually fading the rest of the images, all at the same time. It seems to me the loop is running, but doesn't wait for the first image to finish fading, would using setTimeout doing anything? evo wrote: Hi Guys, I'm having some trouble looping through images by fading one into the next. This is the jQuery $(ul.list li a).bind(mouseenter, function () { var a; var max_img = $(this).children().size(); for(a=0;a=max_img;a++) { $(this).children(img).eq(a).next().fadeIn(3000) } //end of for-loop }); and the html is this ul class=list lia href=# img src=assets/images/portfoliostrip/testimg.gif alt=test width=74 height=42style=display:block; / img src=assets/images/portfoliostrip/testimg1.gif alt=test width=74 height=42 style=display:none; / img src=assets/images/portfoliostrip/testimg2.gif alt=test width=74 height=42 style=display:none; / /a/li /ul These images will be pulled from a database, and I don't know how many there will be. Right now, when I hover over the image, it just fades in the last image in the list. Can anyone explain why this isn't working and maybe post some code that will please. Thanks, Liam
[jQuery] Re: Imade fade loop on mouseenter
I've just taken another look and it is actually fading the rest of the images, all at the same time. It seems to me the loop is running, but doesn't wait for the first image to finish fading, would using setTimeout doing anything? evo wrote: Hi Guys, I'm having some trouble looping through images by fading one into the next. This is the jQuery $(ul.list li a).bind(mouseenter, function () { var a; var max_img = $(this).children().size(); for(a=0;a=max_img;a++) { $(this).children(img).eq(a).next().fadeIn(3000) } //end of for-loop }); and the html is this ul class=list lia href=# img src=assets/images/portfoliostrip/testimg.gif alt=test width=74 height=42style=display:block; / img src=assets/images/portfoliostrip/testimg1.gif alt=test width=74 height=42 style=display:none; / img src=assets/images/portfoliostrip/testimg2.gif alt=test width=74 height=42 style=display:none; / /a/li /ul These images will be pulled from a database, and I don't know how many there will be. Right now, when I hover over the image, it just fades in the last image in the list. Can anyone explain why this isn't working and maybe post some code that will please. Thanks, Liam
[jQuery] Re: Jeditable submitting to function question
On Jan 13, 2009, at 9:56 AM, Rhys M wrote: just continues on. I can't seem to figure out a way to get the function to wait for the Ajax function to return and then in the callback somehow pass the value to the original function that Jeditable is expecting the return value from. Take the following code for example: Sorry it took a while. Was having a vacation. Have you tried setting the ajaxrequest to be synchronous with: async : false in Ajax options? -- Mika Tuupola http://www.appelsiini.net/
[jQuery] datepicker is not a function
$('.Datepicker1').datepicker({beforeShow: customRange, rangeSelect: true, numberOfMonths: 2}); function customRange(input) { return { minDate: (input.id == startDatepicker ? $ (#endDatepicker).datepick(getDate) : null), maxDate: (input.id == endDatepicker ? $ (#startDatepicker).datepick(getDate) : null) }; } pstartDate: input type=text id=startDatepicker class = Datepicker1/p pendDate: input type=text id=endDatepicker class = Datepicker1/p
[jQuery] tablesorter
Hi, If my table contains near about 1 rows, because of tablesorter plugging the page is getting hanged in Firefox2. I didn't check in other browser as it must be fixed in FF first. And I have no idea how to debug or solve the problem. Anybody faced the problem before?
[jQuery] Show element inside this
Hi, is there some easy way to make something like this: $(document).ready(function() { $(.track).mouseover(function(){ $(.track .label).show(1000); }); }); but only for each child element separately? I mean something like this: $(document).ready(function() { $(.track).mouseover(function(){ $(this .label).show(1000); }); }); Thanks for answers and tips.
[jQuery] namespacing events
Hi, I have problems with namespacing my events. When I use something like my.event everything works fine, but if I have my.event.a and my.event.b, both events are bound to my.event. Is this a bug or a special feature? my test code: JavaScript: var trigger = 0; var clicked = 0; $().bind(my.event.a, function() { $(#trigger).text(++trigger); }); $(#button).click(function(){ $().trigger(my.event.a); $().trigger(my.event.b); $().trigger(my.event.c); $(#click).text(++clicked); }); HTML: pTrigger Count: span id=trigger0/span/p pButton Clicked: span id=click0/span/p button id=buttontrigger/button When you press the button, clicked is increased by 1, but trigger is increased by 3. by(e) Stephan
[jQuery] Re: jQuery 1.3 Released
nice one, a 30% speed increase on selectors is impressive.
[jQuery] quick note about cross domain getScript function
Hi, A note about 1.3; I still need to do this http://groups.google.com/group/jquery-en/msg/996ace3956f70102 to get $.getScript or $.ajax to call the `complete' callback when `dataType' is script and I'm doing cross-domain requests. (i cba. registering at a bug-tracker)
[jQuery] Wordpress using jQuery problem
Hello, i noticed on IE6 that some widgets disappear when clicking the edit link of some widgets like the RSS and Text widgets. Now, i am not seeking support for wordpress it's self but after i traced the code: var addWidgetControls = function( context ) { if ( !context ) context = document; $('a.widget-control-edit', context).click( editClick ); // onclick for save links $('a.widget-control-save', context).click( function() { EndTime = new Date(); var diff = EndTime.getTime() - StartTime.getTime(); alert(diff); toggleWidget( $(this).parents('li:first'), false ).blur() return false; } ); // onclick for remove links $('a.widget-control-remove', context).click( function() { var w = $(this).parents('li:first').find('input [...@name^=widget-id]').val(); $(this).parents('li:first').remove(); var t = $('#widget-list ul#widget-control-info-' + w + ' textarea'); t.parent().html( t.text() ).parents('li.widget-list- item:first').children( 'h4' ).children('a.widget-action') .show().text( widgetsL10n.add ).unbind().click ( addClick ); var n = parseInt( $('#widget-count').text(), 10 ) - 1; $('#widget-count').text( n.toString() ) return false; } ); } the edit event is called, and then the save and remove are executed after the edit code finishes execution immediately which results in the disappearance of the widget. Can someone comment on this part and help me get some idea about why this is happening? on this post on wordpress's Trac a member commented as follows: [COMMENT] This is in general true for all multiwidgets (RSS, Categories...). I have no idea what's going on here. I can tell you what's happening, but not why. When you click the Edit link, the edit.click action is fired (good), then the save.click action is fired (bad), then the remove.click action is fired (bad). Internet explorer is applying the click bindings on source:/trunk/wp- admin/js/widgets...@7628#l98 and source:/trunk/wp-admin/js/ widgets...@7628#l104 to a.widget-control-edit rather than a.widget- control-save and a.widget-control-remove, respectively. [/COMMENT]
[jQuery] How get data objects from a php file called via ajax
I am new to javascript and jQuery programming so my problem might be very simple to explain but please bare with me. I want to make a selection in a list created by a php-file that is called from another php-file using jQuery and ajax but it fails. My example is very limited but shows the main problem. The first php-file has abutton defined like this: input class=mini_browse type=button value=Browse test / I also have a div to show the result: div id=myresultShow the result here/div The jQuery entry looks like this: jQuery(document).ready(function($) { $('.mini_browse').bind(click, function() { $.ajax({ type: get, url: test-ajax.php, data: { action: 'test' }, error: function() {$(#myresult).html(Ajax error);}, success: function(html){ //so, if data is retrieved, store it in html $(#myresult).html(html); } }); //close jQuery.ajax return false; }); }); When I click the button I get a call to test-ajax.php as expected and the output is displayed in the myresult div but not as expected. The test-ajax.php executes this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; The button is not displayed as a button but like an input text with the text Select in it and I can not get a click event from it. I can not see the output from test-ajax.php when I view the page source so I guess that I have to get it included in the document somehow but how? Can anybody point me in the right direction to solve this? Thanks!
[jQuery] Re: [ TR.click not work in Firefox]
Try this : function inicializarEventos() { var x; x=$(tr); x.click(presionFila); } function presionFila() { var x; x=$(this); x.css(background-color,ee); } var x; x=$(document); x.ready(inicializarEventos); With Regards, Chandan Luthra Intelligrape Software Pvt. Ltd. www.intelligrape.com On Thu, Jan 15, 2009 at 2:28 PM, Mauricio (Maujor) Samy Silva css.mau...@gmail.com wrote: Hi Gustavo, Doesn't work because there is a missed # in the color sintax pay attention here = x.css(background-color,#ee); Maurcício -Mensagem Original- *De:* Lord Gustavo Miguel Angel goosfanc...@gmail.com *Para:* jQuery (English) jquery-en@googlegroups.com *Enviada em:* quarta-feira, 14 de janeiro de 2009 21:15 *Assunto:* [jQuery] [ TR.click not work in Firefox] hi, Look this do not work in firefox, in IE yes. why? Thank´s -- index.html - !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script language=javascript type=text/javascript src=jvs/jquery-1.2.6.js /script script language=javascript type=text/javascript src=jvs/funciones.js/script titleDocumento sin tiacute;tulo/title /head body table width=200 border=1 tr tdt1 c1/td tdt1 c2/td tdt1 c3/td /tr tr tdt2 c1/td tdt2 c2/td tdt2 c3/td /tr tr tdt3 c1/td tdt3 c2/td tdt3 c3/td /tr /table /body /html EOF --- -funciones.js--- // JavaScript Document var x; x=$(document); x.ready(inicializarEventos); function inicializarEventos() { var x; x=$(tr); x.click(presionFila); } function presionFila() { var x; x=$(this); x.css(background-color,ee); } - EOF
[jQuery] Re: tablesorter
I think for tables this big you probably need to do the sorting server side instead of client side. So personally, I'd have the sorting re-request the page with a parameter of say orderby=name and then present the page accordingly. On Thu, Jan 15, 2009 at 1:20 PM, dyutiman dyutiman.chaudh...@gmail.com wrote: Hi, If my table contains near about 1 rows, because of tablesorter plugging the page is getting hanged in Firefox2. I didn't check in other browser as it must be fixed in FF first. And I have no idea how to debug or solve the problem. Anybody faced the problem before?
[jQuery] Re: Show element inside this
I'm not sure what are you trying to do but try: $(this).children(.label).show(1000); Maurício -Mensagem Original- De: eXistent pirkl.lu...@gmail.com Para: jQuery (English) jquery-en@googlegroups.com Enviada em: quinta-feira, 15 de janeiro de 2009 07:58 Assunto: [jQuery] Show element inside this Hi, is there some easy way to make something like this: $(document).ready(function() { $(.track).mouseover(function(){ $(.track .label).show(1000); }); }); but only for each child element separately? I mean something like this: $(document).ready(function() { $(.track).mouseover(function(){ $(this .label).show(1000); }); }); Thanks for answers and tips.
[jQuery] Re: propagation in 1.3
The propagation was only added to fake events, that is, those generated by calling $(...).trigger(); Real events were already bubbling (propagating) natively. We only normalized event bubbling for all events, by adding it to our fake events. You can always stop the propagation by calling event.stopPropagation (), returning false or using triggerHandler. -- Ariel Flesler http://flesler.blogspot.com On Jan 15, 10:02 am, Javier Martinez ecentin...@gmail.com wrote: First of all, thanks to all jQuery members for the new release! is a great gift! With this release, one of the main features is the new event propagation logic. As I can understand, it seems that, for example, if I have a div(inside) inside other div(outside) and I attach a click event to the inside div. The outside div will trigger it's events too... and it's parent, parent of the parent, etc until it reach the body element. Is this ok? If this is the logic, then maybe there is a little overhead on the browser for a simple event attachment on the most inner div if there is no need for this propagation (to work like 1.2.6 I mean)... or not? Thanks to all!
[jQuery] Re: Safely Extend Native Objects
Basically, because of the Object type. Extension of native objects is done in javascript through the prototype method. This adds functionality to each native object, allowing you to do things like: .trim() The problem arises with the Object native. This encompasses a large portion of the structures (all objects, classes, arrays, etc) in Javascript, and cannot be prototyped easily. The reason being, if you do something like: Object.prototype.myMethod = function(){ alert('Foo'); } You can no longer iterate through the object safely. Now: var a = {a:1,b:2,c:3}; $.each(a, function(key){ alert(key) }); // a,b,c,myMethod Also, keeping jQuery in the global namespace helps prevent conflict with libraries who go directly for native extension, like prototype.js On Jan 14, 8:19 pm, atwork8 atwo...@hotmail.co.uk wrote: First post on here so hello everybody :o) I've been looking at different javascript libraries for a while now to see what one suits best. The 2 I'm interested in are jQuery and mooTools. I've been messing with both and I really like them, however, the way they get the job done is completely different. I have to admit, I prefer the mooTools syntax as it is how javascript intended e.g. lots of spaces before and after .trim(); //mooTools $.trim( lots of spaces before and after ); //jQuery But I hate how it pollutes and extends native objects, as it has caused us problems in the past with other scripts. Now jQuery's one global symbol method is excellent and stops all the compatibility problems with other scripts, which is why I think we'll be going with jQuery. So my question is this, why doesn't jQuery apply the same compatibility method to Native types (exc Object) as it does to the global namespace? e.g. var natives = { extend: function(sType,sAlias) { for(var e in this[sType]) { String.prototype[sAlias + e] = this[sType][e]; } }, 'String': { trim: function() { return (this || ).replace(/^\s+|\s+$/g,); }, repeat: function(iCount) { for(var i = 0,str = '';i iCount;i++) { str += this; } return str }, format: function() { var a = arguments,i = -1; return this.replace(/#/g,function() { return a[+ +i] }); } }, 'Array': { //extend array }, 'Date': { //extend date } //bla bla bla } natives.extend('String','$'); alert(' lots of spaces before and after '.$trim()); alert('I love you ' + 'x'.$repeat(5)); alert('hi #, want to go to the ##'.$format('John','foo','bar')); In terms of the global namespace it's a tried and tested method so I'm sure it could work on Natives too, plus, it would mean jQuery javascript is more like javascript. It would be good to get some feedback on why this sort of thing isn't employed. Thanks, Reiss
[jQuery] Re: tablesorter
It's 100% unrealistic to expect to run something like TableSorter on the client side for 10,000 rows of data what user is really going to see/use that much data at once? look into paging the data and make the UI more usable On Jan 15, 8:20 am, dyutiman dyutiman.chaudh...@gmail.com wrote: Hi, If my table contains near about 1 rows, because of tablesorter plugging the page is getting hanged in Firefox2. I didn't check in other browser as it must be fixed in FF first. And I have no idea how to debug or solve the problem. Anybody faced the problem before?
[jQuery] Re: Alternative stylesheet for jQuery.com
Ah, fantastic, works much better than Greasemonkey, thanks for the link. The only trouble with FF Add-ons is there are so many of them! On Jan 15, 11:52 am, Liam Potter radioactiv...@gmail.com wrote: you should give stylish a try to do client side CSS changes rather then greasemonkey.https://addons.mozilla.org/en-US/firefox/addon/2108 Mark Gibson wrote: Any chance of getting an alternative stylesheet added to jquery.com? I've got a small 1024x600 display, and the heading of jquery.com, nice as it is, takes up a lot of space. I'd just like to suggest adding the following as an alternative (using link rel=alternate stylesheet ...) for folk with vertically impaired screens: At the minute I use greasemonkey to add this, but I thought others may benefit too. Regards - Mark Gibson
[jQuery] Re: Possible 1.3 bug
I'm having the same problem. Has anyone overcome this yet? It sounds like we're using a selector that is no longer supported in jQuery 1.3. But which On Jan 15, 7:39 am, emmj...@gmail.com emmj...@gmail.com wrote: I was checking all of my random plugins/scripts to make sure they all work with jQuery 1.3 and I found one that is having problems. An example of it is available at:http://digitalinferno.net/temp/ If you enter some text into the input firebug will report that filter is not a function in http://digitalinferno.net/temp/js/jquery.json line 1961 Anyone know if this is a bug or if I have to change something in my code for the new 1.3 release?
[jQuery] Re: How get data objects from a php file called via ajax
Try fixing your html in the php code like this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; You forgot to close that class property in the input. On Thu, Jan 15, 2009 at 12:12 PM, Mikael mhedeng...@gmail.com wrote: I am new to javascript and jQuery programming so my problem might be very simple to explain but please bare with me. I want to make a selection in a list created by a php-file that is called from another php-file using jQuery and ajax but it fails. My example is very limited but shows the main problem. The first php-file has abutton defined like this: input class=mini_browse type=button value=Browse test / I also have a div to show the result: div id=myresultShow the result here/div The jQuery entry looks like this: jQuery(document).ready(function($) { $('.mini_browse').bind(click, function() { $.ajax({ type: get, url: test-ajax.php, data: { action: 'test' }, error: function() {$(#myresult).html(Ajax error);}, success: function(html){ //so, if data is retrieved, store it in html $(#myresult).html(html); } }); //close jQuery.ajax return false; }); }); When I click the button I get a call to test-ajax.php as expected and the output is displayed in the myresult div but not as expected. The test-ajax.php executes this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; The button is not displayed as a button but like an input text with the text Select in it and I can not get a click event from it. I can not see the output from test-ajax.php when I view the page source so I guess that I have to get it included in the document somehow but how? Can anybody point me in the right direction to solve this? Thanks!
[jQuery] Re: jQuery Tabs
Ah, thanks. :) On Jan 15, 5:23 am, Richard D. Worth rdwo...@gmail.com wrote: jQuery UI 1.6rc4 is not compatible with jQuery 1.3. You can either grab the svn trunk http://docs.jquery.com/UI/Subversion or wait until tomorrow as 1.6rc5 (which will be compatible with 1.3) is coming today. - Richard On Wed, Jan 14, 2009 at 11:30 AM, Eric Garside gars...@gmail.com wrote: Anyone having trouble with getting tab event callbacks to work? I'm on jQuery 1.3 and jQuery UI 1.6rc4 and none of the tab event callbacks are working.
[jQuery] Re: Possible 1.3 bug
FYI. I found my offending code. It's a combination of these selectors: :text, :password, :file, :select, :button I just can't figure out why! On Jan 15, 7:39 am, emmj...@gmail.com emmj...@gmail.com wrote: I was checking all of my random plugins/scripts to make sure they all work with jQuery 1.3 and I found one that is having problems. An example of it is available at:http://digitalinferno.net/temp/ If you enter some text into the input firebug will report that filter is not a function in http://digitalinferno.net/temp/js/jquery.json line 1961 Anyone know if this is a bug or if I have to change something in my code for the new 1.3 release?
[jQuery] ajax :: how to load script
hello community, i've got a textfield and a searchbutton. a click on the searchbutton schould execute the following java script which will return some data to a callbackfunction called showmyvideos: $('#searchButton').click(function() { var url = 'http://gdata.youtube.com/feeds/api/videos?q=' + $('#searchText').val() + 'alt=json-in-scriptcallback=showMyVideosmax-results=7format=5'; // ajax functions to call $.ajax, $.load, $.get, $.post EXECUTE('script type=text/javascript src=' + url + '/ script'); }); my problem is: how do i execute this java script line to get the data. this loading must happen without reloading the whole page. is this possible with jquerys ajax plugin? thanks a lot in advance! dirk
[jQuery] Re: Form plugin and ui-dialog issue (never submits)
The form that is turned into a dialog is a separate form at the end of the main form. Relevant code below. It seems the combination of dialog + File element + Form plugin (ajaxSubmit() or ajaxForm() ) is a no-go. The ajaxSubmit() works fine when there is no FILE element OR the form is moved out of the dialog. Haven't been able to exactly diagnose where the issue is, but I keep getting timed out on ajaxSubmit () when it has a FILE element in a dialog. div class=content form name=partBForm id=partBForm method=post action=/ qualityconnect/submitPartB.do input type=hidden name=incidentId value=15656 id=incidentId div class=formColtextarea name=investigationDesc cols=90 rows=6 id=investigationDescde/textarea/div div class=formlbla href=javascript:void(0); onclick=addDocument(); class=linkbAdd a Supporting Document/b/a/div /form /div div id=addDocument class=hideElement form id=incidentDocumentForm enctype=multipart/form-data action=incidentDocument.doinput type=hidden name=incidentId value=15656 /input type=hidden name=MAX_FILE_SIZE value=10 / input div class=formlblfont color=whitebFile:/b/font/div div class=formColinput type=file name=file1 id=file1 size=50 //div div class=formlblinput type=submit value=Submit id=sd // div /form /div /div /body /html On Jan 15, 5:43 am, Richard D. Worth rdwo...@gmail.com wrote: Your issue may be related to the fact the when you call .dialog(), it moves the element it wraps (the dialog content) to the end of the body (no other way to get it to be on top in IE). This trips up some people because they'll turn a part of a form (say a fieldset or a div inside a form) into a dialog and elements will actually be ripped out of the form, breaking the form. I noticed that's not what you're doing below, since you've got a div around your form and you're turning that into a dialog, but that's my best guess. Anyway, I hope that helps you isolate the problem. If you're able to post a full page online, I'd be happy to look at it. Also note, there's a dedicated jQuery UI mailing list: http://groups.google.com/group/jquery-ui - Richard On Wed, Jan 14, 2009 at 3:59 PM, cmulist guru.manda...@gmail.com wrote: I am using the Form plugin to do an ajaxSubmit on a form that contains a file upload. The form submits fine on a regular HTML page, but when I use the form on a dialog (http://docs.jquery.com/UI/Dialog), the form churns and never submits. Relevant code below Form div id=addDocument class=hideElement form id=incidentDocumentForm method=POST enctype=multipart/form-datainput type=hidden name=MAX_FILE_SIZE value=10 / div class=formlblDescription:/div div class=formColinput type=text name=fileDescription id=fileDescription size=30 //div div class=newlinenbsp;/div div class=formlblFile:/div div class=formColinput type=file name=file id=file size=60 //div div class=newline_paranbsp;/div div class=formlblinput type=submit value=Submit id=sd // div /form/div javascript that fires the dialog function addDocument() { $(#addDocument).dialog(close); $(#addDocument).removeClass(hideElement).dialog( {draggable: true, bgiframe: false, resizable: false, title:'Add A Supporting Document', width: 500, height: 280}); } Submit ( ajaxSubmit() ) Code $('form#incidentDocumentForm').submit(function(){ var oldhtml = $('#addDocument').html(); var errorSendingMsg = 'Your document could not be saved. Please try again'; var loadingImgSrc = '${pageContext.request.contextPath}/styles/images/indicator.gif'; var options = { //url: 'ajax.do?serviceName=saveLegalCommentserviceType=xml', url: 'ajax.do', type: 'POST', dataType: 'html', iframe: true, target: '#addDocument', timeout: 1, beforeSubmit: function(formData, jqForm, options) { $('#addDocument').html(div class=\newline_para\nbsp;/div +loadingImgSrc+ ); return true; }, error: function(){ $('#addDocument').html(oldhtml); alert(errorSendingMsg); }, success: function(response){ $(#addDocument).dialog(close); //location.reload(); } }; $(this).ajaxSubmit(options); return false; }); Thoughts?
[jQuery] Re: Show element inside this
Looks like maybe you want $(.label, this).show(1000) or (nearly equivalent) $(this).find(.label).show(1000) - Richard On Thu, Jan 15, 2009 at 4:58 AM, eXistent pirkl.lu...@gmail.com wrote: Hi, is there some easy way to make something like this: $(document).ready(function() { $(.track).mouseover(function(){ $(.track .label).show(1000); }); }); but only for each child element separately? I mean something like this: $(document).ready(function() { $(.track).mouseover(function(){ $(this .label).show(1000); }); }); Thanks for answers and tips.
[jQuery] Re: ajax :: how to load script
The simple solution would be to use $.getScript(url, callback). However, know that if you insert HTML anywhere in the page using jQuery, it will search for and execute any script tags in that HTML automatically. For example: $.get('/my/url/with/html_and_jscript.html', function(data) { $(#element).html(data); }); This will place any text returned from the request into #element, but will also scan for and execute any script tags in that returned data. Hope that helps. On Jan 15, 9:41 am, dirk w dirkwendl...@googlemail.com wrote: hello community, i've got a textfield and a searchbutton. a click on the searchbutton schould execute the following java script which will return some data to a callbackfunction called showmyvideos: $('#searchButton').click(function() { var url = 'http://gdata.youtube.com/feeds/api/videos?q='+ $('#searchText').val() + 'alt=json-in-scriptcallback=showMyVideosmax-results=7format=5'; // ajax functions to call $.ajax, $.load, $.get, $.post EXECUTE('script type=text/javascript src=' + url + '/ script'); }); my problem is: how do i execute this java script line to get the data. this loading must happen without reloading the whole page. is this possible with jquerys ajax plugin? thanks a lot in advance! dirk
[jQuery] Re: datepicker is not a function
Which javascript files have you included? And have you verified (perhaps using Firebug) that the paths are valid and they are being loaded? Also, the order is significant. They should be loaded in this order jquery.js ui.core.js ui.datepicker.js - Richard On Thu, Jan 15, 2009 at 4:24 AM, divsystem divsys...@gmail.com wrote: $('.Datepicker1').datepicker({beforeShow: customRange, rangeSelect: true, numberOfMonths: 2}); function customRange(input) { return { minDate: (input.id == startDatepicker ? $ (#endDatepicker).datepick(getDate) : null), maxDate: (input.id == endDatepicker ? $ (#startDatepicker).datepick(getDate) : null) }; } pstartDate: input type=text id=startDatepicker class = Datepicker1/p pendDate: input type=text id=endDatepicker class = Datepicker1/p
[jQuery] Loop doesn't wait for fadeIn
Hi Guys I'm trying to loop through images contained in a li tag. HTML is this ul class=list lia href=# img src=assets/images/portfoliostrip/testimg.gif alt=test width=74 height=42style=display:block; / img src=assets/images/portfoliostrip/testimg1.gif alt=test width=74 height=42 style=display:none; / img src=assets/images/portfoliostrip/testimg2.gif alt=test width=74 height=42 style=display:none; / /a/li lia href=# img src=assets/images/portfoliostrip/testimg.gif alt=test width=74 height=42style=display:block; / img src=assets/images/portfoliostrip/testimg1.gif alt=test width=74 height=42 style=display:none; / img src=assets/images/portfoliostrip/testimg2.gif alt=test width=74 height=42 style=display:none; / /a/li /ul and a cut down version of the jQuery is this $(ul.list li a).bind(mouseenter, function () { var current = 0; var max_img = ($(this).children().size())-1; for(current=0;current=max_img;current++) { $(this).children(img).eq(current).fadeIn(fSpeed) console.log(current); } //end of for-loop }); the list acts as a carousel and zooms the thumbnail on mouseenter, which is then supposed to start fading in the other images contained in the li tag. Everything is working perfectly except for lopping through the images. The loop works, but it just fades in all the images in the li, rather then waiting for the fade to finish, then moving onto the next image. I've been at this for a day now, and need to get this working today. If anyone can help me with this, please do. Thanks, Liam Potter Liam Potter wrote: Ok, so now I know it's just the loop isn't waiting for the fadeIn animation to complete before moving on. I'm trying to use a setTimeout, but I can't put this into a function because when I do $(this) no longer relates to what I need it to. I tried changing it to this function doThis() { var current = 0; var max_img = $(this).children().size(); for(current=1;current=max_img;current++) { setTimeout(doThis,3000); $(ul.list li a).children(img).eq(current).fadeIn(fSpeed, function () { }) } //end of for-loop } doThis(); but then it doesn't even run.. This is rather urgent and I'm really strugling here, so if anyone has any suggestions, please suggest away. - Liam Liam Potter wrote: I've just taken another look and it is actually fading the rest of the images, all at the same time. It seems to me the loop is running, but doesn't wait for the first image to finish fading, would using setTimeout doing anything? evo wrote: Hi Guys, I'm having some trouble looping through images by fading one into the next. This is the jQuery $(ul.list li a).bind(mouseenter, function () { var a; var max_img = $(this).children().size(); for(a=0;a=max_img;a++) { $(this).children(img).eq(a).next().fadeIn(3000) } //end of for-loop }); and the html is this ul class=list lia href=# img src=assets/images/portfoliostrip/testimg.gif alt=test width=74 height=42style=display:block; / img src=assets/images/portfoliostrip/testimg1.gif alt=test width=74 height=42 style=display:none; / img src=assets/images/portfoliostrip/testimg2.gif alt=test width=74 height=42 style=display:none; / /a/li /ul These images will be pulled from a database, and I don't know how many there will be. Right now, when I hover over the image, it just fades in the last image in the list. Can anyone explain why this isn't working and maybe post some code that will please. Thanks, Liam
[jQuery] Re: datepicker is not a function
Ah, now that I look at your code again, you've got .datepicker(options) in one place, that looks right. Below you have .datepick(getDate) That should be .datepicker(getDate) - Richard On Thu, Jan 15, 2009 at 4:24 AM, divsystem divsys...@gmail.com wrote: $('.Datepicker1').datepicker({beforeShow: customRange, rangeSelect: true, numberOfMonths: 2}); function customRange(input) { return { minDate: (input.id == startDatepicker ? $ (#endDatepicker).datepick(getDate) : null), maxDate: (input.id == endDatepicker ? $ (#startDatepicker).datepick(getDate) : null) }; } pstartDate: input type=text id=startDatepicker class = Datepicker1/p pendDate: input type=text id=endDatepicker class = Datepicker1/p
[jQuery] Re: Possible 1.3 bug
Hi (me again), the problem was being caused by the moreSelectors plugin on this page: http://www.softwareunity.com/jquery/JQueryMoreSelectors/ On Jan 15, 2:40 pm, Diego diego.a...@gmail.com wrote: FYI. I found my offending code. It's a combination of these selectors: :text, :password, :file, :select, :button I just can't figure out why! On Jan 15, 7:39 am, emmj...@gmail.com emmj...@gmail.com wrote: I was checking all of my random plugins/scripts to make sure they all work with jQuery 1.3 and I found one that is having problems. An example of it is available at:http://digitalinferno.net/temp/ If you enter some text into the input firebug will report that filter is not a function in http://digitalinferno.net/temp/js/jquery.jsonline 1961 Anyone know if this is a bug or if I have to change something in my code for the new 1.3 release?
[jQuery] Don't 'X' if already 'X'd'
Hey, I'm trying to get a little hover script running. It's using the hoverIntent plugin, but substituting that for hover will work for this example. What I'm trying to do is hover a link which will fade out a paragraph, change the contents of that paragraph, and then fade that paragraph back in. I have that working in my code so far. The bug I'm trying to fix is that when I hover over the now active link again, it repeats the fadeOut change contents fadeIn script again, but as the content has already been changed it just becomes an annoying fadeOut fadeIn effect. Any help would be greatly appreciated. Here's my code. $('ul.sub-text-points li a.point-1').hover(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { });
[jQuery] Re: Possible 1.3 bug
It seems the problem has to do with creating custom selectors. I have a custom selector that I created and I am receiving this exact error. I am currently looking into the problem to see what I can figure out. On Jan 15, 9:05 am, Diego diego.a...@gmail.com wrote: Hi (me again), the problem was being caused by the moreSelectors plugin on this page:http://www.softwareunity.com/jquery/JQueryMoreSelectors/ On Jan 15, 2:40 pm, Diego diego.a...@gmail.com wrote: FYI. I found my offending code. It's a combination of these selectors: :text, :password, :file, :select, :button I just can't figure out why! On Jan 15, 7:39 am, emmj...@gmail.com emmj...@gmail.com wrote: I was checking all of my random plugins/scripts to make sure they all work with jQuery 1.3 and I found one that is having problems. An example of it is available at:http://digitalinferno.net/temp/ If you enter some text into the input firebug will report that filter is not a function in http://digitalinferno.net/temp/js/jquery.jsonline1961 Anyone know if this is a bug or if I have to change something in my code for the new 1.3 release?
[jQuery] Re: Don't 'X' if already 'X'd'
You could add a class say, nochange check for that on hover, if found, no dothing, if not, continue to change. davebowker wrote: Hey, I'm trying to get a little hover script running. It's using the hoverIntent plugin, but substituting that for hover will work for this example. What I'm trying to do is hover a link which will fade out a paragraph, change the contents of that paragraph, and then fade that paragraph back in. I have that working in my code so far. The bug I'm trying to fix is that when I hover over the now active link again, it repeats the fadeOut change contents fadeIn script again, but as the content has already been changed it just becomes an annoying fadeOut fadeIn effect. Any help would be greatly appreciated. Here's my code. $('ul.sub-text-points li a.point-1').hover(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { });
[jQuery] Re: Standards box model
Thank you. I mean I afraid css bugs I am devloping in 5 cumputer language, buy I never understand what it's mean W3C Box render model (or somethink like that( Thank you again. On 15 ינואר, 07:19, James Van Dyke jame...@gmail.com wrote: I've always used transitional and had no problems, even with 1.3. Transitional is still a standard, but let's some things slide. However, if you're so concerned with bugs, you may want to wait until 1.3.1 or later. 1.3 is bound to have some lurking issues. On Jan 15, 12:15 am, Karl Rudd karl.r...@gmail.com wrote: Try it and see what Internet Explorer 6 does. Karl Rudd On Thu, Jan 15, 2009 at 3:53 PM, Ami aminad...@gmail.com wrote: So you for you fast answer. 5 point (: Do I must to change all my pages from Transitional to strict? Or can I leave it as Transitional (I afraid from CSS bugs, so i don't want to cahnge) On 15 ינואר, 06:48, Karl Rudd karl.r...@gmail.com wrote: That will work, but you do not need to change to using XHTML. You could use HTML Strict: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; More information here: http://en.wikipedia.org/wiki/Quirksmode Karl Rudd On Thu, Jan 15, 2009 at 3:08 PM, Ami aminad...@gmail.com wrote: Hello, Sorry about my grammar, English isn't my tang. I read in the Jquery 1.3:release notes, that I must use W3c standards mode. I tried to understand what it's mean. Now my HTML start like that: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//ENhtml dir=rtl DO I need to replace it to this: (Like in Jquery website) !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; Thank you.
[jQuery] Re: ajax :: how to load script
thanks for the quick response, james! it works now, i used your first suggestion since i had a problem with the other one (got an error): $(#searchButton).click(function() { var url = 'http://gdata.youtube.com/feeds/api/videos?q=' + $('#searchText').val() + 'alt=json-in-scriptcallback=showMyVideosmax-results=7format=5'; $.getScript(url); }); thanks a lot! On 15 Jan., 15:54, James Van Dyke jame...@gmail.com wrote: The simple solution would be to use $.getScript(url, callback). However, know that if you insert HTML anywhere in the page using jQuery, it will search for and execute any script tags in that HTML automatically. For example: $.get('/my/url/with/html_and_jscript.html', function(data) { $(#element).html(data); }); This will place any text returned from the request into #element, but will also scan for and execute any script tags in that returned data. Hope that helps. On Jan 15, 9:41 am, dirk w dirkwendl...@googlemail.com wrote: hello community, i've got a textfield and a searchbutton. a click on the searchbutton schould execute the following java script which will return some data to a callbackfunction called showmyvideos: $('#searchButton').click(function() { var url = 'http://gdata.youtube.com/feeds/api/videos?q='+ $('#searchText').val() + 'alt=json-in-scriptcallback=showMyVideosmax-results=7format=5'; // ajax functions to call $.ajax, $.load, $.get, $.post EXECUTE('script type=text/javascript src=' + url + '/ script'); }); my problem is: how do i execute this java script line to get the data. this loading must happen without reloading the whole page. is this possible with jquerys ajax plugin? thanks a lot in advance! dirk
[jQuery] Re: Don't 'X' if already 'X'd'
here is some untested code $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).class(current_point) {} else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } like I say, untested, but should give you a starting point. Liam Potter wrote: You could add a class say, nochange check for that on hover, if found, no dothing, if not, continue to change. davebowker wrote: Hey, I'm trying to get a little hover script running. It's using the hoverIntent plugin, but substituting that for hover will work for this example. What I'm trying to do is hover a link which will fade out a paragraph, change the contents of that paragraph, and then fade that paragraph back in. I have that working in my code so far. The bug I'm trying to fix is that when I hover over the now active link again, it repeats the fadeOut change contents fadeIn script again, but as the content has already been changed it just becomes an annoying fadeOut fadeIn effect. Any help would be greatly appreciated. Here's my code. $('ul.sub-text-points li a.point-1').hover(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { });
[jQuery] Re: Don't 'X' if already 'X'd'
just noticed a mistake forget to actually do anything with the if try this $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).attr(class) == current_point) { } else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } Liam Potter wrote: here is some untested code $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).class(current_point) {} else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } like I say, untested, but should give you a starting point. Liam Potter wrote: You could add a class say, nochange check for that on hover, if found, no dothing, if not, continue to change. davebowker wrote: Hey, I'm trying to get a little hover script running. It's using the hoverIntent plugin, but substituting that for hover will work for this example. What I'm trying to do is hover a link which will fade out a paragraph, change the contents of that paragraph, and then fade that paragraph back in. I have that working in my code so far. The bug I'm trying to fix is that when I hover over the now active link again, it repeats the fadeOut change contents fadeIn script again, but as the content has already been changed it just becomes an annoying fadeOut fadeIn effect. Any help would be greatly appreciated. Here's my code. $('ul.sub-text-points li a.point-1').hover(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { });
[jQuery] Re: How get data objects from a php file called via ajax
Thanks Milos. When I fixed this coding error I get a button but I still can not get any click event for this button. This is how I try to get this click event: $('.test_select').bind(click, function() { var thisName = $(this).attr('name'); $('#test_list').html(thisName + clicked); return false; }); On 15 Jan, 15:22, Miloš Rašić milos.ra...@gmail.com wrote: Try fixing your html in the php code like this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; You forgot to close that class property in the input. On Thu, Jan 15, 2009 at 12:12 PM, Mikael mhedeng...@gmail.com wrote: I am new to javascript and jQuery programming so my problem might be very simple to explain but please bare with me. I want to make a selection in a list created by a php-file that is called from another php-file using jQuery and ajax but it fails. My example is very limited but shows the main problem. The first php-file has abutton defined like this: input class=mini_browse type=button value=Browse test / I also have a div to show the result: div id=myresultShow the result here/div The jQuery entry looks like this: jQuery(document).ready(function($) { $('.mini_browse').bind(click, function() { $.ajax({ type: get, url: test-ajax.php, data: { action: 'test' }, error: function() {$(#myresult).html(Ajax error);}, success: function(html){ //so, if data is retrieved, store it in html $(#myresult).html(html); } }); //close jQuery.ajax return false; }); }); When I click the button I get a call to test-ajax.php as expected and the output is displayed in the myresult div but not as expected. The test-ajax.php executes this: echo 'input class=test_select type=button name=test_select_1 id=test_select_1 value=Select /'; The button is not displayed as a button but like an input text with the text Select in it and I can not get a click event from it. I can not see the output from test-ajax.php when I view the page source so I guess that I have to get it included in the document somehow but how? Can anybody point me in the right direction to solve this? Thanks!
[jQuery] Re: Don't 'X' if already 'X'd'
Liam, Thanks for your reply. As soon as I posted this I also had that idea. Guess a Mr Kipling and a coffee is brain food after all! I haven't tried your code as I have it working now. Here's my code incase anyone else would like it. Cheers Liam. $('ul.sub-text-points li a.point-1').hoverIntent(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.point-1').fadeOut(300, function(){ $(this).html('Changed text'); $(this).fadeIn(300); $(this).removeClass(point-1); $(this).addClass(point-2); $(this).addClass(point-3); });}, function() { }); On Jan 15, 3:41 pm, Liam Potter radioactiv...@gmail.com wrote: just noticed a mistake forget to actually do anything with the if try this $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).attr(class) == current_point) { } else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } Liam Potter wrote: here is some untested code $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).class(current_point) {} else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } like I say, untested, but should give you a starting point. Liam Potter wrote: You could add a class say, nochange check for that on hover, if found, no dothing, if not, continue to change. davebowker wrote: Hey, I'm trying to get a little hover script running. It's using the hoverIntent plugin, but substituting that for hover will work for this example. What I'm trying to do is hover a link which will fade out a paragraph, change the contents of that paragraph, and then fade that paragraph back in. I have that working in my code so far. The bug I'm trying to fix is that when I hover over the now active link again, it repeats the fadeOut change contents fadeIn script again, but as the content has already been changed it just becomes an annoying fadeOut fadeIn effect. Any help would be greatly appreciated. Here's my code. $('ul.sub-text-points li a.point-1').hover(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { });
[jQuery] really working cross browser color picker palette ?
any one knows really working cross browser color picker palette ? ive tried to find but i cant :(
[jQuery] Re: IE Problem with (function($)
Not really - after all I was wrong too :D I didn't notice the other closing braces under quoted text in the OP. cheers, - ricardo On Jan 14, 2:56 am, Karl Swedberg k...@englishrules.com wrote: good eye, Ricardo! thanks for the back up. :-) --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 13, 2009, at 5:54 PM, Ricardo Tomasi wrote: You're missing a parenthesis when closing the anonymous function: }(); should be })(); And I'm guessing '$' is there for jQuery, so that should actually be })(jQuery); - ricardo On Jan 13, 3:56 pm, Sagar Arya sagararya...@gmail.com wrote: may be i should check with the other files and let you know... thanks for the information.. Cheers ! Aryan On Tue, Jan 13, 2009 at 7:06 PM, Karl Swedberg k...@englishrules.comwrote: I'm not seeing anything obvious. Taking a stab in the dark here ... I've received a similar error in the past when a reference to one of my JavaScript files was resulting in a 404. The browser would try to parse the file as JavaScript, but of course it would be met with a syntax error on line 1. Is it possible that the problem is not with this file, but with another one that you're trying to include? Just a guess. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 13, 2009, at 5:35 AM, Aryan wrote: I have a problem with Internet Explorer ( all versions ) . The following is my JQuery Code , which executes perfectly in mozilla and chrome.. But it doesn't work in Internet Explorer. It says : Syntax error ( line 1 )... Can anyone help me out here.. Thanks for your time in reading this. (function($){ var EYE = window.EYE = function() { var _registered = { init: [] }; return { init: function() { $.each(_registered.init, function(nr, fn){ fn.call(); }); }, extend: function(prop) { for (var i in prop) { if (prop[i] != undefined) { this[i] = prop[i]; } } }, register: function(fn, type) { if (!_registered[type]) { _registered[type] = []; } _registered[type].push(fn); } }; }(); $(EYE.init); })(jQuery);
[jQuery] Re: Don't 'X' if already 'X'd'
That always happens to me as well, as soon as I post something I'll realise what I could do. But you can chain a quite a bit of this, make a bit more efficient $('ul.sub-text-points li a.point-1').hoverIntent(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.point-1').fadeOut(300, function(){ $(this).html('Changed text').fadeIn(300).removeClass(point-1).addClass(point-2).addClass(point-3); });}, function() { }); davebowker wrote: Liam, Thanks for your reply. As soon as I posted this I also had that idea. Guess a Mr Kipling and a coffee is brain food after all! I haven't tried your code as I have it working now. Here's my code incase anyone else would like it. Cheers Liam. $('ul.sub-text-points li a.point-1').hoverIntent(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.point-1').fadeOut(300, function(){ $(this).html('Changed text'); $(this).fadeIn(300); $(this).removeClass(point-1); $(this).addClass(point-2); $(this).addClass(point-3); });}, function() { }); On Jan 15, 3:41 pm, Liam Potter radioactiv...@gmail.com wrote: just noticed a mistake forget to actually do anything with the if try this $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).attr(class) == current_point) { } else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } Liam Potter wrote: here is some untested code $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).class(current_point) {} else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } like I say, untested, but should give you a starting point. Liam Potter wrote: You could add a class say, nochange check for that on hover, if found, no dothing, if not, continue to change. davebowker wrote: Hey, I'm trying to get a little hover script running. It's using the hoverIntent plugin, but substituting that for hover will work for this example. What I'm trying to do is hover a link which will fade out a paragraph, change the contents of that paragraph, and then fade that paragraph back in. I have that working in my code so far. The bug I'm trying to fix is that when I hover over the now active link again, it repeats the fadeOut change contents fadeIn script again, but as the content has already been changed it just becomes an annoying fadeOut fadeIn effect. Any help would be greatly appreciated. Here's my code. $('ul.sub-text-points li a.point-1').hover(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { });
[jQuery] Re: Possible 1.3 bug
In jquery.liveFilter.js a pseudo selector defined as a string, which was deprected since 1.2 if I remember right. jQuery.extend( jQuery.expr[':'], { insContains : jQuery(a).text().toUpperCase().indexOf(m [3].toUpperCase())=0 }); This should be a function instead: jQuery.expr[':'].insContains = function(a,i,m){ return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())=0 } On Jan 15, 4:09 pm, tpb976 tpb...@gmail.com wrote: It seems the problem has to do with creating custom selectors. I have a custom selector that I created and I am receiving this exact error. I am currently looking into the problem to see what I can figure out. On Jan 15, 9:05 am, Diego diego.a...@gmail.com wrote: Hi (me again), the problem was being caused by the moreSelectors plugin on this page:http://www.softwareunity.com/jquery/JQueryMoreSelectors/ On Jan 15, 2:40 pm, Diego diego.a...@gmail.com wrote: FYI. I found my offending code. It's a combination of these selectors: :text, :password, :file, :select, :button I just can't figure out why! On Jan 15, 7:39 am, emmj...@gmail.com emmj...@gmail.com wrote: I was checking all of my random plugins/scripts to make sure they all work with jQuery 1.3 and I found one that is having problems. An example of it is available at:http://digitalinferno.net/temp/ If you enter some text into the input firebug will report that filter is not a function in http://digitalinferno.net/temp/js/jquery.jsonline1961 Anyone know if this is a bug or if I have to change something in my code for the new 1.3 release?
[jQuery] jQuery Jitter in Firefox Problem (Please Help!)
I have created a website for a friend of mine that is a musician. The website is not live yet, it is on a hidden portion of the server. Anyways, the website is using jQuery to handle the pages. All of the code is actually on the index page and the jQuery tells what div on the page to show when a link on the navigation is clicked... If you look at the site in Firefox, and you let the page load... once you click on a link, you will notice the edges of the website will jump a lot... all of the pages do this, and I am not sure what is causing it. It looks fine in IE, but does it in Firefox and Safari... Any suggestions are greatly appreciated! Site Address: http://www.stephenhunley.com/web Something else to add... this problem does not show up on the following browsers... Mac Firefox 3.0.5 Mac Safari 3.2.1 PC IE 7.0 PC Safari 3.2.1 The site even plays nice with IE 6.0 (on my Mac through Parallels running Windows XP)... The only browser that I have noticed the issue on is the PC version of Firefox 3.0.5
[jQuery] Re: Capture a click outside of a specific object?
You can do : $(document).bind('click', function(e){ var $clicked = $(e.target); if (!($clicked.is('#element') || $clicked.parents().is ('#element'))) { //click outside, do what you want :) } else { // click inside, to what you want, or nothing :) } }); that's it ! On 15 jan, 00:14, riotbrrd k...@riotbrrd.com wrote: Hmmm, I wasn't able to find anything about that, though I checked only quickly. What section fo the docs would that be in? On Jan 13, 5:44 pm, Kean shenan...@gmail.com wrote: You might want to look at live and die method now posted in jQuery documentation. On Jan 13, 11:32 am,riotbrrdk...@riotbrrd.com wrote: Hi all, Is there a simple way to capture a click event in a window/document and then determine whether the click was inside an element #foo, or outside of that element? Thanks! -Kim- Hide quoted text - - Show quoted text -
[jQuery] Problem with nav bar style menu
Hi there, I am new to this so please bear with me. I have used the superfish menu for my navigation on a site that I am working on and have run into a few problems. Following the instructions on http://users.tpg.com.au/j_birch/plugins/superfish/#sample4 and by looking at the source of that page I have almost got it completely working. The only issue I have left is that when I click on any tab, regardless of level I don't get the situation whereby the 2nd level (horizontal) is displayed under the top tab. Instead I get the 2nd level area just blank, blue, with no links in it. For instance if I go to Home and then on the 2nd level click another menu item, it is highlighted in bold for a few seconds and then disappears and I am left with a blank blue 2nd level. When I hover over Home again, I see the one I clicked and it is highlighted. So the problem on lies with getting the 2nd level to remain visible once I have chosen a link. I am using references to the jquery javascript files used on the superfish site (so that they are indentical). Any css files I have downloaded and placed into my working directory. The only change I have made was to the 'superfish-navbar.css' file, which was changing: .sf-navbar li ul { width: 44em; /*IE6 soils itself without this*/ } TO .sf-navbar li ul { width: 150em; /*IE6 soils itself without this*/ } As I needed the 2nd level to be wider once I hovered over a top level tab. I also have the 2 .png images that you supplied and these are in my workspace. I also have script type=text/javascript$(document).ready(function (){$('#horizontal-menu').superfish({pathClass: 'current'}); });/ script In my source under my javascript declarations. I looked at the source of the page on superfish and it was the same apart from they have #sample-menu4 I think and I have replaced it with horizontal- menu. It is still the id attribute of the top UL tag though. Can anyone tell me why this results in the 2nd level 'snapping' back to simply being as wide as the top tabs area with no links in it, rather than remaining the correct width when hovered over, with the links displayed, and the one on the current path highlighted? Much appreciated Chris
[jQuery] :last :first not working??
Hi there, I am doing some table row colouring with :odd (this works as expected), but: $(tr td:last).css(border, none); does nothing! I did some further testing on other selectors with other more obvious classes and the selector :last and :first don't seem to select anything. I have tried this with jQuery 1.2 and 1.3. Any help would be appreciated, thanks
[jQuery] How to force two connected sortable lists to behave like one list?
How to force two connected sortable lists to behave like one list? Small example. I have two connected lists (ListA, ListB). Each one has 5 elements. When I drag 2nd element form ListA to 3th position in ListB, ListA will have 4 elements and ListB will have 6 elements. Is it possible, to get two lists with the same number of elements after this operation as it was before the operation? I mean, first element of ListB will automatically move to the last position of ListA. It will be the best solution to make it with only one list with 10 elements. But when you need 5 elements in one side of the page and other 5 on other side, it became to impossible. Thanks for your interest.
[jQuery] How to make ajax links bookmarkable? (history)
Hi - I've got a site that uses a jquery ui accordion to load content into a container div via an ajax call. I would like to have the links in the accordion update the page's href with their url onclick, but I don't want to force a page reload since content is served via ajax. I've tried using the history_remote plugin for this without much luck (double-loads in firefox, no hash updates in IE7) I'm looking for an alternative solution. My link syntax is like so: http://foo.aspx?page=3 (this is actually caught by a handler which redirects the ajax load to bar.aspx?page=3)
[jQuery] Tabs Documentation
Hi The documentation page for Tabs has not been working for a couple of days, any idea when it will be available again? Thanks
[jQuery] Re: :last :first not working??
that will get the :last (or :first) for the first row only as it will return 1 single object you need to do something like $(tr).each(function() { $(this).find(td:last).css(border, none); }); which will loop across each row and do the code to the last or first object On Jan 15, 9:05 am, the cliff leperisl...@gmail.com wrote: Hi there, I am doing some table row colouring with :odd (this works as expected), but: $(tr td:last).css(border, none); does nothing! I did some further testing on other selectors with other more obvious classes and the selector :last and :first don't seem to select anything. I have tried this with jQuery 1.2 and 1.3. Any help would be appreciated, thanks
[jQuery] Re: issue with pathClass: current on nav style menu
Also notice that the jQuery is adding lots of information into my HTML tags such as jQuery1232031575583=... in the anchor tags and list item tags. it also adds span class=sf-sub-indicator jQuery1232031575583=null»/span inside the anchor tags, I presume to get the arrows. I noticed in the source of the example given by superfish that this does not appear in their tags On Jan 15, 4:00 pm, cajchris cajch...@gmail.com wrote: Hi, I have been using superfish for the navigation for a site I am working on and have ran into problems regarding the current class that is applied to each li tag which is in the current path. Whenever I hover over the top level, the 2nd level is displayed and the links are are all there, with the current one highlighted. However once I move the mouse away from the menu altogether, the 2nd level does not remain displayed with the links in it as before, instead they disappear after a delay, and I am left with a blank blue strip where the links should be. In the source of my page I have: script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery-1.2.6.min.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.tabs.pack.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.history.pack.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/topnavigation.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/supersubs.js type=text/javascript/script link href=/Relatis1/Skin/P/topnavigation.css type=text/css rel=stylesheet link href=/Relatis1/Skin/P/topnav-horizontal.css type=text/css rel=stylesheet script type=text/javascript$(document).ready(function(){$ ('#horizontal-menu').superfish({pathClass: 'current'}); });/script This is the same as the superfish example except that I have downloaded the css files and the 2 superfish javascript files onto my local machine and renamed them. The only change being in the topnav- horizontal.css file whereby I changed: .sf-navbar li ul { width: 44em; /*IE6 soils itself without this*/ } TO .sf-navbar li ul { width: 150em; /*IE6 soils itself without this*/ } As I needed the 2nd level strip to be wider as it contains more links than the example given. A snippt of my HTML source for the menu is: UL class=sf-menu sf-navbar sf-js-enabled sf-shadow id=horizontal-menu serial=0 sfTimer=1313775 jQuery1232031575583=451 LI class=current jQuery1232031575583=3 A class=sf-with-ul id=11386_Tab onclick= href=# jQuery1232031575583=55HomeSPAN class=sf-sub-indicator jQuery1232031575583=null»/SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=452 LI class= jQuery1232031575583=4 A class=sf-with-ul id=m11387 title=Complaint Search onclick= href=# jQuery1232031575583=56Complaint SearchSPAN class=sf-sub-indicator jQuery1232031575583=null»/ SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=453 LI class= jQuery1232031575583=57 A class= id=m11388 title=Open onclick= href=# jQuery1232031575583=58Open/A /LI LI class= jQuery1232031575583=59 A id=m11389 title=Pending onclick= href=# jQuery1232031575583=60Pending/A /LI LI class= jQuery1232031575583=61 A id=m11390 title=Closed onclick= href=# jQuery1232031575583=62Closed/A /LI LI class= jQuery1232031575583=63 A id=m15012 title=fdgdfgdg onclick= href=# jQuery1232031575583=64fdgdfgdg/A /LI /UL /LI LI class=current jQuery1232031575583=65 A id=m11440 title=Customer Search onclick= href=# jQuery1232031575583=66Customer Search/A /LI LI class= jQuery1232031575583=67 A id=m11391 title=Quote / Policy Search onclick= href=# jQuery1232031575583=68Quote / Policy Search/A /LI LI class= jQuery1232031575583=69 A id=m12064 title=Renewal Search onclick= href=# jQuery1232031575583=70Renewal Search/A /LI LI class= jQuery1232031575583=5 A class=sf-with-ul id=m12305 title=Calendar onclick= href=# jQuery1232031575583=71CalendarSPAN class=sf- sub-indicator jQuery1232031575583=null»/SPAN/A UL style=DISPLAY: none; VISIBILITY: hidden oldblock=block LI jQuery1232031575583=72 A id=m12366 title=Day
[jQuery] Re: Condense this function
I'm not sure what it is that its choking on. It doesnt throw any errors in Firebug or Inspector If I do $(function() { var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) { setTimeout( function() { $(.sticky1:hidden).fadeIn(500); }, 100 * i); } }); It works fine (obviously) as its not pulling in the variable attribute ( + i + ) Basically everything in setTimeout( function() { $(.sticky1:hidden).fadeIn(500); }, 100 * i); I get, its var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) That I don't yet understand. I see that its basically saying there are 9 sticky classes. For each class, add a digit to the variable i for the classname , and multiply the timeout by i. Its ingenious, but I haven't the first idea what is broken. Basically, I have a page that I created which pulls data out of a job tracking database (doing this for free, in my spare time, to learn more about database calls, php, and js) and paints the data set that was queried down the page in sticky notes. It randomizes the color of the notes, and onload fades them in. There may be 50 stickies, or as few as one or two. Its pretty neat, and its working right now, but I'd love to better understand your method. Thanks again! D On Jan 15, 12:21 am, James Van Dyke jame...@gmail.com wrote: Let me know what's not working, and maybe I can help you out. I don't have firebug handy, so I didn't test it. On Jan 14, 11:44 pm,DJCarbon43djcarbo...@gmail.com wrote: I haven't gotten it working yet, but I understand the concept, and its brilliant! Thank you very much! On Jan 14, 11:28 pm, James Van Dyke jame...@gmail.com wrote: $(function() { var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) { setTimeout( function() { $(.sticky + i + :hidden).fadeIn(500); }, 100 * i); } }); Not sure if that's faster, but it's shorter and easier to change. On Jan 14, 11:19 pm,DJCarbon43djcarbo...@gmail.com wrote: Being a bit of a newfie, I was wondering how this function could be condensed: $(document).ready = setTimeout(function(){ $(.sticky1:hidden).fadeIn(500); }, 100); setTimeout(function(){ $(.sticky2:hidden).fadeIn(500); }, 200); setTimeout(function(){ $(.sticky3:hidden).fadeIn(500); }, 300); setTimeout(function(){ $(.sticky4:hidden).fadeIn(500); }, 400); setTimeout(function(){ $(.sticky5:hidden).fadeIn(500); }, 500); setTimeout(function(){ $(.sticky6:hidden).fadeIn(500); }, 600); setTimeout(function(){ $(.sticky7:hidden).fadeIn(500); }, 700); setTimeout(function(){ $(.sticky8:hidden).fadeIn(500); }, 800); setTimeout(function(){ $(.sticky9:hidden).fadeIn(500); }, 900); Is it possible, or is that as clean as can be? fadein time is the same accross all sticky classes, but the timeout must be different for each.
[jQuery] Re: function text() in jquery
thanks a lot ricardobeat. work like a charm :) ricardobeat wrote: There are two alternatives: $('#testText').contents(':not(select)')[0].nodeValue; this one is unsupported but works too: $('#testText').contents('[nodeType=3]')[0].nodeValue; Notice that both will keep the linebreaks. if text() could handle textnodes this would be much easier. - ricardo On Jan 12, 2:43 pm, kazuar kazuar...@gmail.com wrote: Hi, I thank you all for your help. I guess I'll go with Bohdan's suggestion. I'll put the text inside another tag (probably p tag...). thanks again for all your help, if you think of anything else please let me know. Kazuar Bohdan Ganicky wrote: Hello, maybe it could be easier to use the good old DOM in this scenario: var textNode = $('#testText').get().firstChild; // now we have the textNode var textRaw = textNode.nodeValue; // now we have the text string with all the white-space around var text = $.trim(textRaw); // we strip the trailing white-space using the jQuery trim function Of course this works as expected only if the text you're looking for is placed in the #testText's first textNode. I'd recommend using more meaningful markup instead and putting the text inside p element. ;) -- Bohdan Ganicky On Jan 12, 11:55 am, kazuar kazuar...@gmail.com wrote: hello, Im kinda new in jquery so maybe its a begginer question. I have a page with a div containing some text and a combobox. something like that div id=testText hello this is text and this is combobox selectoption value='1'1/optionoption value='2'2/optionoption value='3'3/option/select/div I wrote a function which return the text from the div. alert($('#testText').text()); My problem is that the function also return the text inside the combobox. is there a way to filter out the combobox text? the only workaround I can think of is to wrap my text in another div and call its text. This workaround will be a bit complicated for me because the text on my page is dynamic and it can come after the input field or before the input field so I just want to get the text inside the div without the input fields text... (This only happens with combobox). tnx, Kazuar -- View this message in context:http://www.nabble.com/function-text%28%29-in-jquery-tp21410667s27240p... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/function-text%28%29-in-jquery-tp21410667s27240p... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/function-text%28%29-in-jquery-tp21410667s27240p21480645.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Issue upgrading to 1.3
Looks like it's related to this: http://dev.jquery.com/ticket/3837 On Jan 14, 9:32 pm, Joe Morgan thewast...@gmail.com wrote: Hello, When I attempt to upgrade my site from 1.2.6 to 1.3, I get an unresponsive script error that causes my browser (both IE7 and FF3) to hang if the script is not stopped. I've tracked down the bit of script causing the problem: $(ul#loginSection li#emilyLogin:not(.loggedIn), ul#loginSection li#joeLogin:not(.loggedIn)).click( function(){} ); As you can see, the problem exists even when the function defined for the click event is empty, leading me to wonder if it is some problem in the CSS selector that is being used, given the engine changes from 1.2.6 to 1.3. Am I doing something incorrectly? - Joe
[jQuery] Re: function text() in jquery
$('#testText').contents(':not(select)')[0].nodeValue; $('#testText').contents('[nodeType=3]')[0].nodeValue; I fear these aren't going to work in 1.3 as the new selector engine doesn't handle textnodes anymore! On Jan 15, 5:09 pm, kazuar kazuar...@gmail.com wrote: thanks a lot ricardobeat. work like a charm :) ricardobeat wrote: There are two alternatives: $('#testText').contents(':not(select)')[0].nodeValue; this one is unsupported but works too: $('#testText').contents('[nodeType=3]')[0].nodeValue; Notice that both will keep the linebreaks. if text() could handle textnodes this would be much easier. - ricardo On Jan 12, 2:43 pm, kazuar kazuar...@gmail.com wrote: Hi, I thank you all for your help. I guess I'll go with Bohdan's suggestion. I'll put the text inside another tag (probably p tag...). thanks again for all your help, if you think of anything else please let me know. Kazuar Bohdan Ganicky wrote: Hello, maybe it could be easier to use the good old DOM in this scenario: var textNode = $('#testText').get().firstChild; // now we have the textNode var textRaw = textNode.nodeValue; // now we have the text string with all the white-space around var text = $.trim(textRaw); // we strip the trailing white-space using the jQuery trim function Of course this works as expected only if the text you're looking for is placed in the #testText's first textNode. I'd recommend using more meaningful markup instead and putting the text inside p element. ;) -- Bohdan Ganicky On Jan 12, 11:55 am, kazuar kazuar...@gmail.com wrote: hello, Im kinda new in jquery so maybe its a begginer question. I have a page with a div containing some text and a combobox. something like that div id=testText hello this is text and this is combobox selectoption value='1'1/optionoption value='2'2/optionoption value='3'3/option/select/div I wrote a function which return the text from the div. alert($('#testText').text()); My problem is that the function also return the text inside the combobox. is there a way to filter out the combobox text? the only workaround I can think of is to wrap my text in another div and call its text. This workaround will be a bit complicated for me because the text on my page is dynamic and it can come after the input field or before the input field so I just want to get the text inside the div without the input fields text... (This only happens with combobox). tnx, Kazuar -- View this message in context:http://www.nabble.com/function-text%28%29-in-jquery-tp21410667s27240p... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/function-text%28%29-in-jquery-tp21410667s27240p... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/function-text%28%29-in-jquery-tp21410667s27240p... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: blockUI - Bug overlapping fixed elements
EDIT: Resolved, noticed that blockUI sets the z-index of it to 1000, so in order for fixed elements to appear above it their z-index needs to be higher than that value. Quite simple really :D On Jan 15, 12:27 pm, Beaver6813 s...@beaver6813.com wrote: Hey, Yea I can, its my private test site so its all still really unstable but it shows the bug:http://www.new.fetchmp3.com/dev/search.php?q=Fall+Out+Boy user: admin pass: google123 Once its loaded change to the myspace tab and you will see that the overlay overlaps the bar at the bottom... is there anyway around this? (Note ive commented out the unblock function so the element stays blocked for debugging) Thanks for any help! --Sam On Jan 14, 12:55 am, Mike Alsup mal...@gmail.com wrote: There seems to be a bug that when you have a fixed element attached to the bottom of the window and then try to block an element that goes below the bottom of the window (scrolls) it overlaps onto the fixed element.. its easier to show a picture:http://i44.tinypic.com/2z4wocn.jpg Any ideas as to how I could resolve this? --Sam Sam, could you post a link?
[jQuery] Re: blockUI - Bug overlapping fixed elements
EDIT: Resolved, noticed that blockUI sets the z-index of it to 1000, so in order for fixed elements to appear above it their z-index needs to be higher than that value. Quite simple really :D On Jan 14, 12:55 am, Mike Alsup mal...@gmail.com wrote: There seems to be a bug that when you have a fixed element attached to the bottom of the window and then try to block an element that goes below the bottom of the window (scrolls) it overlaps onto the fixed element.. its easier to show a picture:http://i44.tinypic.com/2z4wocn.jpg Any ideas as to how I could resolve this? --Sam Sam, could you post a link?
[jQuery] Re: new Jquery Cheat Sheet
I haven't seen an updated static cheat sheet yet, but there is the cool API browser: http://api.jquery.com On Jan 14, 12:50 pm, ericb...@gmail.com ericb...@gmail.com wrote: Is there a new Jquery cheat sheet for 1.3?
[jQuery] Re: issue with pathClass: current on nav style menu
Anyone got any ideas? On Jan 15, 4:08 pm, cajchris cajch...@gmail.com wrote: Also notice that the jQuery is adding lots of information into my HTML tags such as jQuery1232031575583=... in the anchor tags and list item tags. it also adds span class=sf-sub-indicator jQuery1232031575583=null»/span inside the anchor tags, I presume to get the arrows. I noticed in the source of the example given by superfish that this does not appear in their tags On Jan 15, 4:00 pm, cajchris cajch...@gmail.com wrote: Hi, I have been using superfish for the navigation for a site I am working on and have ran into problems regarding the current class that is applied to each li tag which is in the current path. Whenever I hover over the top level, the 2nd level is displayed and the links are are all there, with the current one highlighted. However once I move the mouse away from the menu altogether, the 2nd level does not remain displayed with the links in it as before, instead they disappear after a delay, and I am left with a blank blue strip where the links should be. In the source of my page I have: script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery-1.2.6.min.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.tabs.pack.js type=text/javascript/script script src=http://users.tpg.com.au/j_birch/plugins/assets/js/ jquery.history.pack.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/topnavigation.js type=text/javascript/script script language=JavaScript src=/Relatis1/scripts/supersubs.js type=text/javascript/script link href=/Relatis1/Skin/P/topnavigation.css type=text/css rel=stylesheet link href=/Relatis1/Skin/P/topnav-horizontal.css type=text/css rel=stylesheet script type=text/javascript$(document).ready(function(){$ ('#horizontal-menu').superfish({pathClass: 'current'}); });/script This is the same as the superfish example except that I have downloaded the css files and the 2 superfish javascript files onto my local machine and renamed them. The only change being in the topnav- horizontal.css file whereby I changed: .sf-navbar li ul { width: 44em; /*IE6 soils itself without this*/ } TO .sf-navbar li ul { width: 150em; /*IE6 soils itself without this*/ } As I needed the 2nd level strip to be wider as it contains more links than the example given. A snippt of my HTML source for the menu is: UL class=sf-menu sf-navbar sf-js-enabled sf-shadow id=horizontal-menu serial=0 sfTimer=1313775 jQuery1232031575583=451 LI class=current jQuery1232031575583=3 A class=sf-with-ul id=11386_Tab onclick= href=# jQuery1232031575583=55HomeSPAN class=sf-sub-indicator jQuery1232031575583=null»/SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=452 LI class= jQuery1232031575583=4 A class=sf-with-ul id=m11387 title=Complaint Search onclick= href=# jQuery1232031575583=56Complaint SearchSPAN class=sf-sub-indicator jQuery1232031575583=null»/ SPAN/A UL class= style=DISPLAY: none; FILTER: ; VISIBILITY: hidden; ZOOM: 1 oldblock=block jQuery1232031575583=453 LI class= jQuery1232031575583=57 A class= id=m11388 title=Open onclick= href=# jQuery1232031575583=58Open/A /LI LI class= jQuery1232031575583=59 A id=m11389 title=Pending onclick= href=# jQuery1232031575583=60Pending/A /LI LI class= jQuery1232031575583=61 A id=m11390 title=Closed onclick= href=# jQuery1232031575583=62Closed/A /LI LI class= jQuery1232031575583=63 A id=m15012 title=fdgdfgdg onclick= href=# jQuery1232031575583=64fdgdfgdg/A /LI /UL /LI LI class=current jQuery1232031575583=65 A id=m11440 title=Customer Search onclick= href=# jQuery1232031575583=66Customer Search/A /LI LI class= jQuery1232031575583=67 A id=m11391 title=Quote / Policy Search onclick= href=# jQuery1232031575583=68Quote / Policy Search/A /LI LI class= jQuery1232031575583=69 A id=m12064 title=Renewal Search onclick= href=# jQuery1232031575583=70Renewal Search/A /LI LI class= jQuery1232031575583=5 A class=sf-with-ul id=m12305 title=Calendar onclick= href=# jQuery1232031575583=71CalendarSPAN class=sf- sub-indicator
[jQuery] Re: :last :first not working??
Thanks for this, I tried it and firebug tells me it didn't work :( The thing is :last doesnt seem to work AT ALL for me, EG: $(ul li:last).css(border, 1px solid red); does absolutely nothing On Jan 15, 4:06 pm, MorningZ morni...@gmail.com wrote: that will get the :last(or :first) for the first row only as it will return 1 single object you need to do something like $(tr).each(function() { $(this).find(td:last).css(border, none); }); which will loop across each row and do the code to thelastor first object On Jan 15, 9:05 am, the cliff leperisl...@gmail.com wrote: Hi there, I am doing some table row colouring with :odd (this works as expected), but: $(tr td:last).css(border, none); does nothing! I did some further testing on other selectors with other more obvious classes and the selector :lastand :first don't seem to select anything. I have tried this with jQuery 1.2 and 1.3. Any help would be appreciated, thanks
[jQuery] Re: Don't 'X' if already 'X'd'
Chaining is a good idea! I used your chain, but combined the addClass into a single line. eg addClass('point-2 point-3') Cheers again! On Jan 15, 3:59 pm, Liam Potter radioactiv...@gmail.com wrote: That always happens to me as well, as soon as I post something I'll realise what I could do. But you can chain a quite a bit of this, make a bit more efficient $('ul.sub-text-points li a.point-1').hoverIntent(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.point-1').fadeOut(300, function(){ $(this).html('Changed text').fadeIn(300).removeClass(point-1).addClass(point-2).addClass(point-3); });}, function() { }); davebowker wrote: Liam, Thanks for your reply. As soon as I posted this I also had that idea. Guess a Mr Kipling and a coffee is brain food after all! I haven't tried your code as I have it working now. Here's my code incase anyone else would like it. Cheers Liam. $('ul.sub-text-points li a.point-1').hoverIntent(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.point-1').fadeOut(300, function(){ $(this).html('Changed text'); $(this).fadeIn(300); $(this).removeClass(point-1); $(this).addClass(point-2); $(this).addClass(point-3); });}, function() { }); On Jan 15, 3:41 pm, Liam Potter radioactiv...@gmail.com wrote: just noticed a mistake forget to actually do anything with the if try this $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).attr(class) == current_point) { } else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } Liam Potter wrote: here is some untested code $('ul.sub-text-points li a.point-1').hover(function() { if ( $(this).class(current_point) {} else{ $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { }); } like I say, untested, but should give you a starting point. Liam Potter wrote: You could add a class say, nochange check for that on hover, if found, no dothing, if not, continue to change. davebowker wrote: Hey, I'm trying to get a little hover script running. It's using the hoverIntent plugin, but substituting that for hover will work for this example. What I'm trying to do is hover a link which will fade out a paragraph, change the contents of that paragraph, and then fade that paragraph back in. I have that working in my code so far. The bug I'm trying to fix is that when I hover over the now active link again, it repeats the fadeOut change contents fadeIn script again, but as the content has already been changed it just becomes an annoying fadeOut fadeIn effect. Any help would be greatly appreciated. Here's my code. $('ul.sub-text-points li a.point-1').hover(function() { $('a.point-2, a.point-3').removeClass(current_point); $(this).addClass(current_point); $('p.sub-text').fadeOut(300, function(){ /* Looks like this is the start of the problem? */ $(this).html('Changed text'); $(this).fadeIn(300); });}, function() { });
[jQuery] Re: .append() into style element causes error in IE only
appendChild on a style element fails on IE and you get an unknown error if you try to modify it's innerHTML. I haven't found any workaround. Use this to add styles: //addStyles 0.1 // Ricardo Tomasi ricardobeat at gmail com // Licensed under the WTFPL - http://sam.zoy.org/wtfpl/ function addStyles(rule){ var sheet = document.styleSheets[0], ln = (sheet.cssRules||sheet.rules).length; if (sheet.addRule) { rule = rule.match(/(.*){(.*)}/); sheet.addRule(rule[1],rule[2], ln); } else { sheet.insertRule(rule, ln); }; return arguments.callee; }; addStyle(#div{display:none}); the 'return arguments.callee' line is there to allow for some funky construction, you can remove it if you want: addStyle ('div { background: xxx }') ('.menu { whatever: #45 }') ('.hold { float: left }') This script will insert rules at the end of the stylesheet, that's important so that you can override earlier styles. cheers, - ricardo On Jan 15, 8:07 am, Ant kalli...@gmail.com wrote: Hi, Yea, I went for adding a new style element for every new style, which works, but isn't as neat as I was hoping for. I was trying to append a string into the style element: HTML style type=text/css body{color:#333;} /style JS $(style).append(#content{color:#f00;}); In Firefox, this adds #content(color:#f00;} beneath the body declaration. Which is what I would expect to happen. In IE I get an error thrown in jquery-1.3b2.js It may well be that my expectations of append are wrong, if so, it would be a useful thing for me to know as I am quite new to jQuery. Many thanks for your time, Ant Ricardo Tomasi wrote: What are you trying to append? You can only append textnodes to a style element. Why not use the stylesheet object directly: document.styleSheets[0].insertRule(#wrapper {display:none}, 0) // 'addRule' on IE Or, for a hassle-free alternative, create a new style element for it: $('style type=text/css/style').text(myClass).appendTo('head'); On Jan 14, 12:05 pm, Ant kalli...@gmail.com wrote: Hi, I am trying to append css into a pre existing style element. $(style).append(myClass); This works as expected in Firefox, but not IE. The HTML on the page validates to HTML strict, so I'm fairly sure that it's not the issue with IE that append() won't work on incorrectly written elements. If I change my code to $(p).append(myClass); it works as expected. Was just wondering if this is a know issue with IE or jQuery and if anyone had a work around, I am out of ideas that don't involve considerable effort :) Thanks, Ant
[jQuery] Re: Condense this function
front what I can tell it is not looping. DJCarbon43 wrote: I'm not sure what it is that its choking on. It doesnt throw any errors in Firebug or Inspector If I do $(function() { var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) { setTimeout( function() { $(.sticky1:hidden).fadeIn(500); }, 100 * i); } }); It works fine (obviously) as its not pulling in the variable attribute ( + i + ) Basically everything in setTimeout( function() { $(.sticky1:hidden).fadeIn(500); }, 100 * i); I get, its var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) That I don't yet understand. I see that its basically saying there are 9 sticky classes. For each class, add a digit to the variable i for the classname , and multiply the timeout by i. Its ingenious, but I haven't the first idea what is broken. Basically, I have a page that I created which pulls data out of a job tracking database (doing this for free, in my spare time, to learn more about database calls, php, and js) and paints the data set that was queried down the page in sticky notes. It randomizes the color of the notes, and onload fades them in. There may be 50 stickies, or as few as one or two. Its pretty neat, and its working right now, but I'd love to better understand your method. Thanks again! D On Jan 15, 12:21 am, James Van Dyke jame...@gmail.com wrote: Let me know what's not working, and maybe I can help you out. I don't have firebug handy, so I didn't test it. On Jan 14, 11:44 pm,DJCarbon43djcarbo...@gmail.com wrote: I haven't gotten it working yet, but I understand the concept, and its brilliant! Thank you very much! On Jan 14, 11:28 pm, James Van Dyke jame...@gmail.com wrote: $(function() { var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) { setTimeout( function() { $(.sticky + i + :hidden).fadeIn(500); }, 100 * i); } }); Not sure if that's faster, but it's shorter and easier to change. On Jan 14, 11:19 pm,DJCarbon43djcarbo...@gmail.com wrote: Being a bit of a newfie, I was wondering how this function could be condensed: $(document).ready = setTimeout(function(){ $(.sticky1:hidden).fadeIn(500); }, 100); setTimeout(function(){ $(.sticky2:hidden).fadeIn(500); }, 200); setTimeout(function(){ $(.sticky3:hidden).fadeIn(500); }, 300); setTimeout(function(){ $(.sticky4:hidden).fadeIn(500); }, 400); setTimeout(function(){ $(.sticky5:hidden).fadeIn(500); }, 500); setTimeout(function(){ $(.sticky6:hidden).fadeIn(500); }, 600); setTimeout(function(){ $(.sticky7:hidden).fadeIn(500); }, 700); setTimeout(function(){ $(.sticky8:hidden).fadeIn(500); }, 800); setTimeout(function(){ $(.sticky9:hidden).fadeIn(500); }, 900); Is it possible, or is that as clean as can be? fadein time is the same accross all sticky classes, but the timeout must be different for each.
[jQuery] Re: Condense this function
ignore that, put the console.log() in the wrong place Liam Potter wrote: front what I can tell it is not looping. DJCarbon43 wrote: I'm not sure what it is that its choking on. It doesnt throw any errors in Firebug or Inspector If I do $(function() { var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) { setTimeout( function() { $(.sticky1:hidden).fadeIn(500); }, 100 * i); } }); It works fine (obviously) as its not pulling in the variable attribute ( + i + ) Basically everything in setTimeout( function() { $(.sticky1:hidden).fadeIn(500); }, 100 * i); I get, its var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) That I don't yet understand. I see that its basically saying there are 9 sticky classes. For each class, add a digit to the variable i for the classname , and multiply the timeout by i. Its ingenious, but I haven't the first idea what is broken. Basically, I have a page that I created which pulls data out of a job tracking database (doing this for free, in my spare time, to learn more about database calls, php, and js) and paints the data set that was queried down the page in sticky notes. It randomizes the color of the notes, and onload fades them in. There may be 50 stickies, or as few as one or two. Its pretty neat, and its working right now, but I'd love to better understand your method. Thanks again! D On Jan 15, 12:21 am, James Van Dyke jame...@gmail.com wrote: Let me know what's not working, and maybe I can help you out. I don't have firebug handy, so I didn't test it. On Jan 14, 11:44 pm,DJCarbon43djcarbo...@gmail.com wrote: I haven't gotten it working yet, but I understand the concept, and its brilliant! Thank you very much! On Jan 14, 11:28 pm, James Van Dyke jame...@gmail.com wrote: $(function() { var i, numStickies = 9; for (i = 1; i = numStickies; i += 1) { setTimeout( function() { $(.sticky + i + :hidden).fadeIn(500); }, 100 * i); } }); Not sure if that's faster, but it's shorter and easier to change. On Jan 14, 11:19 pm,DJCarbon43djcarbo...@gmail.com wrote: Being a bit of a newfie, I was wondering how this function could be condensed: $(document).ready = setTimeout(function(){ $(.sticky1:hidden).fadeIn(500); }, 100); setTimeout(function(){ $(.sticky2:hidden).fadeIn(500); }, 200); setTimeout(function(){ $(.sticky3:hidden).fadeIn(500); }, 300); setTimeout(function(){ $(.sticky4:hidden).fadeIn(500); }, 400); setTimeout(function(){ $(.sticky5:hidden).fadeIn(500); }, 500); setTimeout(function(){ $(.sticky6:hidden).fadeIn(500); }, 600); setTimeout(function(){ $(.sticky7:hidden).fadeIn(500); }, 700); setTimeout(function(){ $(.sticky8:hidden).fadeIn(500); }, 800); setTimeout(function(){ $(.sticky9:hidden).fadeIn(500); }, 900); Is it possible, or is that as clean as can be? fadein time is the same accross all sticky classes, but the timeout must be different for each.
[jQuery] Re: .append() into style element causes error in IE only
That's been a real help, thanks so much Ant On Jan 15, 4:36 pm, Ricardo Tomasi ricardob...@gmail.com wrote: appendChild on a style element fails on IE and you get an unknown error if you try to modify it's innerHTML. I haven't found any workaround. Use this to add styles: //addStyles 0.1 // Ricardo Tomasi ricardobeat at gmail com // Licensed under the WTFPL -http://sam.zoy.org/wtfpl/ function addStyles(rule){ var sheet = document.styleSheets[0], ln = (sheet.cssRules||sheet.rules).length; if (sheet.addRule) { rule = rule.match(/(.*){(.*)}/); sheet.addRule(rule[1],rule[2], ln); } else { sheet.insertRule(rule, ln); }; return arguments.callee;}; addStyle(#div{display:none}); the 'return arguments.callee' line is there to allow for some funky construction, you can remove it if you want: addStyle ('div { background: xxx }') ('.menu { whatever: #45 }') ('.hold { float: left }') This script will insert rules at the end of the stylesheet, that's important so that you can override earlier styles. cheers, - ricardo On Jan 15, 8:07 am, Ant kalli...@gmail.com wrote: Hi, Yea, I went for adding a new style element for every new style, which works, but isn't as neat as I was hoping for. I was trying to append a string into the style element: HTML style type=text/css body{color:#333;} /style JS $(style).append(#content{color:#f00;}); In Firefox, this adds #content(color:#f00;} beneath the body declaration. Which is what I would expect to happen. In IE I get an error thrown in jquery-1.3b2.js It may well be that my expectations of append are wrong, if so, it would be a useful thing for me to know as I am quite new to jQuery. Many thanks for your time, Ant Ricardo Tomasi wrote: What are you trying to append? You can only append textnodes to a style element. Why not use the stylesheet object directly: document.styleSheets[0].insertRule(#wrapper {display:none}, 0) // 'addRule' on IE Or, for a hassle-free alternative, create a new style element for it: $('style type=text/css/style').text(myClass).appendTo('head'); On Jan 14, 12:05 pm, Ant kalli...@gmail.com wrote: Hi, I am trying to append css into a pre existing style element. $(style).append(myClass); This works as expected in Firefox, but not IE. The HTML on the page validates to HTML strict, so I'm fairly sure that it's not the issue with IE that append() won't work on incorrectly written elements. If I change my code to $(p).append(myClass); it works as expected. Was just wondering if this is a know issue with IE or jQuery and if anyone had a work around, I am out of ideas that don't involve considerable effort :) Thanks, Ant
[jQuery] Re: :last :first not working??
Check out the :last-child selector http://docs.jquery.com/Selectors/lastChild and if it doesn't work, then start small... copy the example HTML from the link above and have a page with nothing but that, so you see it works in your environment. something else codewise (wrong selector, some conflict, whatever) is causing an issue On Jan 15, 11:32 am, the cliff leperisl...@gmail.com wrote: Thanks for this, I tried it and firebug tells me it didn't work :( The thing is :last doesnt seem to work AT ALL for me, EG: $(ul li:last).css(border, 1px solid red); does absolutely nothing On Jan 15, 4:06 pm, MorningZ morni...@gmail.com wrote: that will get the :last(or :first) for the first row only as it will return 1 single object you need to do something like $(tr).each(function() { $(this).find(td:last).css(border, none); }); which will loop across each row and do the code to thelastor first object On Jan 15, 9:05 am, the cliff leperisl...@gmail.com wrote: Hi there, I am doing some table row colouring with :odd (this works as expected), but: $(tr td:last).css(border, none); does nothing! I did some further testing on other selectors with other more obvious classes and the selector :lastand :first don't seem to select anything. I have tried this with jQuery 1.2 and 1.3. Any help would be appreciated, thanks
[jQuery] Re: Possible 1.3 bug
That worked for me Balazs. Thanks for your help. If anyone is having a problem with this feel free to contact me about it. -Tim On Jan 15, 10:01 am, Balazs Endresz balazs.endr...@gmail.com wrote: In jquery.liveFilter.js a pseudo selector defined as a string, which was deprected since 1.2 if I remember right. jQuery.extend( jQuery.expr[':'], { insContains : jQuery(a).text().toUpperCase().indexOf(m [3].toUpperCase())=0 }); This should be a function instead: jQuery.expr[':'].insContains = function(a,i,m){ return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())=0 } On Jan 15, 4:09 pm, tpb976 tpb...@gmail.com wrote: It seems the problem has to do with creating custom selectors. I have a custom selector that I created and I am receiving this exact error. I am currently looking into the problem to see what I can figure out. On Jan 15, 9:05 am, Diego diego.a...@gmail.com wrote: Hi (me again), the problem was being caused by the moreSelectors plugin on this page:http://www.softwareunity.com/jquery/JQueryMoreSelectors/ On Jan 15, 2:40 pm, Diego diego.a...@gmail.com wrote: FYI. I found my offending code. It's a combination of these selectors: :text, :password, :file, :select, :button I just can't figure out why! On Jan 15, 7:39 am, emmj...@gmail.com emmj...@gmail.com wrote: I was checking all of my random plugins/scripts to make sure they all work with jQuery 1.3 and I found one that is having problems. An example of it is available at:http://digitalinferno.net/temp/ If you enter some text into the input firebug will report that filter is not a function in http://digitalinferno.net/temp/js/jquery.jsonline1961 Anyone know if this is a bug or if I have to change something in my code for the new 1.3 release?