[jQuery] SlideUp() Question
Let me preface this by stating, showing the code is not going to be possible, nor do I think it to be needed. I am looking to produce an animation that is in my head tricky. I am looking to reproduce the effect of slideUp(), but in reverse. Instead of pulling the bottom to the top, I want the top to move up. Yes you can do this sort of thing with ther methods like animate and moving the background position, but what I have is a situation where that won't work. I have an image with text on it, that I want the background to appear to be filling with a color. The problem is the other image has the text on it as well, so I have to reveal the image from the bottom up, not the top down, or sliding the image from the bottom - it just doesnt look right since you can see the old text being covered and the new text coming from the bottom. slideDown works perfect, just in the wrong direction - I need it to start at the bottom and work its way up. No - I can't make the text transparent - for those looking to offer that suggestion. Can anyone help?
[jQuery] Re: SlideUp() Question
Ok - I have made it that faar, however the second image is just covering the previous one. So instead of revealing the image (ala a theater curtain going from the stage floor up) it just hides it. Im thinking there isn't really a good way of accomplishing this, unfortunately. On Mar 12, 1:10 pm, Karl Swedberg k...@englishrules.com wrote: Put both images in a container that has position: relative; Set the following css declarations for the sliding image: position: absolute; left: 0; bottom: 0 Then do your slideUp / slideDown stuff. See the first example here: http://www.learningjquery.com/2009/02/slide-elements-in-different-dir... --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 12, 2009, at 10:53 AM, kellyjandr...@sbcglobal.net wrote: Let me preface this by stating, showing the code is not going to be possible, nor do I think it to be needed. I am looking to produce an animation that is in my head tricky. I am looking to reproduce the effect of slideUp(), but in reverse. Instead of pulling the bottom to the top, I want the top to move up. Yes you can do this sort of thing with ther methods like animate and moving the background position, but what I have is a situation where that won't work. I have an image with text on it, that I want the background to appear to be filling with a color. The problem is the other image has the text on it as well, so I have to reveal the image from the bottom up, not the top down, or sliding the image from the bottom - it just doesnt look right since you can see the old text being covered and the new text coming from the bottom. slideDown works perfect, just in the wrong direction - I need it to start at the bottom and work its way up. No - I can't make the text transparent - for those looking to offer that suggestion. Can anyone help?
[jQuery] Re: SlideUp() Question
Bah - I figured it out shortly after - I had to keep everything the same, just reverse what was being shown. Instead of showing the highlighted version, I hide it using the non highlighted - then wehn I use slide up, it is revealing the way I intended. I will put together some sort of example for everyone. Later. On Mar 12, 2:17 pm, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: Ok - I have made it that faar, however the second image is just covering the previous one. So instead of revealing the image (ala a theater curtain going from the stage floor up) it just hides it. Im thinking there isn't really a good way of accomplishing this, unfortunately. On Mar 12, 1:10 pm, Karl Swedberg k...@englishrules.com wrote: Put both images in a container that has position: relative; Set the following css declarations for the sliding image: position: absolute; left: 0; bottom: 0 Then do your slideUp / slideDown stuff. See the first example here: http://www.learningjquery.com/2009/02/slide-elements-in-different-dir... --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 12, 2009, at 10:53 AM, kellyjandr...@sbcglobal.net wrote: Let me preface this by stating, showing the code is not going to be possible, nor do I think it to be needed. I am looking to produce an animation that is in my head tricky. I am looking to reproduce the effect of slideUp(), but in reverse. Instead of pulling the bottom to the top, I want the top to move up. Yes you can do this sort of thing with ther methods like animate and moving the background position, but what I have is a situation where that won't work. I have an image with text on it, that I want the background to appear to be filling with a color. The problem is the other image has the text on it as well, so I have to reveal the image from the bottom up, not the top down, or sliding the image from the bottom - it just doesnt look right since you can see the old text being covered and the new text coming from the bottom. slideDown works perfect, just in the wrong direction - I need it to start at the bottom and work its way up. No - I can't make the text transparent - for those looking to offer that suggestion. Can anyone help?
[jQuery] Re: Cascade (chained) works in Firefox but not in IE
You may have to write the special characters with their HTML equivalent code. Is that not a possibility? On Feb 1, 6:04 pm, James james.tilb...@gmail.com wrote: I did attach firebug at one point but couldn't glean anything useful from it. From my google research, the problem has to do with the encoding (UTF-8) and JQuery's handling of special characters. I can't explain why IE breaks while Firefox just displays a strange character... In any case, the solution to this is beyond me. For now it looks like I'm going to have to run my data through a function to replace accented characters with their normal counterparts. I'd be interested to hear from others about possible fixes to this though... On Feb 1, 4:13 pm, Mike Nichols nichols.mik...@gmail.com wrote: have you attached fiddler and firebug to see what it happening? On Feb 1, 10:14 am, James james.tilb...@gmail.com wrote: ...I must add and point out that the EXACT SAME DATA exists in the external file and the inline var. So it is ALSO very strange that the accents as mentioned display correctly in the first example (pulling from the inline var) and don't in the second example (pulling from the external file). I guess this helps to isolate where the problem is occuring? Some parsing routine that only applies to externally-read files? On Feb 1, 12:10 pm, James james.tilb...@gmail.com wrote: Update2: The problematic page is still up as promised for discussion purposes, but I have a breakthrough to report. I never would have suspected this in a million years, but I discovered it after following through with my same line of logic regarding the JSON data causing a problem. I eliminated single quotes and commas from the equation as these worked just fine. However, I thought I would try other characters since I noticed that accented characters were showing up strangely in the dropdown list (see under Quebec - Gaspé, for an example). Where it should say GASPé, it instead shows GASP(question mark inside a diamond). Firefox displays this, IE doesn't display anything but the loading circle graphic. I can fix this by replacing all accented characters in my data with regular alphabet characters, but the question is - why is this causing a problem with the JQuery/IE combination? I would much rather leave accented characters intact. Something in the JQuery routines can't handle these characters and/or is replacing them with a strange character. Any ideas? On Feb 1, 11:46 am, James james.tilb...@gmail.com wrote: Update: It doesn't seem to have anything to do with single quotes or commas, for that matter, inside the JSON data. Now HERE'S something to make you scratch your head: I have now put the complete data file back up in the external file ('CANADA_3.js') and I have ALSO put the EXACT same data file into the static var included inline in the HTML page ('list3'). This is the best demonstration of the problem: The external file and the static var both load fine if using Firefox. Only the static var works for IE. Live page (will not change until further response):http://jamestilberg.com/jquery/ James ? On Feb 1, 11:22 am, James james.tilb...@gmail.com wrote: @Mike Thanks. But it should have been working with the default code since dropdown 2 was working - dropdown 3 used the exact same principle. There is definitely something going on different between FF and IE. Question - Could the existence of single quotes within the JSON data throw off JQuery? example: If one of the cities is O'Brien I ask because I have now put up a refined page with the two methods and I have used a smaller version of the data file and guess what? It now works. So this leads me to believe the JSON data itself may have been causing a problem with IE only (Firefox always worked). http://jamestilberg.com/jquery/ The thing is, I had already validated the JSON data with several different online JSON validators I guess I need to build the JSON file back up and see if something specific stumps JQuery... On Feb 1, 2:01 am, Mike Nichols nichols.mik...@gmail.com wrote: @James Thinking about what you are doing here with the third dropdown...By attaching that dropdown to the second you are telling it to be filtered by the second dropdown's selected value...which is not selected yet since it just loaded so I would presume you shouldn't have any data in the third drop down. To support this behavior in the past I used the 'event' property of the options to define which event actually fires a cascade ( the defalt is 'changed'). Then I manually fire cascade within the
[jQuery] Re: How select first link??
The question on all of this is usage - and I don't know how clear it was stated. The selectors everyone has put up are valid, but not necessarily for the usage. 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. So the issue is to remove only the first link. $('#menu li:first a) will only select the anchor inside first list item. Perfect until you put home inside that with no link. Then nothing matches that criteria. $('#menu li a:first') matches up to the first anchor tag inside a li. http://test.learningjquery.com/selector-bug.html Proves the theory. If you did a selector of 'p' it would affect ALL of them, right? So there are 7 anchors in the first position of an li, and 0 in the second. Jquery 1.3 didn't create a bug - it fixed a selector problem. The only true selector is to use $('#menu a:first'). It will select the first anchor and only the first anchor. It all just problem with sloppy selectors in the past. They cleaned it up and got it right. I would suggest we make the adjustments. On Jan 17, 4:19 pm, Nic Luciano nic.luci...@gmail.com wrote: Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first-child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)? Can't believe I overlooked that- I stand corrected :D On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi ricardob...@gmail.comwrote: I know this isn't the dev list, but I'm curious about how come these bugs weren't caught by the test suite? On Jan 17, 6:50 pm, Karl Swedberg k...@englishrules.com wrote: Nic, Actually, it is a bug, at least in the sense that the results are different from those of any previous version of jQuery. It isn't just about :first, though. It has to do with multiple- descendant selectors in general. I've provided a test case athttp:// test.learningjquery.com/selector-bug.html with side-by-side comparison of 1.2.6 and 1.3, showing the number of matches (and I also posted an update to the ticket). --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 3:39 PM, Nic Luciano 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.
[jQuery] Re: How select first link??
Bah - I see they fixed it. You should not be able to select only one anchor tag in this instance using $('#menu li a:first') On Jan 18, 9:33 am, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: The question on all of this is usage - and I don't know how clear it was stated. The selectors everyone has put up are valid, but not necessarily for the usage. 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. So the issue is to remove only the first link. $('#menu li:first a) will only select the anchor inside first list item. Perfect until you put home inside that with no link. Then nothing matches that criteria. $('#menu li a:first') matches up to the first anchor tag inside a li.http://test.learningjquery.com/selector-bug.html Proves the theory. If you did a selector of 'p' it would affect ALL of them, right? So there are 7 anchors in the first position of an li, and 0 in the second. Jquery 1.3 didn't create a bug - it fixed a selector problem. The only true selector is to use $('#menu a:first'). It will select the first anchor and only the first anchor. It all just problem with sloppy selectors in the past. They cleaned it up and got it right. I would suggest we make the adjustments. On Jan 17, 4:19 pm, Nic Luciano nic.luci...@gmail.com wrote: Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first-child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)? Can't believe I overlooked that- I stand corrected :D On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi ricardob...@gmail.comwrote: I know this isn't the dev list, but I'm curious about how come these bugs weren't caught by the test suite? On Jan 17, 6:50 pm, Karl Swedberg k...@englishrules.com wrote: Nic, Actually, it is a bug, at least in the sense that the results are different from those of any previous version of jQuery. It isn't just about :first, though. It has to do with multiple- descendant selectors in general. I've provided a test case athttp:// test.learningjquery.com/selector-bug.html with side-by-side comparison of 1.2.6 and 1.3, showing the number of matches (and I also posted an update to the ticket). --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 3:39 PM, Nic Luciano 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.
[jQuery] Re: How select first link??
You will need to not only remove the link, but the links parent, unless an empty LI is ok for you. On Jan 18, 1:02 pm, punkplod gareth.gwyt...@gmail.com wrote: had lots of trouble using #menu li a:first when i first started using jquery Outside of jquery use :first and :last are css3 pseudo selectors so im a little weary of using them. Strange i guess but i just don't like using those selectors sorry if i have caused any offense.
[jQuery] $.ajax and xml
I built a simple photo gallery with XML and Jquery. Works Perfect in Firefox, and displays nothing in IE6/7. I have examined the produced code with FireBug, and it looks exactly as it should. From the research I have found, it's either an issue with XML being called as ActiveX (which may not be a Jquery bug, just an issue with IE) or something with .html... I don't think that is the answer. Pretty sure I have activex turned on and all. http://dev.jquery.com/ticket/3777 - Source files are located here. Thanks in advance for any assistance.