[jQuery] Re: Solution To Many Of Your CSS Nightmares!
yes, uwe, as i mentioned, if your 3rd-party css does not use unique id's or classes, then 'important' in the 3rd-party css could affect your main site-rendering. but in most cases, 3rd-party candy DOES use unique classes or id's, in which case there's no problem.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
if your 3rd-party css does not use unique id's or classes, then you could create your own (which will enable you to use !important): 1. locate the html for the candy, in your site's html pages. 2. surround it with a div with an id that does not appear anyplace in the rest of your site: div id=candy.../div 3. open each of the candy's css files, and precede every element with #candy: #candy ul li { width: 100% !important; } DONE! If the candy appears throughout the site, then you can use a class- name instead of an id name.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
if your 3rd-party css does not use unique id's or classes, then you could create your own (which will enable you to use !important): 1. locate the html for the candy, in your site's html pages. 2. surround it with a div with an id that does not appear anyplace in the rest of your site: div id=candy.../div 3. open each of the candy's css files, and precede every element with that same id: #candy ul li { width: 100% !important; } DONE! If the candy appears more than once on your site, then do the same thing with a class-name instead of an id name, and use .candy instead of #candy in the css files.
[jQuery] Use a function on code loaded with AJAX
Hi, I am trying to use a click.function on a piece of code that has been loaded with AJAX. I can't imagine how to do this at the moment. Any tipps? Thanks, Michael
[jQuery] Re: Use a function on code loaded with AJAX
paddelboot ha scritto: Hi, I am trying to use a click.function on a piece of code that has been loaded with AJAX. I can't imagine how to do this at the moment. Any tipps? Thanks, Michae You can achieve this in 3 ways. 1. With jquery 1.3 : $(document).ready(function() { $(p).live(click, function(){ alert('this is a paragraph') }); }); In this way every p that exist in DOM (even if added after the document has loaded), has a click function binded to itself. 2. If you have jquery 1.3 you can do the same thing using the livequery plugin, after including it you can call $(document).ready(function() { $(p).livequery(click, function(){ alert('this is a paragraph') }); }); 3. If you don't want to use this way you have to bind the function to the element in the onsuccess function: $.ajax({ type: POST, url: some.php, data: name=Johnlocation=Boston, success: function(msg){ $(p).click(function() { alert('this is a paragraph') }); } }); Now you have only to choose the method and change the p selector with your own selector. Bye -- gianiaz.net - web solutions via angelo custode, 10 - 23100 sondrio (so) - italy +39 347 7196482
[jQuery] abort an animation?
How can I abort an animation? I have a slow fadeOut() on an element. Under some conditions I would like to stop the fadeout and show the element without any transparency. How can I do this? Stephan
[jQuery] Re: Use a function on code loaded with AJAX
Thanks for the answer, I found the FAQ's meanwhile On 17 Jan., 11:12, Giovanni Battista Lenoci gian...@gmail.com wrote: paddelboot ha scritto: Hi, I am trying to use a click.function on a piece of code that has been loaded with AJAX. I can't imagine how to do this at the moment. Any tipps? Thanks, Michae You can achieve this in 3 ways. 1. With jquery 1.3 : $(document).ready(function() { $(p).live(click, function(){ alert('this is a paragraph') }); }); In this way every p that exist in DOM (even if added after the document has loaded), has a click function binded to itself. 2. If you have jquery 1.3 you can do the same thing using the livequery plugin, after including it you can call $(document).ready(function() { $(p).livequery(click, function(){ alert('this is a paragraph') }); }); 3. If you don't want to use this way you have to bind the function to the element in the onsuccess function: $.ajax({ type: POST, url: some.php, data: name=Johnlocation=Boston, success: function(msg){ $(p).click(function() { alert('this is a paragraph') }); } }); Now you have only to choose the method and change the p selector with your own selector. Bye -- gianiaz.net - web solutions via angelo custode, 10 - 23100 sondrio (so) - italy +39 347 7196482
[jQuery] [jquery]Need help in Simple Jquery Function I develop for tabs
Hi, I am stuck up with this function to make simple Tabs. It works absolutely fine only with the first two tabs. Can someone please observe the code and reply the problem. Below d stands for the header(div) in which the links are, e for the targeted content(div), and f for the sequence number. script function TabTasTic(d,e,f){ $('#'+ d +' a').css({background: '#ff'}); $('#'+ e +' div').hide(); $('#'+ e +' div').eq(f).show(); $('#'+ d +' a').eq(f).css({background: '#00'}); } /script div class=header id=header a href=javascript:TabTasTic('header','content','0');Tab1/a a href=javascript:TabTasTic('header','content','1');Tab2/a a href=javascript:TabTasTic('header','content','2');Tab3/a a href=javascript:TabTasTic('header','content','3');Tab2/a /div div class=content id=content divT1/div divT2/div divT3/div divT4/div /div
[jQuery] Re: abort an animation?
You can call .stop() to stop an animation, and .css('opacity', 1) to remove transparency. Cheers, Jesse Skinner www.thefutureoftheweb.com On Sat, Jan 17, 2009 at 11:13 AM, Stephan Veigl stephan.ve...@gmail.comwrote: How can I abort an animation? I have a slow fadeOut() on an element. Under some conditions I would like to stop the fadeout and show the element without any transparency. How can I do this? Stephan
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
One thing to keep in mind: If two declarations use !important! the conflict is solved by specificity again, e.g. as if there were no ! important: div id=foo class=bar #foo { width: 200px !important; /* higher specificity */ } .bar { width: 300px !important; } Applied width will be 200px. --Klaus On 17 Jan., 06:31, johny why johny...@gmail.com wrote: trying to integrate a 3rd party css candy into your site may result in conflicts between the candy's css and your site's css, resulting in a rendering mess. stuff that works beautifully by itself blows up when you put it into your website. this trick may not find you a new girlfriend, or butter your bread on both sides, !BUT¡ it may instantly eliminate your css conflicts. it instantly eliminated ALL of the rendering conflicts i was having with superfish (and other css menus), when trying to integrate them into my site. SOLUTION: open all your css files, and globally replace: ; with !important; THAT'S IT! (don't forget the space before !important;) for example, this: top: -999em; will become: top: -999em !important; HOW IT WORKS: the !important property forces that style to override all other css, whether style-sheets, inline-css, header-styles, and whether above or below in the css hierarchy. badabing! http://users.tpg.com.au/j_birch/plugins/superfish/http://inyourear.org
[jQuery] Re: abort an animation?
thanks 2009/1/17 Jesse Skinner je...@thefutureoftheweb.com: You can call .stop() to stop an animation, and .css('opacity', 1) to remove transparency. Cheers, Jesse Skinner www.thefutureoftheweb.com On Sat, Jan 17, 2009 at 11:13 AM, Stephan Veigl stephan.ve...@gmail.com wrote: How can I abort an animation? I have a slow fadeOut() on an element. Under some conditions I would like to stop the fadeout and show the element without any transparency. How can I do this? Stephan
[jQuery] Re: Can I override ui.draggable?
You can attach data to each draggable HTML element (eg. a big div or table) using the .data() jQuery function. Then when an element is dropped, you can use .data() again to retrieve the object attached to it and use that data for processing/saving/etc. I hope that helps. Cheers, Jesse Skinner www.thefutureoftheweb.com On Fri, Jan 16, 2009 at 11:13 PM, alphadog alphad...@gmail.com wrote: So, if I understand correctly, when I create a droppable, and it gets triggered by a draggable, the drop callback gets access to the draggable via ui.draggable. ui.draggable seem to wrap up the child tags of whatever tag got labeled as a draggable. This works well if you are dragging one tag, not so well if you want to drag complex data represented by a big div or table. Is there a way to somehow override ui.draggable? Ideally, I'd like the drop to see a JSON object instead of a messy pile of HTML.
[jQuery] Re: Plugin problem with mouseover/mouseout and setTimout
Check out this code, I'm using it to show a popup (#add_popup) and fade out if the mousepointer is out for more than 1 second. At the moment it's just a QuickDitry hack. Just to give you a clue. $(div).dblclick(function(ev){ timer = $(#add_popup).data(popup-timer); if (timer) { clearTimeout(timer); $(#add_popup) .stop() .css('opacity', 1) .data(popup-timer,0); } $(#add_popup) .show() .css({'top': ev.pageY-40, 'left': ev.pageX-10}) .data(popup-timer, 0) .bind(mouseleave, function(ev){ var timer = $(this).data(popup-timer); if (timer) clearTimeout(timer); timer = setTimeout( function(){ $(#add_popup).fadeOut(slow); }, 1000); $(this).data(popup-timer, timer); }) .bind(mouseenter, function(ev){ var timer = $(this).data(popup-timer); if (timer) clearTimeout(timer); $(this) .stop() .css('opacity', 1) .data(popup-timer, 0); }); });
[jQuery] Re: Problems with the New API Browser - Bug in AIR APP
@rem I've tried contacting you on twitter, but I'm new to it, and don't know If you received my message. I've installed the AIR api browser, and I love it, but when I open it the dimensions of the windows are greater than my desktop resolution (1280x800 on windows xp). Here you can see a screenshot, hope you can fix it. http://lab.gianiaz.com/apibrowser.jpg (I can use it doing a dx click on the button on the taskbar and click on maximixe). Thank you. -- gianiaz.net - web solutions via angelo custode, 10 - 23100 sondrio (so) - italy +39 347 7196482
[jQuery] Images resize problem with Aajx
My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); } }); }); //-- /script /body /html
[jQuery] Re: Images resize problem with Aajx
If the image is not loaded by the time you call .height() function it returns 0. Since your code is run right after the ajax request is completed browser has no idea what is the size of that images. Tip: You could bind a .load() event to your images and change the size of that particular image on its load. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:34 PM, David .Wu chan1...@gmail.com wrote: My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); } }); }); //-- /script /body /html
[jQuery] jQuery 1.3 selector :first; :first-child
Hi all, I have trouble in jQuery 1.3 with :first; :first-child selector. Always it selects all a. In version 1.2.6 it worked by suspense. What is new or wrong?? Thx for help. $(function(){ $('#menu li a:first-child').remove(); });
[jQuery] Re: jQuery 1.3 live() vs listen/intercept plugins
live is very similar to Intercept. It bubbles up using closest(). Listen is faster and specially more scalable, but supports a small subset of selectors. It can also bubble up if you specify so. -- Ariel Flesler http://flesler.blogspot.com On Jan 16, 5:58 pm, rolfsf rol...@gmail.com wrote: I'm trying to understand where the new live() fits in to the world of event delegation, and plugins like listen and intercept What are the arguments for one approach over the other? thanks!
[jQuery] Re: .live help needed
The idea is that you don't need to call live every time, it works persistently. Just call it at start and it should keep on working. -- Ariel Flesler http://flesler.blogspot.com On Jan 16, 6:57 pm, seasoup seas...@gmail.com wrote: I'm playing around with the new .live functionality. it seems very cool. I have a page that gets refreshed with ajax with a .live getting set for a list of links every time, so I need to call .die but .dies doesn't seem to be working... $('a[name=prioritya]').die('click', currFxn); $('a[name=prioritya]').live('click', currFxn); I don't think it matters what currFxn does, but it is a defined function. Any idea why .die isn't working? Secondly, if I call $('a[name=prioritya]').die('click'); does that remove all live 'click' events from the page, or just those registered to a[name=prioritya]? Thanks, Josh Powell
[jQuery] Re: jQuery 1.3 selector :first; :first-child
Just checked. Works just fine. Maybe something wrong in your html? Could you paste it here? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 6:26 PM, Charlie22 ch...@post.cz wrote: Hi all, I have trouble in jQuery 1.3 with :first; :first-child selector. Always it selects all a. In version 1.2.6 it worked by suspense. What is new or wrong?? Thx for help. $(function(){ $('#menu li a:first-child').remove(); });
[jQuery] Re: [jquery]Need help in Simple Jquery Function I develop for tabs
I have just created html with your content and js. It works just fine. ALL tabs work fine... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 3:30 PM, Yuvraj Mathur sa...@spicyspy.com wrote: Hi, I am stuck up with this function to make simple Tabs. It works absolutely fine only with the first two tabs. Can someone please observe the code and reply the problem. Below d stands for the header(div) in which the links are, e for the targeted content(div), and f for the sequence number. script function TabTasTic(d,e,f){ $('#'+ d +' a').css({background: '#ff'}); $('#'+ e +' div').hide(); $('#'+ e +' div').eq(f).show(); $('#'+ d +' a').eq(f).css({background: '#00'}); } /script div class=header id=header a href=javascript:TabTasTic('header','content','0');Tab1/a a href=javascript:TabTasTic('header','content','1');Tab2/a a href=javascript:TabTasTic('header','content','2');Tab3/a a href=javascript:TabTasTic('header','content','3');Tab2/a /div div class=content id=content divT1/div divT2/div divT3/div divT4/div /div
[jQuery] Re: Hide content until loaded
// fired right away $('tn-hide').css('display', 'none').addClass('tn-loading'); $(document).ready(function() { // fired on DOM ready }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 9:53 AM, Christine Masters cmast...@townnews.com wrote: Hi everyone! I'm a jQuery newbie, so I apologize if this is an easy question! I'm building a template for newspaper sites, and by nature of having many ads and modules and so forth, the content loads before the jQuery that styles it, leading to a flash of unstyled content. So, on several of my modules that use a lot of jQuery, I'd like to hide them until they are loaded. Right now, I'm trying to do this: $('tn-hide').css('display', 'none').addClass('tn-loading'); $(document).ready(function() { $('tn-hide').css('display', 'block').removeClass('tn-loading); }); I'd like to be able to simply apply the 'tn-hide' class to any module I'd like to hide until loaded on the page. It is my (limited) understanding that the first line will go into effect when the DOM is ready and the second when the document is ready. Anyway, right now it isn't working. I'd appreciate it if you could give me any insight on this or let me know if I'm heading in the right direction. If it helps, here is my page: http://blueprints.townnews-cms.com/ Christine Masters, Product Manager, TownNews.com cmast...@townnews.com | 1-800-293-9576 x1022 Twitter: c_masters
[jQuery] Re: jQuery 1.3 - am I missing something or is this a bug?
I have just spent about 5 minutes trying to select elements without . and also tried to select classes with different capitalization. None could be selected... Works just fine, as it should be!!! I am getting my jquery from: http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 8:25 AM, B J Pohl bjp...@gmail.com wrote: Upgraded to 1.3 on my site today and found that previously working code is broken. The issue is that I was using a selector of $ ('.aComment') to get, not surprisingly, elements with a class of 'aComment' . This worked great with 1.2.6. However, with some tinkering, I have found that I can user $('acomment') to select these nodes with 1.3 . Question is, is the expected behavior or a bug? I'm pretty new to a lot of this stuff so I acknowledge my ignorance in advance. However, I thought it a weird change in behavior. Can someone give me some feedback? If this is a bug, I'll do my best to submit it (and maybe even try a fix). If it isn't, can someone explain to me why the different behavior between 1.2.6 and 1.3? Thanks! B.J.
[jQuery] Re: jQuery 1.3 selector :first; :first-child
code: div id=menuContent ul id=menu lia href=index.phpHome/a/li lia href=rules.phpRules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div On Jan 17, 2:40 pm, jQuery Lover ilovejqu...@gmail.com wrote: Just checked. Works just fine. Maybe something wrong in your html? Could you paste it here? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 6:26 PM, Charlie22 ch...@post.cz wrote: Hi all, I have trouble in jQuery 1.3 with :first; :first-child selector. Always it selects all a. In version 1.2.6 it worked by suspense. What is new or wrong?? Thx for help. $(function(){ $('#menu li a:first-child').remove(); });
[jQuery] JSONP
Hello! I'd like to use $.getJSON with JSONP support, but i used http://example.com/xxx/yyy URL sheme instead of http://example.com/index.php?a=xxxb=yyy. I read in documentation, in the 'myurl?callback=?' syntax the ? replaces to the callback name. I tried this: http://example.com/xxx/yyy/? but don't works. I tracking the connection with FireFox's LiveHttpHeaders plugin, and I see jquery don't replaces ? to callback name, only send the http://example.com/xxx/yyy/? url without any change. How can I use JSONP support with this type of URL-s?
[jQuery] Superfish - left module size
I try to apply superfish to a template based on aha_editionblack (google for the link). when publishing superfish-vertical to the left module, the module borders are drawn incorrectly, as if the superfish menu would not contain any items. i went through all css and php files, but cannot find what is different when applying the main module. The rest of the menu and the drop downs display correctly, after i have removed the overflow:hidden from the left module. any ideas?
[jQuery] [jQuery V1.3] will lead behavior for IE to lose efficacy
Dear all, I use some behavior hack, like the famous Whatever:hover (http:// www.xs4all.nl/~peterned/csshover.html), when I upgrade jQuery to v1.3, it cause this hack to lose efficacy, but works well under jquery v1.2. any body? meet the same problem with me?
[jQuery] Re: Hide content until loaded
Why not do it with CSS? where css class tn-loading has display: none declared div class=tn-hide tn-loading Content you are hiding until document ready /div then $(document).ready(function() { //Do some stuff here //Done doing stuff, show the content $('tn-hide').removeClass('tn-loading); }); On Jan 16, 11:53 pm, Christine Masters cmast...@townnews.com wrote: Hi everyone! I'm a jQuery newbie, so I apologize if this is an easy question! I'm building a template for newspaper sites, and by nature of having many ads and modules and so forth, the content loads before the jQuery that styles it, leading to a flash of unstyled content. So, on several of my modules that use a lot of jQuery, I'd like to hide them until they are loaded. Right now, I'm trying to do this: $('tn-hide').css('display', 'none').addClass('tn-loading'); $(document).ready(function() { $('tn-hide').css('display', 'block').removeClass('tn-loading); }); I'd like to be able to simply apply the 'tn-hide' class to any module I'd like to hide until loaded on the page. It is my (limited) understanding that the first line will go into effect when the DOM is ready and the second when the document is ready. Anyway, right now it isn't working. I'd appreciate it if you could give me any insight on this or let me know if I'm heading in the right direction. If it helps, here is my page:http://blueprints.townnews-cms.com/ Christine Masters, Product Manager, TownNews.com cmast...@townnews.com | 1-800-293-9576 x1022 Twitter: c_masters
[jQuery] Re: Hide content until loaded
*http://tinyurl.com/8rwmkr* On Sat, Jan 17, 2009 at 8:13 PM, MorningZ morni...@gmail.com wrote: Why not do it with CSS? where css class tn-loading has display: none declared div class=tn-hide tn-loading Content you are hiding until document ready /div then $(document).ready(function() { //Do some stuff here //Done doing stuff, show the content $('tn-hide').removeClass('tn-loading); }); On Jan 16, 11:53 pm, Christine Masters cmast...@townnews.com wrote: Hi everyone! I'm a jQuery newbie, so I apologize if this is an easy question! I'm building a template for newspaper sites, and by nature of having many ads and modules and so forth, the content loads before the jQuery that styles it, leading to a flash of unstyled content. So, on several of my modules that use a lot of jQuery, I'd like to hide them until they are loaded. Right now, I'm trying to do this: $('tn-hide').css('display', 'none').addClass('tn-loading'); $(document).ready(function() { $('tn-hide').css('display', 'block').removeClass('tn-loading); }); I'd like to be able to simply apply the 'tn-hide' class to any module I'd like to hide until loaded on the page. It is my (limited) understanding that the first line will go into effect when the DOM is ready and the second when the document is ready. Anyway, right now it isn't working. I'd appreciate it if you could give me any insight on this or let me know if I'm heading in the right direction. If it helps, here is my page:http://blueprints.townnews-cms.com/ Christine Masters, Product Manager, TownNews.com cmast...@townnews.com | 1-800-293-9576 x1022 Twitter: c_masters
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
right, Klaus, specificity resolves conflicts. which could be an issue, if your main site css uses !important on any element which conflicts with your candy css. fortunately, !important seems to be used rarely, so that's probably not going to be an issue. if, by rare chance, your site's css has a conflicting !important, then you might be able to override it with some javascript or runtimeStyle. but, if your candy's css has conflicting declarations WITHIN ITSELF, then, unless it's a bug in the candy, it's a conflict intended to be resolved by specificity-- and applying !important to all elements within the candy will have no effect on the intended behavior of the candy.
[jQuery] Re: Images resize problem with Aajx
please tell me more tips, I don't really understand what to do. On 1月17日, 下午9時21分, jQuery Lover ilovejqu...@gmail.com wrote: If the image is not loaded by the time you call .height() function it returns 0. Since your code is run right after the ajax request is completed browser has no idea what is the size of that images. Tip: You could bind a .load() event to your images and change the size of that particular image on its load. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:34 PM, David .Wu chan1...@gmail.com wrote: My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); } }); }); //-- /script /body /html
[jQuery] Re: jQuery 1.3 - am I missing something or is this a bug?
Thanks for looking into this! First off, I have complicated my question by not being careful with my reporting: The selector that *did* work in fact used a '.' (I missed it above... i.e. $('acomment') should be $('.acomment')) Sorry about that. Further experimenting shows that this behavior is browser specific. I see the described behavior in Chrome, but not in IE7. (In fact, I've had to revert to 1.2.6 because the behavior is inconsistent between browsers). I believe it is related to a bug that has been reported concerning capitals in class names with Safari(i.e. WebKit): http://dev.jquery.com/ticket/3840 Anyway, thanks for the feedback! On Jan 17, 8:02 am, jQuery Lover ilovejqu...@gmail.com wrote: I have just spent about 5 minutes trying to select elements without . and also tried to select classes with different capitalization. None could be selected... Works just fine, as it should be!!! I am getting my jquery from:http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 8:25 AM, B J Pohl bjp...@gmail.com wrote: Upgraded to 1.3 on my site today and found that previously working code is broken. The issue is that I was using a selector of $ ('.aComment') to get, not surprisingly, elements with a class of 'aComment' . This worked great with 1.2.6. However, with some tinkering, I have found that I can user $('acomment') to select these nodes with 1.3 . Question is, is the expected behavior or a bug? I'm pretty new to a lot of this stuff so I acknowledge my ignorance in advance. However, I thought it a weird change in behavior. Can someone give me some feedback? If this is a bug, I'll do my best to submit it (and maybe even try a fix). If it isn't, can someone explain to me why the different behavior between 1.2.6 and 1.3? Thanks! B.J.
[jQuery] Re: Images resize problem with Aajx
aha, I understand, it's work, thanks :) $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); On 1月17日, 下午9時21分, jQuery Lover ilovejqu...@gmail.com wrote: If the image is not loaded by the time you call .height() function it returns 0. Since your code is run right after the ajax request is completed browser has no idea what is the size of that images. Tip: You could bind a .load() event to your images and change the size of that particular image on its load. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:34 PM, David .Wu chan1...@gmail.com wrote: My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); } }); }); //-- /script /body /html
[jQuery] Re: jQuery 1.3 - am I missing something or is this a bug?
Wow, thanks for the link and clearing out. That's something new I learned today :) Thanks again. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 9:34 PM, B J Pohl bjp...@gmail.com wrote: Thanks for looking into this! First off, I have complicated my question by not being careful with my reporting: The selector that *did* work in fact used a '.' (I missed it above... i.e. $('acomment') should be $('.acomment')) Sorry about that. Further experimenting shows that this behavior is browser specific. I see the described behavior in Chrome, but not in IE7. (In fact, I've had to revert to 1.2.6 because the behavior is inconsistent between browsers). I believe it is related to a bug that has been reported concerning capitals in class names with Safari(i.e. WebKit): http://dev.jquery.com/ticket/3840 Anyway, thanks for the feedback! On Jan 17, 8:02 am, jQuery Lover ilovejqu...@gmail.com wrote: I have just spent about 5 minutes trying to select elements without . and also tried to select classes with different capitalization. None could be selected... Works just fine, as it should be!!! I am getting my jquery from:http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 8:25 AM, B J Pohl bjp...@gmail.com wrote: Upgraded to 1.3 on my site today and found that previously working code is broken. The issue is that I was using a selector of $ ('.aComment') to get, not surprisingly, elements with a class of 'aComment' . This worked great with 1.2.6. However, with some tinkering, I have found that I can user $('acomment') to select these nodes with 1.3 . Question is, is the expected behavior or a bug? I'm pretty new to a lot of this stuff so I acknowledge my ignorance in advance. However, I thought it a weird change in behavior. Can someone give me some feedback? If this is a bug, I'll do my best to submit it (and maybe even try a fix). If it isn't, can someone explain to me why the different behavior between 1.2.6 and 1.3? Thanks! B.J.
[jQuery] Re: Images resize problem with Aajx
I got one more question, actually I need to clone the result of $td1 into another $td2, how to do it after the load function finish. $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); $tbl1.clone().prependTo($td2); On 1月18日, 上午12時43分, David .Wu chan1...@gmail.com wrote: aha, I understand, it's work, thanks :) $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); On 1月17日, 下午9時21分, jQuery Lover ilovejqu...@gmail.com wrote: If the image is not loaded by the time you call .height() function it returns 0. Since your code is run right after the ajax request is completed browser has no idea what is the size of that images. Tip: You could bind a .load() event to your images and change the size of that particular image on its load. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:34 PM, David .Wu chan1...@gmail.com wrote: My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); } }); }); //-- /script /body /html
[jQuery] Re: Images resize problem with Aajx
I got one more question, actually I need to clone the result of $td1 into another $td2, how to do it after the load function finish. $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); $tbl1.clone().prependTo($td2); On 1月18日, 上午12時43分, David .Wu chan1...@gmail.com wrote: aha, I understand, it's work, thanks :) $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); On 1月17日, 下午9時21分, jQuery Lover ilovejqu...@gmail.com wrote: If the image is not loaded by the time you call .height() function it returns 0. Since your code is run right after the ajax request is completed browser has no idea what is the size of that images. Tip: You could bind a .load() event to your images and change the size of that particular image on its load. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:34 PM, David .Wu chan1...@gmail.com wrote: My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); } }); }); //-- /script /body /html
[jQuery] Re: Hide content until loaded
Saif, do you have a point or is this spam? MorningZ, I am sure you did not have time to go into much details just like me with my first post :) Christine, MorningZ suggested (IMO) the best way to do it. Just keep in mind those users that do not have js enabled. Add some id or class to your body tag USING JAVASCRIPT. For example a js id and in your CSS add rules that make your blocks display none. #js .tn-hide{ display:none; } This will make sure those users with js disabled will ALSO see your hidden blocks. PS. It's surprising how many company system administrators disable js in browser for security sake. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 8:16 PM, Saif ullah saifullahha...@gmail.com wrote: http://tinyurl.com/8rwmkr On Sat, Jan 17, 2009 at 8:13 PM, MorningZ morni...@gmail.com wrote: Why not do it with CSS? where css class tn-loading has display: none declared div class=tn-hide tn-loading Content you are hiding until document ready /div then $(document).ready(function() { //Do some stuff here //Done doing stuff, show the content $('tn-hide').removeClass('tn-loading); }); On Jan 16, 11:53 pm, Christine Masters cmast...@townnews.com wrote: Hi everyone! I'm a jQuery newbie, so I apologize if this is an easy question! I'm building a template for newspaper sites, and by nature of having many ads and modules and so forth, the content loads before the jQuery that styles it, leading to a flash of unstyled content. So, on several of my modules that use a lot of jQuery, I'd like to hide them until they are loaded. Right now, I'm trying to do this: $('tn-hide').css('display', 'none').addClass('tn-loading'); $(document).ready(function() { $('tn-hide').css('display', 'block').removeClass('tn-loading); }); I'd like to be able to simply apply the 'tn-hide' class to any module I'd like to hide until loaded on the page. It is my (limited) understanding that the first line will go into effect when the DOM is ready and the second when the document is ready. Anyway, right now it isn't working. I'd appreciate it if you could give me any insight on this or let me know if I'm heading in the right direction. If it helps, here is my page:http://blueprints.townnews-cms.com/ Christine Masters, Product Manager, TownNews.com cmast...@townnews.com | 1-800-293-9576 x1022 Twitter: c_masters
[jQuery] Re: Images resize problem with Aajx
Didn't get exactly what you meant, but if you want to do something when loading has finished then put it into the load() function. .load(function(){ // your code }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 9:53 PM, David .Wu chan1...@gmail.com wrote: I got one more question, actually I need to clone the result of $td1 into another $td2, how to do it after the load function finish. $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); $tbl1.clone().prependTo($td2); On 1月18日, 上午12時43分, David .Wu chan1...@gmail.com wrote: aha, I understand, it's work, thanks :) $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); On 1月17日, 下午9時21分, jQuery Lover ilovejqu...@gmail.com wrote: If the image is not loaded by the time you call .height() function it returns 0. Since your code is run right after the ajax request is completed browser has no idea what is the size of that images. Tip: You could bind a .load() event to your images and change the size of that particular image on its load. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:34 PM, David .Wu chan1...@gmail.com wrote: My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); } }); }); //-- /script /body /html
[jQuery] Re: abort an animation?
On 1/17/09, pinky reddy pinky...@gmail.com wrote: On 1/17/09, Stephan Veigl stephan.ve...@gmail.com wrote: thanks 2009/1/17 Jesse Skinner je...@thefutureoftheweb.com: You can call .stop() to stop an animation, and .css('opacity', 1) to remove transparency. Cheers, Jesse Skinner www.thefutureoftheweb.com On Sat, Jan 17, 2009 at 11:13 AM, Stephan Veigl stephan.ve...@gmail.com wrote: How can I abort an animation? I have a slow fadeOut() on an element. Under some conditions I would like to stop the fadeout and show the element without any transparency. How can I do this? Stephan
[jQuery] disable column from sorting in tablesorter
I have a table in which the first column is the row number (always from 1 at the top to 100 at the bottom) so no matter how the other columns are sorted that first column should be the 'rank' for that particular sort. Is it possible to do this with tablesorter? Could I change the values in the first column after tablesorter did it's work? I see how to disable sorting on the first column but that is not what I want. Could someone suggest another way to achieve what I want? -- Everything that you can imagine is real. -- Pablo Picasso Rick Pasottor...@niof.nethttp://www.niof.net
[jQuery] Re: abort an animation?
On 1/17/09, Stephan Veigl stephan.ve...@gmail.com wrote: thanks 2009/1/17 Jesse Skinner je...@thefutureoftheweb.com: You can call .stop() to stop an animation, and .css('opacity', 1) to remove transparency. Cheers, Jesse Skinner www.thefutureoftheweb.com On Sat, Jan 17, 2009 at 11:13 AM, Stephan Veigl stephan.ve...@gmail.com wrote: How can I abort an animation? I have a slow fadeOut() on an element. Under some conditions I would like to stop the fadeout and show the element without any transparency. How can I do this? Stephan
[jQuery] Re: Images resize problem with Aajx
I mean, I want to clone the image to another place with the image resize finished, for example I load three images by ajax 1.jpg height 200px 2.jpg height 350px 3.jpg height 400px and my restriction is 180, therefore, images will resize to my rule successfully, and I want to clone it in another table at the same page, so I use jQuery clone function, the first three images resize successful but the clone one become the origin size, I guess it clone the image before it's resized, so how do I do the clone function after the resize function truly be executed. On 1月18日, 上午1時07分, jQuery Lover ilovejqu...@gmail.com wrote: Didn't get exactly what you meant, but if you want to do something when loading has finished then put it into the load() function. .load(function(){ // your code }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 9:53 PM, David .Wu chan1...@gmail.com wrote: I got one more question, actually I need to clone the result of $td1 into another $td2, how to do it after the load function finish. $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); $tbl1.clone().prependTo($td2); On 1月18日, 上午12時43分, David .Wu chan1...@gmail.com wrote: aha, I understand, it's work, thanks :) $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); On 1月17日, 下午9時21分, jQuery Lover ilovejqu...@gmail.com wrote: If the image is not loaded by the time you call .height() function it returns 0. Since your code is run right after the ajax request is completed browser has no idea what is the size of that images. Tip: You could bind a .load() event to your images and change the size of that particular image on its load. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:34 PM, David .Wu chan1...@gmail.com wrote: My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); } }); }); //-- /script /body /html
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
On 1/17/09, Klaus Hartl klaus.ha...@googlemail.com wrote: One thing to keep in mind: If two declarations use !important! the conflict is solved by specificity again, e.g. as if there were no ! important: div id=foo class=bar #foo { width: 200px !important; /* higher specificity */ } .bar { width: 300px !important; } Applied width will be 200px. --Klaus On 17 Jan., 06:31, johny why johny...@gmail.com wrote: trying to integrate a 3rd party css candy into your site may result in conflicts between the candy's css and your site's css, resulting in a rendering mess. stuff that works beautifully by itself blows up when you put it into your website. this trick may not find you a new girlfriend, or butter your bread on both sides, !BUT¡ it may instantly eliminate your css conflicts. it instantly eliminated ALL of the rendering conflicts i was having with superfish (and other css menus), when trying to integrate them into my site. SOLUTION: open all your css files, and globally replace: ; with !important; THAT'S IT! (don't forget the space before !important;) for example, this: top: -999em; will become: top: -999em !important; HOW IT WORKS: the !important property forces that style to override all other css, whether style-sheets, inline-css, header-styles, and whether above or below in the css hierarchy. badabing! http://users.tpg.com.au/j_birch/plugins/superfish/http://inyourear.org
[jQuery] Re: disable column from sorting in tablesorter
So to clarify, you always want that column to be sequentially 1 to n where n is the number of rows? and if so, and the sort is descending, would it be n to 1 ? On Jan 17, 12:10 pm, Rick Pasotto r...@niof.net wrote: I have a table in which the first column is the row number (always from 1 at the top to 100 at the bottom) so no matter how the other columns are sorted that first column should be the 'rank' for that particular sort. Is it possible to do this with tablesorter? Could I change the values in the first column after tablesorter did it's work? I see how to disable sorting on the first column but that is not what I want. Could someone suggest another way to achieve what I want? -- Everything that you can imagine is real. -- Pablo Picasso Rick Pasotto r...@niof.net http://www.niof.net
[jQuery] Re: JSONP
I am not 100% sure, but I remember reading somewhere that jQuery looks for =? to replace the ? part of the pattern. Try querying http://example.com/xxx/yyy/=? OR in case this won't work try this: http://example.com/xxx/yyy/?tmp=dummycallback=? Then on your server side get the value of callback and wrap your json with it. I hope it will work out. Please let me know how you did solve the problem... Thanks. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:36 PM, Lay András lays...@gmail.com wrote: Hello! I'd like to use $.getJSON with JSONP support, but i used http://example.com/xxx/yyy URL sheme instead of http://example.com/index.php?a=xxxb=yyy. I read in documentation, in the 'myurl?callback=?' syntax the ? replaces to the callback name. I tried this: http://example.com/xxx/yyy/? but don't works. I tracking the connection with FireFox's LiveHttpHeaders plugin, and I see jquery don't replaces ? to callback name, only send the http://example.com/xxx/yyy/? url without any change. How can I use JSONP support with this type of URL-s?
[jQuery] Re: disable column from sorting in tablesorter
On Sat, Jan 17, 2009 at 10:02:01AM -0800, MorningZ wrote: So to clarify, you always want that column to be sequentially 1 to n where n is the number of rows? Yes. and if so, and the sort is descending, would it be n to 1 ? No. the first row should always rank #1. The user can reverse the sort order if he wants to. The user wants to know the rank of some row near the middle of the table without having to manually count the rows. On Jan 17, 12:10 pm, Rick Pasotto r...@niof.net wrote: I have a table in which the first column is the row number (always from 1 at the top to 100 at the bottom) so no matter how the other columns are sorted that first column should be the 'rank' for that particular sort. Is it possible to do this with tablesorter? Could I change the values in the first column after tablesorter did it's work? I see how to disable sorting on the first column but that is not what I want. Could someone suggest another way to achieve what I want? -- Everything that you can imagine is real. -- Pablo Picasso Rick Pasotto r...@niof.net http://www.niof.net -- Our doctrine is based on private property. Communism is based on systematic plunder, since it consists in handing over to one man, without compensation, the labor of another. If it distributed to each one according to his labor, it would, in fact, recognize private property and would no longer be communism. -- Frédéric Bastiat (1801-1850) Rick Pasottor...@niof.nethttp://www.niof.net
[jQuery] How select first link??
Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div
[jQuery] Re: Images resize problem with Aajx
$img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); if(check if it the item you want to clone){ $tbl1.clone().prependTo($td2); } }); }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 10:20 PM, David .Wu chan1...@gmail.com wrote: I mean, I want to clone the image to another place with the image resize finished, for example I load three images by ajax 1.jpg height 200px 2.jpg height 350px 3.jpg height 400px and my restriction is 180, therefore, images will resize to my rule successfully, and I want to clone it in another table at the same page, so I use jQuery clone function, the first three images resize successful but the clone one become the origin size, I guess it clone the image before it's resized, so how do I do the clone function after the resize function truly be executed. On 1月18日, 上午1時07分, jQuery Lover ilovejqu...@gmail.com wrote: Didn't get exactly what you meant, but if you want to do something when loading has finished then put it into the load() function. .load(function(){ // your code }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 9:53 PM, David .Wu chan1...@gmail.com wrote: I got one more question, actually I need to clone the result of $td1 into another $td2, how to do it after the load function finish. $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); $tbl1.clone().prependTo($td2); On 1月18日, 上午12時43分, David .Wu chan1...@gmail.com wrote: aha, I understand, it's work, thanks :) $img1.load(function() { $(this).each(function() { if($(this).height() $h) $(this).height($h); }); }); On 1月17日, 下午9時21分, jQuery Lover ilovejqu...@gmail.com wrote: If the image is not loaded by the time you call .height() function it returns 0. Since your code is run right after the ajax request is completed browser has no idea what is the size of that images. Tip: You could bind a .load() event to your images and change the size of that particular image on its load. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 5:34 PM, David .Wu chan1...@gmail.com wrote: My process is 1. load images from other php file 2. put the response thing into a div 3. check all image sizes 4. resize image if the size over the restriction the problem is sometimes images resize failed, how to make sure the resize process work. html code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titledemo/title style !-- div#slide { width:100px; height:50px; overflow:hidden; } div#slide ul { margin:0px; padding:0px; list-style:none; } div#slide li { float:left; } -- /style script type=text/javascript src=js/jquery-1.2.6.js/script /head body div id=slide/div script language=javascript !-- $(document).ready(function() { $.ajax( { url:'ajax.php', type:'get', cache:false, success:function(data) { /* data will response html ul liimg src=1.jpg/li liimg src=2.jpg/li liimg src=3.jpg/li /ul */ $('div#slide').html(data); }, complete:function() { $h = 40; /* images hight restriction */ /* resize the image */ $('div#slide img').each(function() { if($(this).height() $h) $(this).height($h); }); }
[jQuery] Submitting a form with .submit() problems
Hi, I have a form that looks like this: tabletr form action=http://jquery.com; method=post id=myForm td input value=submit type=submit onclick=conversion(1000, this); return false; / /td /form /tr /table The onclick call for the button accesses code which does some special processing and then is supposed to submit the form. The form submission looks like this: jQuery(this.clickedObject).parent('form').slice(0).submit(); Problem is this won't work. I'm assuming it's because of malformed xhtml (the form tag inside the tr) however the html itself can not be changed but my JavaScript can. Unfortunately I can not use the form's id to submit the form as there are two malformed xhtml forms that run on the same code. Is there another way to get to the form tag by traversing elements in reverse order? Any help would be greatly appreciated.
[jQuery] Re: How select first link??
Removing li solves the problem: $('#menu a:first'); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:09 PM, Charlie22 ch...@post.cz wrote: Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div
[jQuery] Re: JSONP
Hello! On Sat, Jan 17, 2009 at 7:04 PM, jQuery Lover ilovejqu...@gmail.com wrote: I am not 100% sure, but I remember reading somewhere that jQuery looks for =? to replace the ? part of the pattern. Try querying http://example.com/xxx/yyy/=? Yes, this works! But need some trick, because jquery replaces to: http://example.com/xxx/yyy/=jsonp1232216220188?_=1232216222402 But this is not big problem, because in server side php with a simple regexp ( /=(.*?)\?/ ) i grab the callback name. OR in case this won't work try this: http://example.com/xxx/yyy/?tmp=dummycallback=? I don't try this because the first working, and this look like more difficult. Thank you for your idea! Lay ps.: I mean, it's better to change the documentation from ...replaces the ? with the correct method name... to replaces the =? with the '='+correct method name.
[jQuery] Re: How select first link??
I tested it, but it remove all a, so sry, it doesnt work :-( On 17 Led, 19:21, jQuery Lover ilovejqu...@gmail.com wrote: Removing li solves the problem: $('#menu a:first'); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:09 PM, Charlie22 ch...@post.cz wrote: Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] Re: disable column from sorting in tablesorter
You can write a javascript function that will add a row count column and after every table sort action will fire to clean the content of the column and repopulate it with numbers from 1 to 100. You can use tablesort's events: $(table).bind(sortEnd,function() { // write your code here }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:09 PM, Rick Pasotto r...@niof.net wrote: On Sat, Jan 17, 2009 at 10:02:01AM -0800, MorningZ wrote: So to clarify, you always want that column to be sequentially 1 to n where n is the number of rows? Yes. and if so, and the sort is descending, would it be n to 1 ? No. the first row should always rank #1. The user can reverse the sort order if he wants to. The user wants to know the rank of some row near the middle of the table without having to manually count the rows. On Jan 17, 12:10 pm, Rick Pasotto r...@niof.net wrote: I have a table in which the first column is the row number (always from 1 at the top to 100 at the bottom) so no matter how the other columns are sorted that first column should be the 'rank' for that particular sort. Is it possible to do this with tablesorter? Could I change the values in the first column after tablesorter did it's work? I see how to disable sorting on the first column but that is not what I want. Could someone suggest another way to achieve what I want? -- Everything that you can imagine is real. -- Pablo Picasso Rick Pasottor...@niof.nethttp://www.niof.net -- Our doctrine is based on private property. Communism is based on systematic plunder, since it consists in handing over to one man, without compensation, the labor of another. If it distributed to each one according to his labor, it would, in fact, recognize private property and would no longer be communism. -- Frédéric Bastiat (1801-1850) Rick Pasottor...@niof.nethttp://www.niof.net
[jQuery] Re: How select first link??
of i add .remove() of course On 17 Led, 19:32, Charlie22 ch...@post.cz wrote: I tested it, but it remove all a, so sry, it doesnt work :-( On 17 Led, 19:21, jQuery Lover ilovejqu...@gmail.com wrote: Removing li solves the problem: $('#menu a:first'); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:09 PM, Charlie22 ch...@post.cz wrote: Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div- Skrýt citovaný text - - Zobrazit citovaný text -- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] Re: How select first link??
What browser are you using? I am using firefox 3.0.5 and jquery 1.3 and it is working!!! I have just triple checked... $('#menu a:first').remove(); removes the first anchor in the list. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:33 PM, Charlie22 ch...@post.cz wrote: of i add .remove() of course On 17 Led, 19:32, Charlie22 ch...@post.cz wrote: I tested it, but it remove all a, so sry, it doesnt work :-( On 17 Led, 19:21, jQuery Lover ilovejqu...@gmail.com wrote: Removing li solves the problem: $('#menu a:first'); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:09 PM, Charlie22 ch...@post.cz wrote: Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div- Skrýt citovaný text - - Zobrazit citovaný text -- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] Re: jQuery 1.3 selector :first; :first-child
http://groups.google.com/group/jquery-en/browse_thread/thread/1c6403c5f628d45a Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 7:17 PM, Charlie22 ch...@post.cz wrote: code: div id=menuContent ul id=menu lia href=index.phpHome/a/li lia href=rules.phpRules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div On Jan 17, 2:40 pm, jQuery Lover ilovejqu...@gmail.com wrote: Just checked. Works just fine. Maybe something wrong in your html? Could you paste it here? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 6:26 PM, Charlie22 ch...@post.cz wrote: Hi all, I have trouble in jQuery 1.3 with :first; :first-child selector. Always it selects all a. In version 1.2.6 it worked by suspense. What is new or wrong?? Thx for help. $(function(){ $('#menu li a:first-child').remove(); });
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
right, Klaus, specificity resolves conflicts. if your main site css uses !important on any element which conflicts with your candy css, that could create a conflict in your candy, which would resolve in favor of the site's css-- causing your candy to display wrong! (even though you used !important). fortunately, !important seems to be used rarely, so such a conflict is unlikely to arise. if, by rare chance, your site's css has a conflicting !important, then you might be able to override it with some javascript and getOverrideStyle. (or, runtimeStyle is an IE-only option) w3.org states: getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements in the style sheets. This style sheet comes after the author style sheet in the cascade algorithm and is called override style sheet. The override style sheet takes precedence over author style sheets. An !important declaration still takes precedence over a normal declaration. Override, author, and user style sheets all may contain !important declarations. User !important rules take precedence over both override and author !important rules, and override !important rules take precedence over author ! important rules. http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-DocumentCSS in other words, an override style marked !important is the CSS of highest-precedence, in the CSS-hierarchy. if your candy's css has conflicting declarations WITHIN ITSELF, then, unless it's a bug in the candy, it's a conflict intended, by the candy designer, to be resolved by specificity-- and applying !important to ALL elements within the candy will have no effect on the intended behavior of the candy.
[jQuery] Re: Table sorter and pager problem
You must be loading your page 2 with an ajax call! Add your empty text replacer to the ajax call callback. PS. I haven't checked but I think you can rewrite your jquery code for better performance like this: $(.tablesorter).each(function() { $('tbody tr td', this).each(function() { $(this).css(width,80px); if($(this).html()==) { $(this).html('NA') } }).eq(7).click(function(){ document.location.href = $(this).html(); }); }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 8:33 AM, varun khatri.vk1...@gmail.com wrote: Hi I am using these plugins. But my problem is firefox related. while sorting I can see small images in header of table in IE(images on which we click and do sort ascending and descending ) but when I open same page in firefox it does not show images Any idea ? Also, there are some fields in the table where nothing is written so I am using Jquery to put NA where nothing is written. But it only does this on 1st page where I am showing only 10 rows Now suppose through my pager I change the option to 20 rows ... It shows NA in 1st 10 rows but after that it doesnot show NA , It shows only empty field I think when you use this : $(.tablesorter).each(function() { $(this).find(tbody).each(function() { $(this).find(tr).each(function() { $(this).find(td).each(function() { $(this).css(width,80px); if($(this).html()==) { $(this).html('NA') } }); $(this).find(td).eq(7).click(function(){ document.location.href = $(this).html(); }); }); }); }); It should put NA in the entire table ...Not just in 1st 10 rows which are shown default on page. Any ideas , any hints will help me!! Thanks Varun
[jQuery] Re: How select first link??
IE7, FF3, GoogleChrome..ok, check this page http://83.240.47.84/skyrace2/del.html On 17 Led, 19:41, jQuery Lover ilovejqu...@gmail.com wrote: What browser are you using? I am using firefox 3.0.5 and jquery 1.3 and it is working!!! I have just triple checked... $('#menu a:first').remove(); removes the first anchor in the list. Read jQuery HowTo Resource - http://jquery-howt.o.blogspot.com . On Sat, Jan 17, 2009 at 11:33 PM, Charlie22 ch...@post.cz wrote: of i add .remove() of course On 17 Led, 19:32, Charlie22 ch...@post.cz wrote: I tested it, but it remove all a, so sry, it doesnt work :-( On 17 Led, 19:21, jQuery Lover ilovejqu...@gmail.com wrote: Removing li solves the problem: $('#menu a:first'); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:09 PM, Charlie22 ch...@post.cz wrote: Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div- Skrýt citovaný text - - Zobrazit citovaný text -- Skrýt citovaný text - - Zobrazit citovaný text -- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
right, Klaus, specificity resolves conflicts. if your main site css uses !important on any element which conflicts with your candy css, that could create a conflict in your candy, which would resolve in favor of the site's css-- causing your candy to display wrong! (even though you used !important). fortunately, !important seems to be used rarely, so such a conflict is unlikely to arise. if, by rare chance, your site's css has a conflicting !important, then you might be able to override it with some javascript and getOverrideStyle. (or, runtimeStyle is an IE-only option) w3.org states: getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements in the style sheets. This style sheet comes after the author style sheet in the cascade algorithm and is called override style sheet. The override style sheet takes precedence over author style sheets. An !important declaration still takes precedence over a normal declaration. Override, author, and user style sheets all may contain !important declarations. User !important rules take precedence over both override and author !important rules, and override !important rules take precedence over author ! important rules. http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS... in other words, an override style marked !important is the CSS of highest-precedence, in the CSS-hierarchy. if your candy's css has conflicting declarations WITHIN ITSELF, then, unless it's a bug in the candy, it's a conflict intended, by the candy designer, to be resolved by specificity-- and applying !important to ALL elements within the candy will have no effect on the intended behavior of the candy—other than the joyful benefit of insulating your candy from the site’s css!
[jQuery] Re: How select first link??
The reason it's not working is you're using the first-child selector. What you're doing by using that is selecting every anchor that is the first parent of it's child (which is all of them since they lie immediately under a list item). The selector you want to be using is just first (a:first), which will return the first matched element on the document only. Cheers- Nic http://www.twitter.com/nicluciano On Sat, Jan 17, 2009 at 1:56 PM, Charlie22 ch...@post.cz wrote: IE7, FF3, GoogleChrome..ok, check this page http://83.240.47.84/skyrace2/del.html On 17 Led, 19:41, jQuery Lover ilovejqu...@gmail.com wrote: What browser are you using? I am using firefox 3.0.5 and jquery 1.3 and it is working!!! I have just triple checked... $('#menu a:first').remove(); removes the first anchor in the list. Read jQuery HowTo Resource - http://jquery-howt.o.blogspot.com . On Sat, Jan 17, 2009 at 11:33 PM, Charlie22 ch...@post.cz wrote: of i add .remove() of course On 17 Led, 19:32, Charlie22 ch...@post.cz wrote: I tested it, but it remove all a, so sry, it doesnt work :-( On 17 Led, 19:21, jQuery Lover ilovejqu...@gmail.com wrote: Removing li solves the problem: $('#menu a:first'); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:09 PM, Charlie22 ch...@post.cz wrote: Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div- Skrýt citovaný text - - Zobrazit citovaný text -- Skrýt citovaný text - - Zobrazit citovaný text -- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] Re: How select first link??
Simple correction, I meant the first child of it's parent*. Just in case it wasn't clear. Cheers- Nic http://www.twitter.com/nicluciano On Sat, Jan 17, 2009 at 2:05 PM, Nic Luciano nic.luci...@gmail.com wrote: The reason it's not working is you're using the first-child selector. What you're doing by using that is selecting every anchor that is the first parent of it's child (which is all of them since they lie immediately under a list item). The selector you want to be using is just first (a:first), which will return the first matched element on the document only. Cheers- Nic http://www.twitter.com/nicluciano On Sat, Jan 17, 2009 at 1:56 PM, Charlie22 ch...@post.cz wrote: IE7, FF3, GoogleChrome..ok, check this page http://83.240.47.84/skyrace2/del.html On 17 Led, 19:41, jQuery Lover ilovejqu...@gmail.com wrote: What browser are you using? I am using firefox 3.0.5 and jquery 1.3 and it is working!!! I have just triple checked... $('#menu a:first').remove(); removes the first anchor in the list. Read jQuery HowTo Resource - http://jquery-howt.o.blogspot.com . On Sat, Jan 17, 2009 at 11:33 PM, Charlie22 ch...@post.cz wrote: of i add .remove() of course On 17 Led, 19:32, Charlie22 ch...@post.cz wrote: I tested it, but it remove all a, so sry, it doesnt work :-( On 17 Led, 19:21, jQuery Lover ilovejqu...@gmail.com wrote: Removing li solves the problem: $('#menu a:first'); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 11:09 PM, Charlie22 ch...@post.cz wrote: Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div- Skrýt citovaný text - - Zobrazit citovaný text -- Skrýt citovaný text - - Zobrazit citovaný text -- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
right, Klaus, specificity resolves conflicts. if your main site css uses !important on any element which conflicts with your candy css, that would create a conflict in your candy, which MIGHT resolve in favor of the site's css-- causing your candy to display wrong! fortunately, !important seems to be used rarely, so such a conflict is unlikely to arise—and even then, there’s a 50% chance the candy css will win! if, by rare chance, your site's css has a conflicting !important which overpowers the candy css, then you might be able to override it with some javascript and getOverrideStyle. (or, runtimeStyle is an IE-only option) w3.org states: getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements in the style sheets. This style sheet comes after the author style sheet in the cascade algorithm and is called override style sheet. The override style sheet takes precedence over author style sheets. An !important declaration still takes precedence over a normal declaration. Override, author, and user style sheets all may contain !important declarations. User !important rules take precedence over both override and author !important rules, and override !important rules take precedence over author ! important rules. http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS... in other words, an override style marked !important is the CSS of highest-precedence, in the CSS-hierarchy. if your candy's css has conflicting declarations WITHIN ITSELF, then, unless it's a bug in the candy, it's a conflict intended, by the candy designer, to be resolved by specificity-- and applying !important to ALL elements within the candy will have no effect on the intended behavior of the candy—other than the joyful benefit of insulating your candy from the site’s css!
[jQuery] Re: How select first link??
Exactly, just like I wrote!!! $('#menu a:first').remove(); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:05 AM, Nic Luciano nic.luci...@gmail.com wrote: The reason it's not working is you're using the first-child selector. What you're doing by using that is selecting every anchor that is the first parent of it's child (which is all of them since they lie immediately under a list item). The selector you want to be using is just first (a:first), which will return the first matched element on the document only. Cheers- Nic http://www.twitter.com/nicluciano On Sat, Jan 17, 2009 at 1:56 PM, Charlie22 ch...@post.cz wrote: IE7, FF3, GoogleChrome..ok, check this page http://83.240.47.84/skyrace2/del.html On 17 Led, 19:41, jQuery Lover ilovejqu...@gmail.com wrote: What browser are you using? I am using firefox 3.0.5 and jquery 1.3 and it is working!!! I have just triple checked... $('#menu a:first').remove(); removes the first anchor in the list. Read jQuery HowTo Resource - http://jquery-howt.o.blogspot.com .
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
OFFTOP: Johny, just let it go already... :))) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:07 AM, johny why johny...@gmail.com wrote: right, Klaus, specificity resolves conflicts. if your main site css uses !important on any element which conflicts with your candy css, that would create a conflict in your candy, which MIGHT resolve in favor of the site's css-- causing your candy to display wrong! fortunately, !important seems to be used rarely, so such a conflict is unlikely to arise—and even then, there's a 50% chance the candy css will win! if, by rare chance, your site's css has a conflicting !important which overpowers the candy css, then you might be able to override it with some javascript and getOverrideStyle. (or, runtimeStyle is an IE-only option) w3.org states: getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements in the style sheets. This style sheet comes after the author style sheet in the cascade algorithm and is called override style sheet. The override style sheet takes precedence over author style sheets. An !important declaration still takes precedence over a normal declaration. Override, author, and user style sheets all may contain !important declarations. User !important rules take precedence over both override and author !important rules, and override !important rules take precedence over author ! important rules. http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS... in other words, an override style marked !important is the CSS of highest-precedence, in the CSS-hierarchy. if your candy's css has conflicting declarations WITHIN ITSELF, then, unless it's a bug in the candy, it's a conflict intended, by the candy designer, to be resolved by specificity-- and applying !important to ALL elements within the candy will have no effect on the intended behavior of the candy—other than the joyful benefit of insulating your candy from the site's css!
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
right, Klaus, specificity resolves conflicts. if your main site css uses !important on any element which conflicts with your candy css, it MIGHT resolve in favor of the site's css-- causing your candy to display wrong! fortunately, !important seems to be used rarely, so such a conflict is unlikely to arise—and even then, there’s a 50% chance the candy css will win! if, by rare chance, your site's css has a conflicting !important, then you might be able to override it with some javascript and getOverrideStyle. (or, runtimeStyle is an IE-only option) w3.org states: getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements in the style sheets. This style sheet comes after the author style sheet in the cascade algorithm and is called override style sheet. The override style sheet takes precedence over author style sheets. An !important declaration still takes precedence over a normal declaration. Override, author, and user style sheets all may contain !important declarations. User !important rules take precedence over both override and author !important rules, and override !important rules take precedence over author ! important rules. http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-DocumentCSS in other words, an override style marked !important is the CSS of highest-precedence, in the CSS-hierarchy. if your candy's css has conflicting declarations WITHIN ITSELF, then, unless it's a bug in the candy, it's a conflict intended, by the candy designer, to be resolved by specificity-- and applying !important to ALL elements within the candy will have no effect on the intended behavior of the candy—other than the joyful benefit of insulating your candy from the site’s css!
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
jquery Lover, let go of what? this technique? this thread? or my repeatedly removing and reposting the same post, because you get an email alert every time? On Jan 17, 11:10 am, jQuery Lover ilovejqu...@gmail.com wrote: OFFTOP: Johny, just let it go already... :))) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:07 AM, johny why johny...@gmail.com wrote: right, Klaus, specificity resolves conflicts. if your main site css uses !important on any element which conflicts with your candy css, that would create a conflict in your candy, which MIGHT resolve in favor of the site's css-- causing your candy to display wrong! fortunately, !important seems to be used rarely, so such a conflict is unlikely to arise—and even then, there's a 50% chance the candy css will win! if, by rare chance, your site's css has a conflicting !important which overpowers the candy css, then you might be able to override it with some javascript and getOverrideStyle. (or, runtimeStyle is an IE-only option) w3.org states: getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements in the style sheets. This style sheet comes after the author style sheet in the cascade algorithm and is called override style sheet. The override style sheet takes precedence over author style sheets. An !important declaration still takes precedence over a normal declaration. Override, author, and user style sheets all may contain !important declarations. User !important rules take precedence over both override and author !important rules, and override !important rules take precedence over author ! important rules. http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS... in other words, an override style marked !important is the CSS of highest-precedence, in the CSS-hierarchy. if your candy's css has conflicting declarations WITHIN ITSELF, then, unless it's a bug in the candy, it's a conflict intended, by the candy designer, to be resolved by specificity-- and applying !important to ALL elements within the candy will have no effect on the intended behavior of the candy—other than the joyful benefit of insulating your candy from the site's css!
[jQuery] Re: How select first link??
hmm, it seems as my stupidity :-) so there is no need use element li in this case. Originally I had code $('#menu li a:first'), but it works only under 1.2.6, not under 1.3 Am I correct? On 17 Led, 20:09, jQuery Lover ilovejqu...@gmail.com wrote: Exactly, just like I wrote!!! $('#menu a:first').remove(); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:05 AM, Nic Luciano nic.luci...@gmail.com wrote: The reason it's not working is you're using the first-child selector. What you're doing by using that is selecting every anchor that is the first parent of it's child (which is all of them since they lie immediately under a list item). The selector you want to be using is just first (a:first), which will return the first matched element on the document only. Cheers- Nic http://www.twitter.com/nicluciano On Sat, Jan 17, 2009 at 1:56 PM, Charlie22 ch...@post.cz wrote: IE7, FF3, GoogleChrome..ok, check this page http://83.240.47.84/skyrace2/del.html On 17 Led, 19:41, jQuery Lover ilovejqu...@gmail.com wrote: What browser are you using? I am using firefox 3.0.5 and jquery 1.3 and it is working!!! I have just triple checked... $('#menu a:first').remove(); removes the first anchor in the list. Read jQuery HowTo Resource - http://jquery-howt.o.blogspot.com .
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
repeatedly reposting the same comment And the idea is clear already. Use !important, but use it with care... Simple and clear... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:16 AM, johny why johny...@gmail.com wrote: jquery Lover, let go of what? this technique? this thread? or my repeatedly removing and reposting the same post, because you get an email alert every time? On Jan 17, 11:10 am, jQuery Lover ilovejqu...@gmail.com wrote: OFFTOP: Johny, just let it go already... :))) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:07 AM, johny why johny...@gmail.com wrote: right, Klaus, specificity resolves conflicts. if your main site css uses !important on any element which conflicts with your candy css, that would create a conflict in your candy, which MIGHT resolve in favor of the site's css-- causing your candy to display wrong! fortunately, !important seems to be used rarely, so such a conflict is unlikely to arise—and even then, there's a 50% chance the candy css will win! if, by rare chance, your site's css has a conflicting !important which overpowers the candy css, then you might be able to override it with some javascript and getOverrideStyle. (or, runtimeStyle is an IE-only option) w3.org states: getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements in the style sheets. This style sheet comes after the author style sheet in the cascade algorithm and is called override style sheet. The override style sheet takes precedence over author style sheets. An !important declaration still takes precedence over a normal declaration. Override, author, and user style sheets all may contain !important declarations. User !important rules take precedence over both override and author !important rules, and override !important rules take precedence over author ! important rules. http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS... in other words, an override style marked !important is the CSS of highest-precedence, in the CSS-hierarchy. if your candy's css has conflicting declarations WITHIN ITSELF, then, unless it's a bug in the candy, it's a conflict intended, by the candy designer, to be resolved by specificity-- and applying !important to ALL elements within the candy will have no effect on the intended behavior of the candy—other than the joyful benefit of insulating your candy from the site's css!
[jQuery] Re: How select first link??
Interesting but it [ $('#menu li a:first') ] does not work in 1.3 !!! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:18 AM, Charlie22 ch...@post.cz wrote: hmm, it seems as my stupidity :-) so there is no need use element li in this case. Originally I had code $('#menu li a:first'), but it works only under 1.2.6, not under 1.3 Am I correct? On 17 Led, 20:09, jQuery Lover ilovejqu...@gmail.com wrote: Exactly, just like I wrote!!! $('#menu a:first').remove(); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:05 AM, Nic Luciano nic.luci...@gmail.com wrote: The reason it's not working is you're using the first-child selector. What you're doing by using that is selecting every anchor that is the first parent of it's child (which is all of them since they lie immediately under a list item). The selector you want to be using is just first (a:first), which will return the first matched element on the document only. Cheers- Nic http://www.twitter.com/nicluciano On Sat, Jan 17, 2009 at 1:56 PM, Charlie22 ch...@post.cz wrote: IE7, FF3, GoogleChrome..ok, check this page http://83.240.47.84/skyrace2/del.html On 17 Led, 19:41, jQuery Lover ilovejqu...@gmail.com wrote: What browser are you using? I am using firefox 3.0.5 and jquery 1.3 and it is working!!! I have just triple checked... $('#menu a:first').remove(); removes the first anchor in the list. Read jQuery HowTo Resource - http://jquery-howt.o.blogspot.com .
[jQuery] Re: How select first link??
yes, that is what I said..not working, so I have to replace any scripts. I thought that #menu li a is regular CSS selector...or not?? On 17 Led, 20:23, jQuery Lover ilovejqu...@gmail.com wrote: Interesting but it [ $('#menu li a:first') ] does not work in 1.3 !!! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:18 AM, Charlie22 ch...@post.cz wrote: hmm, it seems as my stupidity :-) so there is no need use element li in this case. Originally I had code $('#menu li a:first'), but it works only under 1.2.6, not under 1.3 Am I correct? On 17 Led, 20:09, jQuery Lover ilovejqu...@gmail.com wrote: Exactly, just like I wrote!!! $('#menu a:first').remove(); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:05 AM, Nic Luciano nic.luci...@gmail.com wrote: The reason it's not working is you're using the first-child selector. What you're doing by using that is selecting every anchor that is the first parent of it's child (which is all of them since they lie immediately under a list item). The selector you want to be using is just first (a:first), which will return the first matched element on the document only. Cheers- Nic http://www.twitter.com/nicluciano On Sat, Jan 17, 2009 at 1:56 PM, Charlie22 ch...@post.cz wrote: IE7, FF3, GoogleChrome..ok, check this page http://83.240.47.84/skyrace2/del.html On 17 Led, 19:41, jQuery Lover ilovejqu...@gmail.com wrote: What browser are you using? I am using firefox 3.0.5 and jquery 1.3 and it is working!!! I have just triple checked... $('#menu a:first').remove(); removes the first anchor in the list. Read jQuery HowTo Resource - http://jquery-howt.o.blogspot.com .
[jQuery] Re: How select first link??
It is... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:27 AM, Charlie22 ch...@post.cz wrote: yes, that is what I said..not working, so I have to replace any scripts. I thought that #menu li a is regular CSS selector...or not??
[jQuery] Re: How select first link??
so why it doesnt work?? is it jQuery bug? On 17 Led, 20:30, jQuery Lover ilovejqu...@gmail.com wrote: It is... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:27 AM, Charlie22 ch...@post.cz wrote: yes, that is what I said..not working, so I have to replace any scripts. I thought that #menu li a is regular CSS selector...or not??
[jQuery] Re: How select first link??
Submitted a ticket: http://dev.jquery.com/ticket/3903 Let's see what happens :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:32 AM, Charlie22 ch...@post.cz wrote: so why it doesnt work?? is it jQuery bug? On 17 Led, 20:30, jQuery Lover ilovejqu...@gmail.com wrote: It is... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:27 AM, Charlie22 ch...@post.cz wrote: yes, that is what I said..not working, so I have to replace any scripts. I thought that #menu li a is regular CSS selector...or not??
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
jQuery Lover, i'm a programmer. i'm a perfectionist when it comes to wording. Unfortunately, google groups does not provide a draft feature, OR preview feature, OR edit-after-posting feature, which i find galling and irritating. i'll try to get my wording right before posting. secondly, the idea is not clear-- this is a conversation between several people, and we are extending the discussion with new ideas and new observations with each post. for example, my last post, if you actually read and understood, introduced the idea of resolving a conflict... i'm not going to repeat myself. no one here has been repeating themselves. are you just telling us all to shut up? that's totally out of line. this is a discussion thread. how about if your remove your unproductive, off-topic, discussion- blocking flames, and i'll remove this post, and we can both prevent this thread from turning into an infantile flame war. and next time you have an off-topic comment to make, i suggest you click reply to author instead of reply
[jQuery] Re: How select first link??
ok, thx for your help guys, because it made me crazy for a while and thx for your bug report jQuery Lover. I am new pretty new and jQuery I am using 2-3 weeks and it is great TOOL!!! On 17 Led, 20:33, jQuery Lover ilovejqu...@gmail.com wrote: Submitted a ticket:http://dev.jquery.com/ticket/3903 Let's see what happens :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:32 AM, Charlie22 ch...@post.cz wrote: so why it doesnt work?? is it jQuery bug? On 17 Led, 20:30, jQuery Lover ilovejqu...@gmail.com wrote: It is... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:27 AM, Charlie22 ch...@post.cz wrote: yes, that is what I said..not working, so I have to replace any scripts. I thought that #menu li a is regular CSS selector...or not??
[jQuery] Re: Submitting a form with .submit() problems
If I undestood the task right, you can create code in such way. You form will be like this: tabletr form action=http://jquery.com; method=post id=myForm td input value=submit type=submit onclick=conversion(1000, this); / /td /form /tr /table Convertion(1000, this) will return: true, if it`s neccesary to submit form. false, in other case. For this question: 'Is there another way to get to the form tag by traversing elements in reverse order? '.. But parents('form') returns reverse order...
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
You made a good point, I should have replied to you personally! PS. Please don't take it personal. That was (kinda) a joke. I guess we are in a better mood here and all of my friends that I MADE TO look through the the thread said 'Good one' : PSS. Nothing personal Johny... just a sunny day and a freaking good mood (she is not pregnant) :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:34 AM, johny why johny...@gmail.com wrote: how about if your remove your unproductive, off-topic, discussion- blocking flames, and i'll remove this post, and we can both prevent this thread from turning into an infantile flame war. and next time you have an off-topic comment to make, i suggest you click reply to author instead of reply
[jQuery] Re: jQuery 1.3 Released
That tests must be in average. I made some test on .class selectors and it showed 25x faster. Here is the test and it's results: http://jquery-howto.blogspot.com/2009/01/jquery-126-and-jquery-13-class-selector.html On Thu, Jan 15, 2009 at 2:03 PM, ryan.joyce...@googlemail.com ryan.joyce...@googlemail.com wrote: nice one, a 30% speed increase on selectors is impressive.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
so let's both remove our off-topic threads, ok? and no hard feelings, and glad she's not preggo - Original Message - From: jQuery Lover To: jquery-en@googlegroups.com Sent: Saturday, January 17, 2009 11:45 AM Subject: [jQuery] Re: Solution To Many Of Your CSS Nightmares! You made a good point, I should have replied to you personally! PS. Please don't take it personal. That was (kinda) a joke. I guess we are in a better mood here and all of my friends that I MADE TO look through the the thread said 'Good one' : PSS. Nothing personal Johny... just a sunny day and a freaking good mood (she is not pregnant) :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:34 AM, johny why johny...@gmail.com wrote: how about if your remove your unproductive, off-topic, discussion- blocking flames, and i'll remove this post, and we can both prevent this thread from turning into an infantile flame war. and next time you have an off-topic comment to make, i suggest you click reply to author instead of reply
[jQuery] Re: Display Loading Image While Ajax Content Loads
Yeap, you can bind all images with .gallery class a .load() event like this: $('img.gallery').load(function(){ $(this.).removeClass('loading').show(); }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Jan 16, 2009 at 10:20 PM, jinscoe jackins...@gmail.com wrote: Whoops! I'm so used to getting email notifications for discussions...I just figured no one had replied! So sorry for not coming back. Thank you both for your replies. I was wondering if that might be the case JQuery Lover. Would there be a way to generalize the .load for only images with a certain class? I tried working with the .load before and was unsuccessful, perhaps you might be able to give me a few pointers. For example if I give an image a class of gallery as well as loader I can set the background image for the loader class to a load icon. And .load would fire when any image with the class of gallery loads (right?). I guess I could give gallery' display:none by default? and then when it loads I can remove that css and also remove the class loader. I'm pretty new to all this, so I'm probably way off in my logic! Any more help would be appreciatednow to try and find the setting where I get email notifications on reply! Thanks so much again, and sorry it took me so long to reply!
[jQuery] Re: Submitting a form with .submit() problems
Actually in this case parents('form') of the clicked object does not include the form tag itself and I believe it's due to the poor html structure. I just tested this out. On Jan 17, 2:15 pm, Alex Kachayev kacha...@gmail.com wrote: If I undestood the task right, you can create code in such way. You form will be like this: tabletr form action=http://jquery.com; method=post id=myForm td input value=submit type=submit onclick=conversion(1000, this); / /td /form /tr /table Convertion(1000, this) will return: true, if it`s neccesary to submit form. false, in other case. For this question: 'Is there another way to get to the form tag by traversing elements in reverse order? '.. But parents('form') returns reverse order...
[jQuery] Re: How select first link??
hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs . On Jan 17, 2:37 pm, Charlie22 ch...@post.cz wrote: ok, thx for your help guys, because it made me crazy for a while and thx for your bug report jQuery Lover. I am new pretty new and jQuery I am using 2-3 weeks and it is great TOOL!!! On 17 Led, 20:33, jQuery Lover ilovejqu...@gmail.com wrote: Submitted a ticket:http://dev.jquery.com/ticket/3903 Let's see what happens :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:32 AM, Charlie22 ch...@post.cz wrote: so why it doesnt work?? is it jQuery bug? On 17 Led, 20:30, jQuery Lover ilovejqu...@gmail.com wrote: It is... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:27 AM, Charlie22 ch...@post.cz wrote: yes, that is what I said..not working, so I have to replace any scripts. I thought that #menu li a is regular CSS selector...or not??
[jQuery] Re: will lead behavior for IE to lose efficacy
Don't worry 1.3.1 is going to be released soon On Jan 17, 12:38 am, ChenKaie chenk...@gmail.com wrote: Dear all, I use some behavior hack, like the famous Whatever:hover (http://www.xs4all.nl/~peterned/csshover.html), when I upgrade jQuery to v1.3, it cause this hack to lose efficacy, but works well under jquery v1.2. any body? meet the same problem with me?
[jQuery] Re: load script regarding to value of textfield
Use jquery's get() method. More about it here: http://docs.jquery.com/Ajax/jQuery.get Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Tue, Jan 13, 2009 at 2:40 PM, dirk w dirkwendl...@googlemail.com wrote: ides anyone? On 12 Jan., 17:43, dirk w dirkwendl...@googlemail.com wrote: thanks a lot for your help! is it possible to additionally explain me how i can execute this link through the ajax functions? that would be great! thanks in advance On 12 Jan., 15:53, jQuery Lover ilovejqu...@gmail.com wrote: Try this: $('#searchButton').click(function(){ var url = 'script type=text/javascript src=http://gdata.youtube.com/feeds/api/videos?q='+ $('#searchText').val() + 'alt=json-in-scriptcallback=showMyVideosmax-results=7format=5/script'; // ajax functions to call $.ajax, $.load, $.get, $.post }); - Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Jan 12, 2009 at 1:49 PM, dirk w dirkwendl...@googlemail.com wrote: hello community, i have some kind of a beginner question and i really would appreciate if you could help me with that. when someone types a value into the textfield and clicks on search or enter than the javascript line should be called regarding to the entered value. this should happen without reloading the complete page. # FORM form id=searchForm action= input type=text name=searchText id=searchText value= size=30 maxlength=30/ input type=button name=searchButton id=searchButton class=button buttonText value=Search / /form # Script to call script type=text/javascript src=http://gdata.youtube.com/feeds/api/ videos?q=' + searchTerm + 'alt=json-in- scriptcallback=showMyVideosmax-results=7format=5/script see the SearchTerm in the js line, it should be replaced with the value of the textfield. thank you very much in advance! dirk
[jQuery] Re: More efficient way to find Parent element
$(this).parents('table:first') or in jQuery 1.3: $(this).closest('table'); - ricardo On Jan 16, 5:13 pm, Coryt cory.c.tay...@gmail.com wrote: after learning the difference between parents and parent, I am having to resort to using parent(), but it's not very clean. Consider the following table, which is embedded in a page, which may have additional tables (for this reason I cannot use parents(table) because it returns multiple tables): table class=gridview id=A cellpadding=0 cellspacing=0 tbody tr class='gvheader' th width=20pxnbsp;/th th width=150pxHost/th th width=100pxDirects To/th th width=40pxTTL/th /tr tr class=dgalt id=trEmptyA runat=server visible=false td colspan=5You currently do not have any Records./td /tr tr class=gvfooter td colspan=4 class=newRecordAdd New Record/td /tr /tbody /table and now my jquery: Notice the multiple .parent().parent().parent() and $currentTable.children().children().size(); $(function() { $(.newRecord).click(function() { var $currentTable = $(this).parent().parent().parent (); var tableType = $currentTable.attr(id); var numRows = $currentTable.children().children().size (); var $templateRow = $(#EditRowTemplate).clone().attr (id, new+tableType+Record_+numRows); if (tableType=='MX'){ $(td:nth-child(5), $templateRow).show(); } else { $(td:nth-child(5), $templateRow).hide(); } $templateRow.insertAfter($(tr:last, $currentTable).prev()); }); }); Is there a way to use parents, while only selecting the immediate parent table? and similarily with children, is there a better way to do this? I cannot always assume this is the first table, there may be 3,4,5 etc tables side-by-side. Thanks
[jQuery] Re: How to grab the filename (src attribute) of an image?
Well, it depends where you need it... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Jan 12, 2009 at 10:19 PM, webmas...@terradon.nl webmas...@terradon.nl wrote: Where and how do i implement var fileName = $(this).attr('src');
[jQuery] Re: question about changes to :not() in 1.3
Shouldn't it simply be $(':not(div):has(div)') ? Note that it gives you all the chain of parents to the element which contains a DIV. On Jan 16, 6:26 pm, jdwbell jdwb...@gmail.com wrote: Thank you very much for your reply. I am finding that with the example listed below these two work as expected (that is they are returning non divs and all divs which do not contain other divs): $('*').not('div:has(div)') $('*').not($('div:has(div)')) but these three: $(':not(div:has(div))') $('*:not(div:has(div))' $('*').filter(':not(div:has(div))') are excluding ALL divs as all other elements which contain divs Hopefully that explanation makes because I'm kind of confusing myself! I've tried this on IE 6 and Chrome with the same results. Thanks! html head style div, fieldset, p { border: ridge 1px silver; padding: 20px; margin: 20px; } .wrappedElement { border: ridge 2px #FF; } /style script type=text/javascript src=../../scripts/jquery-1.3.js/script script $(function(){ $(':not(div:has(div))').addClass('wrappedElement'); //$('*:not(div:has(div))').addClass('wrappedElement'); //$('*').filter(':not(div:has(div))').addClass('wrappedElement'); //$('*').not('div:has(div)').addClass('wrappedElement'); //$('*').not($('div:has(div)')).addClass('wrappedElement'); }) /script /head body div div div pparagraph surrounded by three divs/p /div /div /div fieldset div div surrounded by fieldset /div /fieldset /body /html On Jan 16, 1:50 pm, John Resig jere...@gmail.com wrote: $(':not(div:has(div))') is equivalent to $('*:not(div:has(div))') is equivalent to $('*').filter(':not(div:has(div))') is equivalent to $('*').not('div:has(div)') Hope that helps to answer your question :) --John On Fri, Jan 16, 2009 at 11:24 AM, jdwbell jdwb...@gmail.com wrote: Here I am trying to get every element which is not a div that contains another div. Is $(':not(div:has(div))') supposed to now be equivalent to $('*').not ($('div:has(div)')) or am I misunderstanding what the change was (I'm just getting started with jQuery)? Thanks!
[jQuery] Re: Jquery Calling Servlet
You can change your form method attribute to post and you would not have the too long url problem. form method='post' ... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Jan 12, 2009 at 9:52 AM, RUQUIA TABASSUM ruquiatabas...@gmail.com wrote: ... i need to use AJAX because the servlet called is appended with input parameters that contains 1 to 5 charectars and when i directly call the servlet instead of making ajax call the url is not completely formed and the servlet is not invoked. ...
[jQuery] How to get sum of children element's width
This is the way I got the size now, is there any function can do the same thing? Html code div img src=.. img src=.. img src=.. /div script $(function() { $sum = 0; $('div img').each(function() { $sum += $(this).width(); }); console.log($sum); }); /script
[jQuery] Re: How select first link??
Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs . On Jan 17, 2:37 pm, Charlie22 ch...@post.cz wrote: ok, thx for your help guys, because it made me crazy for a while and thx for your bug report jQuery Lover. I am new pretty new and jQuery I am using 2-3 weeks and it is great TOOL!!! On 17 Led, 20:33, jQuery Lover ilovejqu...@gmail.com wrote: Submitted a ticket:http://dev.jquery.com/ticket/3903 Let's see what happens :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:32 AM, Charlie22 ch...@post.cz wrote: so why it doesnt work?? is it jQuery bug? On 17 Led, 20:30, jQuery Lover ilovejqu...@gmail.com wrote: It is... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 12:27 AM, Charlie22 ch...@post.cz wrote: yes, that is what I said..not working, so I have to replace any scripts. I thought that #menu li a is regular CSS selector...or not??- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] Re: Hide content until loaded
I suggest you to use the toggleClass and your code should look like this $('#tn-loading').toggleClass('hide'); $(document).ready(function() { $('#tn-loading').toggleClass('hide'); }); .hide{ dispaly:none;} so let me explain it this way , we first apply the .hide to the tn- loading, and when the page is loaded we toggle it so the display will be block. try to use efficient you don't have to have multiple classes On Jan 17, 9:01 am, jQuery Lover ilovejqu...@gmail.com wrote: Saif, do you have a point or is this spam? MorningZ, I am sure you did not have time to go into much details just like me with my first post :) Christine, MorningZ suggested (IMO) the best way to do it. Just keep in mind those users that do not have js enabled. Add some id or class to your body tag USING JAVASCRIPT. For example a js id and in your CSS add rules that make your blocks display none. #js .tn-hide{ display:none; } This will make sure those users with js disabled will ALSO see your hidden blocks. PS. It's surprising how many company system administrators disable js in browser for security sake. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 8:16 PM, Saif ullah saifullahha...@gmail.com wrote: http://tinyurl.com/8rwmkr On Sat, Jan 17, 2009 at 8:13 PM, MorningZ morni...@gmail.com wrote: Why not do it with CSS? where css class tn-loading has display: none declared div class=tn-hide tn-loading Content you are hiding until document ready /div then $(document).ready(function() { //Do some stuff here //Done doing stuff, show the content $('tn-hide').removeClass('tn-loading); }); On Jan 16, 11:53 pm, Christine Masters cmast...@townnews.com wrote: Hi everyone! I'm a jQuery newbie, so I apologize if this is an easy question! I'm building a template for newspaper sites, and by nature of having many ads and modules and so forth, the content loads before the jQuery that styles it, leading to a flash of unstyled content. So, on several of my modules that use a lot of jQuery, I'd like to hide them until they are loaded. Right now, I'm trying to do this: $('tn-hide').css('display', 'none').addClass('tn-loading'); $(document).ready(function() { $('tn-hide').css('display', 'block').removeClass('tn-loading); }); I'd like to be able to simply apply the 'tn-hide' class to any module I'd like to hide until loaded on the page. It is my (limited) understanding that the first line will go into effect when the DOM is ready and the second when the document is ready. Anyway, right now it isn't working. I'd appreciate it if you could give me any insight on this or let me know if I'm heading in the right direction. If it helps, here is my page:http://blueprints.townnews-cms.com/ --- - Christine Masters, Product Manager, TownNews.com cmast...@townnews.com | 1-800-293-9576 x1022 Twitter: c_masters --- -
[jQuery] Re: Thickbox and Yahoo Stores
Try this two options: $('a').unbind('click'); // not sure if it works or not OR $('a').click(function(){ window.location=$(this).attr('href'); return false; }); and put this code after all other javascript codes! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Jan 12, 2009 at 7:59 PM, MikeFCraft mikewfcr...@gmail.com wrote: it won't be very useful but here's a snippet with the site itself removed: a class=thickbox href=http://site.example.com/Scripts/theFile.htm? modal=falseamp;height=500amp;width=720Click Here To Open Thickbox/ a when you click that link you get the thickbox loading animation and the rest of the page is greyed out. the animation never goes away. Your browser really requests a 1x1 tracking pixel from a yahoo URL like http://a.analytics.yahoo.com/p.pl?a=asdfasdfasdfasdf Maybe there's a way to use jquery to reset the href value of the link to the original location, rather than what yahoo appends. Or maybe yahoo is appending some sort of onclick behavior that can be reset On Jan 10, 2:08 am, jQuery Lover ilovejqu...@gmail.com wrote: Do you have a link or could you copypaste html code snippet of your image with the links... jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 10, 2009 at 2:16 AM, MikeFCraft mikewfcr...@gmail.com wrote: I'm helping someone set up thickbox to work on their yahoo store. It seems like Yahoo has a built-in click tracking system that is messing up the thickbox though. For example clicking on a thickbox link that points to theFile.htm first makes a request to yahoo for something like: http://a.analytics.yahoo.com/p.pl?a=... with a ton of analytical data appended to the URL. It returns a tracking gif, and the real content of theFile.htm never loads. (you just stare at thickbox's loadingAnimation.gif forever) Has anyone ever seen this before and come up with a workaround?
[jQuery] Re: How select first link??
No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs.
[jQuery] Re: Jquery Calling Servlet
... i need to use AJAX because the servlet called is appended with input parameters that contains 1 to 5 charectars and when i directly call the servlet instead of making ajax call the url is not completely formed and the servlet is not invoked. You can change your form method attribute to post and you would not have the too long url problem. form method='post' ... jQuery Lover is correct, you must use a POST request. GET requests are limited to 1KB. But don't use ajax. POST a form like this: form method=POST target=_blank // form contents here /form You can build the form dynamically and submit it via script. Mike
[jQuery] Re: How select first link??
That's true, but that's exactly how it's supposed to function. On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover ilovejqu...@gmail.com wrote: No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs.
[jQuery] [ resolution browser? ]
Hi, How i can to know resolution of browser? Thank´s
[jQuery] Re: Submitting a form with .submit() problems
Actually in this case parents('form') of the clicked object does not include the form tag itself and I believe it's due to the poor html structure. I just tested this out. It's tough to script on back markup. Different browsers will do different things in an attempt to figure out what you really meant. You can always get to the parent form of an input by accessing the input's 'form' property. var form = inputDomElement.form;
[jQuery] Re: How select first link??
jQuery has true. How can I select first link? this is original question. And why doesnt work this code $('#menu li a:first')? On 17 Led, 21:39, Nic Luciano nic.luci...@gmail.com wrote: That's true, but that's exactly how it's supposed to function. On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover ilovejqu...@gmail.com wrote: No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs.- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] premature ready?
Well, maybe In my first use of jQuery, I attached a visibility toggle function, via document ready, to a button (button by id, toggling by class), and got very erratic results. Typically, the toggle didn't work on first load of the document, but tended to work if the document was reloaded from cache. * All my CSS is embedded in head * All my JS is at the end of head * I'm loading 1.3 from Google Code * For any given page load, it either works all the time or fails all the time * I've got both Google ads and analytics in the doc * Same symptoms on Mac Safari 3 and Mac FF3 I gather from the list archives that ready has been something of a problem child. My workaround is to use onclick instead of dynamic attachment, but I'd like to use jQuery more in the future, and it'd be nice to know what's going on. The onclick version is here: http://lobitos.net/wx?loc=half+moon+bay+cafmt=wide (the 'raw' button is the one in question).