On Apr 5, 8:00 am, David Dashifen Kees <[EMAIL PROTECTED]> wrote:
> Demo Site: http://www.dashifen.com/temp/drag_test/index.htm
>
> Check out the site above. You'll see a very small menu with a lot of
> behaviors attached. In Firefox, IE 6/7, and Opera things go as
> planned. You can click the arrow in the menu's header and it shrinks
> the menu to a column of icons, and you can reverse this by re-clicking
> the arrow. Plus, you can click either icons or labels within the menu
> and get little alert boxes which replace stub functions for the moment.
>
> But, in Safari, there's all sorts of problems.
Well, one.
> Chiefly, it the menu
> shrinking and expansion doesn't work and it seems like clicking on a
> label wasn't working for me either. Admittedly, though, I'm testing on
> an out-of-date Macintosh, as far as I know, and I don't have access to a
> different one.
The Macintosh itself is likely irrelevant, any PowerPC G3 or higher
(i.e. any Mac less than about 8 years old) can run the latest version
of OS X and Safari. I tested in OS X 10.4.9, which is Safari 2.0.4. I
can test on OS X 10.2.8, Safari 1.3 if you like.
> So, if there's anyone out there who can test the above site in safari
> try this:
>
> 1. Drag the menu to a different location on screen.
> 2. Try clicking the green arrow to the left of the words "Builder Menu"
> and see if the menu shrinks. If so, try to click the arrow again to
> make it grow.
> 3. Try to click on any of the other labels to get an alert box and do
> the same with the icons.
>
> I suspect #1 will work (it works for me at least)
Yes.
> but #2 will fail and
Yes, with error:
Null value
http://www.dashifen.com/temp/drag_test/index.htm Line: 56
Which is the last line of:
function show_hide_menu() {
path = "media/images/controls/";
img = $("show_hide_menu").down();
There doesn't appear to be any good reason why those variables should
be global. Anyhow, $("show_hide_menu") returns null, so calling
down() is doomed (i.e. this isn't a problem with down(), but with $
() ).
I suspect that it is due to Safari attempting to mimic IE's behaviour
of making element id's into global variables - either change the name
of the element or the function. I really wish browser developers
would just stick to standards and leave IE's dumb ideas to Microsoft.
> #3 will work when clicking on icons but not the labels.
It 'works' for me when clicking on any li content, not just the image.
>
> Feel free to dissect my code and see if you can find anything going on.
> I'd love to move on and not worry about Safari until later, but
> unfortunately our the department head where I work is a Mac user and
> he'll be sure to want to test it on his machine. Figures, right ;)
That *is* unfortunate. If your boss didn't use a Mac you could tell
Mac users to piss off and get a real PC, yeah? ;-)
Why not put the onclick attributes on li elements themselves instead
of detecting the element that the click came from and all that switch
stuff? Then you can put labels, images, whatever content you like in
the li and just let the event bubble up. As it is now, your code is
utterly dependent on the HTML layout.
As for the arrow, to get some separation of logic and layout, change
it by changing the CSS class of builder_menu. CSS can then make it do
whatever, not just swap or slide a single image - and you can forget
about up(), down(), left(), right()....
Oh, and if you bump up the text size a few times, the menu becomes
unreadable (and not just with Safari).
--
Fred
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---