distilled-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-08 00:55 UTC
Simple script crashes IE
I''m new to JS but I think I''m picking it up not too bad. This problem has perplexed me. I''m trying to use Prototype and Scriptaculous: var gameInfo = Class.create(); gameInfo.prototype = { initialize: function() { if (!document.getElementsByTagName){ return; } var anchors = document.getElementsByTagName(''a''); // loop through all anchor tags for (var i=0; i<anchors.length; i++){ var anchor = anchors[i]; if (anchor.getAttribute(''href'') && anchor.className =''gameTitle''){ anchor.onclick = function () {myGameInfo.start(); return false;} } } }, start: function() { new Effect.toggle(''gameInfo'', ''slide''); } } function initGameInfo() { myGameInfo = new gameInfo(); } Event.observe(window, ''load'', initGameInfo, false); I''ll admit, I''ve based a lot of this code on Lightbox2.0 but it does something much simpler. If you go to this (work-in-progress) page (http://psf.gamehideout.co.uk/dah.php) and click on "Destroy all Humans!" you''ll see what I''m trying to acheive. Of course, you need to use Firefox or Opera (hopefully Safari as well. Can anyone confirm?) as it doesn''t work in IE. I know I could get that effect without the above code but I needed it to degrade gracefully. This way people without JS can view the same content but on another page (doesn''t work yet as the site is very incomplete). If anyone can shed light on why this crashes IE I''d be very grateful --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
distilled-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-08 01:10 UTC
Re: Simple script crashes IE
Actually, it has nothing to do with this script. Seems to be a problem with the slide animation in Scriptaculous. It works perfect when using blind instead. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
I am guessing you already changed it since it does not crash my IE. Too bad, it was probably a good bug to investigate and probably report or submit a patch for. I guess I will inspection of your snippet will need to take place now. -Andrew Martinez> -----Original Message----- > From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails- > spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of distilled-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > Sent: Thursday, September 07, 2006 9:11 PM > To: Ruby on Rails: Spinoffs > Subject: [Rails-spinoffs] Re: Simple script crashes IE > > > Actually, it has nothing to do with this script. > > Seems to be a problem with the slide animation in Scriptaculous. It > works perfect when using blind instead. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
* distilled-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote (08/09/06 02:10):> Actually, it has nothing to do with this script. > > Seems to be a problem with the slide animation in Scriptaculous. It > works perfect when using blind instead.If you''re using scriptaculous v1.6.3, then upgrading to v1.6.4 might fix the problem. The 2 releases were about 3 days apart, and 1.6.4 is advertised as "FIXES ISSUES WITH 1.6.3 IN IE", but I don''t know if it''s relevant to your script. Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Did you read the wiki docs? You need to add a inner wrapper DIV. Second thing you can try is doing the inner wrapper DIV that has style="position:relative" set. IE is really, really buggy on setting the CSS position from code. :( -Thomas Am 08.09.2006 um 02:55 schrieb distilled-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org:> > I''m new to JS but I think I''m picking it up not too bad. This problem > has perplexed me. I''m trying to use Prototype and Scriptaculous: > > var gameInfo = Class.create(); > > gameInfo.prototype = { > > initialize: function() { > if (!document.getElementsByTagName){ return; } > var anchors = document.getElementsByTagName(''a''); > > // loop through all anchor tags > for (var i=0; i<anchors.length; i++){ > var anchor = anchors[i]; > > if (anchor.getAttribute(''href'') && anchor.className => ''gameTitle''){ > anchor.onclick = function () {myGameInfo.start(); > return false;} > } > } > }, > start: function() { > new Effect.toggle(''gameInfo'', ''slide''); > } > > } > > function initGameInfo() { myGameInfo = new gameInfo(); } > Event.observe(window, ''load'', initGameInfo, false); > > I''ll admit, I''ve based a lot of this code on Lightbox2.0 but it does > something much simpler. > > If you go to this (work-in-progress) page > (http://psf.gamehideout.co.uk/dah.php) and click on "Destroy all > Humans!" you''ll see what I''m trying to acheive. Of course, you need to > use Firefox or Opera (hopefully Safari as well. Can anyone > confirm?) as > it doesn''t work in IE. > > I know I could get that effect without the above code but I needed it > to degrade gracefully. This way people without JS can view the same > content but on another page (doesn''t work yet as the site is very > incomplete). > > If anyone can shed light on why this crashes IE I''d be very grateful > > > >-- Thomas Fuchs wollzelle http://www.wollzelle.com questentier on AIM madrobby on irc.freenode.net http://www.fluxiom.com :: online digital asset management http://script.aculo.us :: Web 2.0 JavaScript http://mir.aculo.us :: Where no web developer has gone before --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
distilled-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-08 16:26 UTC
Re: Simple script crashes IE
Chris Lear wrote:> * distilled-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote (08/09/06 02:10): > > Actually, it has nothing to do with this script. > > > > Seems to be a problem with the slide animation in Scriptaculous. It > > works perfect when using blind instead. > > If you''re using scriptaculous v1.6.3, then upgrading to v1.6.4 might fix > the problem. The 2 releases were about 3 days apart, and 1.6.4 is > advertised as "FIXES ISSUES WITH 1.6.3 IN IE", but I don''t know if it''s > relevant to your script. > > ChrisThank you for pointing this out to me :) It has fixed the problem. Didn''t realise a new version had been released.. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---