Replace Contextmenu with new menu

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DJ WIce

    Replace Contextmenu with new menu

    Hi all,

    I did make a script/css thing to replace the contextmenu on the website with
    a new one: http://www.djwice.com/contextmenu.html

    It works nice in MSIE, but on Netscape (and probable other browsers) it
    stays on the same place (does not "open'' where the mouse is). And the links
    do not work when you click on them.

    If anyone has sugestions on how to improve it, please let me know.

    Thanks,
    Wouter


  • Randy Webb

    #2
    Re: Replace Contextmenu with new menu

    DJ WIce wrote:
    [color=blue]
    > Hi all,
    >
    > I did make a script/css thing to replace the contextmenu on the website with
    > a new one: http://www.djwice.com/contextmenu.html
    >
    > It works nice in MSIE, but on Netscape (and probable other browsers) it
    > stays on the same place (does not "open'' where the mouse is). And the links
    > do not work when you click on them.
    >
    > If anyone has sugestions on how to improve it, please let me know.[/color]

    Suggestion: Trash it and stop screwing with my mouse.

    --
    Randy

    Comment

    • DJ WIce

      #3
      Re: Replace Contextmenu with new menu

      : Suggestion: Trash it and stop screwing with my mouse.

      Sugestion: look at what you see before complaining; click the option on the
      bottom of the menu...


      And now try to help me solve a problem that is not related with your mouse.
      Help me make the code work; the stylesheet does not look equal in all
      browsers. NN screws it up.


      I just made it to test what's possible, you seem to love staying where you
      are?

      Wouter


      Comment

      • Steve Pugh

        #4
        Re: Replace Contextmenu with new menu

        "DJ WIce" <contextmenu@dj wice.com> wrote:
        [color=blue]
        >I did make a script/css thing to replace the contextmenu on the website with
        >a new one: http://www.djwice.com/contextmenu.html
        >
        >It works nice in MSIE, but on Netscape (and probable other browsers) it
        >stays on the same place (does not "open'' where the mouse is). And the links
        >do not work when you click on them.[/color]

        Which Netscape isn't it working in? It works fine in NN 7.1 and 6.23
        (both WinXP).

        The page doesn't even load in NN4.8 (hangs), but you weren't actually
        expecting anything remotely fancy to work in that were you?

        It doesn't work at all in Opera 7.23 (even when I set my preference to
        allow JavaScript to access the right mouse click, which I normally
        don't allow. Can any Opera users remember whether that's off or on by
        default?)

        Steve

        --
        "My theories appal you, my heresies outrage you,
        I never answer letters and you don't like my tie." - The Doctor

        Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

        Comment

        • Lasse Reichstein Nielsen

          #5
          Re: Replace Contextmenu with new menu

          "DJ WIce" <contextmenu@dj wice.com> writes:
          [color=blue]
          > : Suggestion: Trash it and stop screwing with my mouse.
          >
          > Sugestion: look at what you see before complaining; click the option on the
          > bottom of the menu...[/color]

          Didn't see a thing. I use Opera :) Anyway, I did check in IE and
          Mozilla ...

          Looks nice, but I am also in the camp who things reimplementing the
          browser interface is a bad idea. And why do you call it "more nice
          looking"? I like the current menu, and it fits my theme.
          [color=blue]
          > And now try to help me solve a problem that is not related with your mouse.
          > Help me make the code work; the stylesheet does not look equal in all
          > browsers. NN screws it up.[/color]

          As a bug report, "screws it up" is pretty useless. Which NN are we
          talking about (I'm pretty sure it's not Netscape Navigator 4, because
          it won't even load the page).

          I don't see any serious difference between Mozilla and IE 6 (not one that
          would fit "screws it up" at least).

          It is optimistic to assume that two browsers show a page exactly
          alike. For one thing, the font will probably be different, and IE is
          known for its bad CSS implementation. So, if you have any particular
          CSS problems, you need to say what it is (and it would be smarter to
          ask in a CSS group ... which I only now notice that you do. When
          you crosspost, remember to set the Followup-To header!!!)

          The color you use for the background, lightgray, is not a standard
          CSS color, and is not understood by IE

          Neither allows me to pop the menu down again when it is up, except by
          chosing an entry.

          Don't use javascript:-URIs (like "javascript:win dow.print()"). Use
          onclick attributes instead. <URL:http://jibbering.com/faq/#FAQ4_24>

          /L
          --
          Lasse Reichstein Nielsen - lrn@hotpop.com
          DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
          'Faith without judgement merely degrades the spirit divine.'

          Comment

          • DJ WIce

            #6
            Re: Replace Contextmenu with new menu

            Hi Steve,

            Since this is a posting in more that one newsgroup I did fix a bit op for
            NN.
            So the problem now with NN is stylesheet related. I hope you can help:

            The buttons do have 2 problems:

            1) in MSIE the

            <a href="link" style="width:15 0px;border:1px solid white;"><img
            src="image.gif" height="16"> text</a>

            works. E.g. the link is 150 pixels in width and has a border around the 16
            pixels
            height of the image.

            Netscape (7) says:
            I ignor the width:150px and I do not care how heigh the image is;
            I just draw it around the image and the link text but at the text height
            (12px).





            : Which Netscape isn't it working in? It works fine in NN 7.1 and 6.23
            : (both WinXP).
            Thanks for testing NN 6.23, I did test it on 7.0 only.

            : The page doesn't even load in NN4.8 (hangs), but you weren't actually
            : expecting anything remotely fancy to work in that were you?
            I do not use layers probable that's the problem, right? NN4.8 does not
            handle div tags?


            : It doesn't work at all in Opera 7.23 (even when I set my preference to
            : allow JavaScript to access the right mouse click, which I normally
            : don't allow. Can any Opera users remember whether that's off or on by
            : default?)
            Hmm.. I assume Opera did not implement the oncontextmenu event.
            I need to know how to test if it's implemented or not, then I can handle
            those who do not with right-click events.
            I need to separate these because Netscape 7 (and maybe lower) gives a
            trigger to the click-event at the same time to the oncontextmenu event, MSIE
            makes the choice only to trigger the rightclick event when both are active.


            Thanks for your reply and testing!
            Wouter


            Comment

            • Neal

              #7
              Re: Replace Contextmenu with new menu

              On Thu, 15 Jan 2004 23:20:07 +0100, DJ WIce <contextmenu@dj wice.com> wrote:
              [color=blue]
              > Help me make the code work; the stylesheet does not look equal in all
              > browsers. NN screws it up.[/color]

              In Opera I get the default menu, thank goodness.

              Don't know crap about scripting, but thought you'd appreciate a little
              extra info.

              Comment

              • Steve Pugh

                #8
                Re: Replace Contextmenu with new menu

                "DJ WIce" <contextmenu@dj wice.com> wrote:
                [color=blue]
                >The buttons do have 2 problems:
                >
                >1) in MSIE the
                >
                ><a href="link" style="width:15 0px;border:1px solid white;"><img
                >src="image.gif " height="16"> text</a>
                >
                >works. E.g. the link is 150 pixels in width and has a border around the 16
                >pixels height of the image.
                >
                >Netscape (7) says:
                > I ignor the width:150px and I do not care how heigh the image is;
                > I just draw it around the image and the link text but at the text height
                >(12px).[/color]

                Netscape is applying your styles correctly, IE is not.
                You can not set the width property for inline elements, and the height
                of an inline element is determined by the line-height property, not by
                any images that it may contain. This is already well documented, see
                for example: http://www.hut.fi/u/hsivonen/standar...l#lineboxmodel

                Adding display: block to the styles for the <a> elements would be a
                first step. Other values may need to be tweaked as a consequence.
                [color=blue]
                >: The page doesn't even load in NN4.8 (hangs), but you weren't actually
                >: expecting anything remotely fancy to work in that were you?
                >
                >I do not use layers probable that's the problem, right? NN4.8 does not
                >handle div tags?[/color]

                NN4 handles div tags just fine. It just has a totally different
                document object model and so you can't manipulate them, or anything
                else for that matter, in the same way as more modern browsers.
                [color=blue]
                >: It doesn't work at all in Opera 7.23 (even when I set my preference to
                >: allow JavaScript to access the right mouse click, which I normally
                >: don't allow. Can any Opera users remember whether that's off or on by
                >: default?)
                >
                >Hmm.. I assume Opera did not implement the oncontextmenu event.
                >I need to know how to test if it's implemented or not, then I can handle
                >those who do not with right-click events.[/color]

                Opera didn't throw up an error message, so I wouldn't bother changing
                anything. Most Opera users are happy with the fact that their browser
                is less open to interference like this. Leave them happy.

                Steve

                --
                "My theories appal you, my heresies outrage you,
                I never answer letters and you don't like my tie." - The Doctor

                Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

                Comment

                • DJ WIce

                  #9
                  Re: Replace Contextmenu with new menu

                  : ... which I only now notice that you do. When
                  : you crosspost, remember to set the Followup-To header!!!)

                  Oh, sorry, how do I do that?
                  I though putting all in one field would do the trick (it send at once).
                  I use MSOE 6.

                  The "screw up" of Netscape 7.0 is that I link a image and a text, give the
                  link a border and the border goes trough the image (see the refresh option).
                  Next to that it does not react on the "width" I set in the style of the
                  link.
                  I prefer to have the link 150px width.


                  : The color you use for the background, lightgray, is not a standard
                  : CSS color, and is not understood by IE
                  Oh? I though so, it shows me lightgray in IE6. So it's not one of the 216
                  colors..
                  I'll change it to a color code, thanks. #ccc is about the same.


                  : Neither allows me to pop the menu down again when it is up, except by
                  : chosing an entry.
                  It does when you click next to the menu if I'm correct.
                  Oh.. oeps.. did disable the mousedown to get it to work in NN 7..
                  Thanks fixed that with onlick event.


                  : Don't use javascript:-URIs (like "javascript:win dow.print()"). Use
                  : onclick attributes instead. <URL:http://jibbering.com/faq/#FAQ4_24>
                  Thanks!
                  What other html tag does support hover events?
                  So I can put it in the stylesheet:

                  tag:hover{..}

                  How funny; MSIE 6 does not support hover for span.. and NN 7.0 does..



                  Thanks you did help me a lot!
                  Wouter


                  Comment

                  • kchayka

                    #10
                    Re: Replace Contextmenu with new menu

                    DJ WIce wrote:[color=blue]
                    >
                    > I did make a script/css thing to replace the contextmenu on the website with
                    > a new one: http://www.djwice.com/contextmenu.html
                    >
                    > If anyone has sugestions on how to improve it, please let me know.[/color]

                    You assume all your visitors are mouse users? The browser's inbuilt
                    context menus are accessible via keyboard. Yours is not.

                    BTW, yours is not really a context menu at all, since the menu items
                    don't change depending on the element (link vs image vs text). Why
                    would someone prefer using this when the browser context menus are so
                    much more functional? You are only going to annoy your visitors, you know.

                    --
                    To email a reply, remove (dash)un(dash). Mail sent to the un
                    address is considered spam and automatically deleted.

                    Comment

                    • Michael Wilcox

                      #11
                      Re: Replace Contextmenu with new menu

                      DJ WIce <contextmenu@dj wice.com> wrote:[color=blue]
                      > If anyone has sugestions on how to improve it, please let me know.[/color]

                      Having the "Disable this" text doesn't make it okay to toy with the user's
                      browser. What if I wanted to copy and paste? That's not even on your menu.

                      My menu was made to look good with my browser, not with your site.
                      --
                      Michael Wilcox
                      mjwilco at yahoo dot com
                      Essential Tools for the Web Developer - http://mikewilcox.t35.com


                      Comment

                      • Lasse Reichstein Nielsen

                        #12
                        Re: Replace Contextmenu with new menu

                        "DJ WIce" <contextmenu@dj wice.com> writes:
                        [color=blue]
                        > : ... which I only now notice that you do. When
                        > : you crosspost, remember to set the Followup-To header!!!)
                        >
                        > Oh, sorry, how do I do that?
                        > I though putting all in one field would do the trick (it send at once).
                        > I use MSOE 6.[/color]

                        It did the trick of sending to all the groups. However, when one does that,
                        it is highly recommended (to the point where people get angry if you don't)
                        to specify which group followups should go to. Since later posters might
                        not notice the cross posting at all, but the author is aware of it, it is
                        his responsibility to prevent long threads where people doesn't realize
                        that they are writing to people in different groups.

                        As for how, I don't know how it is done in MSOE. I guess there is an
                        option to show more header lines. The one you need to fill in is
                        called "Followup-To". A good newsreader should query you for the
                        followup whenever you crosspost.
                        [color=blue]
                        > The "screw up" of Netscape 7.0 is that I link a image and a text, give the
                        > link a border and the border goes trough the image (see the refresh option).
                        > Next to that it does not react on the "width" I set in the style of the
                        > link.
                        > I prefer to have the link 150px width.[/color]

                        As other people have pointed out, Netscape is doing the right thing and IE
                        is failing to understand CSS 2 (as usual).
                        [color=blue]
                        > Oh? I though so, it shows me lightgray in IE6. So it's not one of the 216
                        > colors..[/color]

                        It didn't before, but it does now. Curious. But still, it is not one
                        of the official 16 named CSS 2 colors (really HTML 4 colors, and there
                        are 17 in CSS 2.1 - they added "orange").
                        <URL:http://www.w3.org/TR/CSS21/syndata.html#va lue-def-color>

                        Some browsers allow more color names (why not) and they usually take
                        the standard X-windows color names (which are not all very logically
                        names). I guess lightgray is one of those.
                        [color=blue]
                        > I'll change it to a color code, thanks. #ccc is about the same.[/color]

                        You could try "silver" (#c0c0c0) if you want to use a named color.
                        [color=blue]
                        > : Don't use javascript:-URIs (like "javascript:win dow.print()"). Use
                        > : onclick attributes instead. <URL:http://jibbering.com/faq/#FAQ4_24>
                        > Thanks!
                        > What other html tag does support hover events?[/color]

                        In IE, only A elements (CSS 2 allows it on all elements, but as I said
                        before ... IE and CSS 2 are not very compatible).
                        You should still use the A element, just use an onclick handler:
                        Instead of
                        <a href="javascrip t:somecode()"> ... </a>
                        do:
                        <a href="pageRequi resJS.html" onclick="someco de();return false"> ... </a>
                        Then you can use the link to tell people that your page requires
                        Javascript, so people without it will know why it fails instead of
                        just nothing happening.

                        Read the link I gave! It's a good FAQ.
                        [color=blue]
                        > So I can put it in the stylesheet:[/color]
                        [color=blue]
                        > tag:hover{..}
                        >
                        > How funny; MSIE 6 does not support hover for span.. and NN 7.0 does..[/color]

                        IE sucks. 'nuff said.
                        /L
                        --
                        Lasse Reichstein Nielsen - lrn@hotpop.com
                        DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                        'Faith without judgement merely degrades the spirit divine.'

                        Comment

                        • Lasse Reichstein Nielsen

                          #13
                          Re: Replace Contextmenu with new menu

                          kchayka <kcha-un-yka@sihope.com> writes:
                          [color=blue]
                          > You assume all your visitors are mouse users? The browser's inbuilt
                          > context menus are accessible via keyboard. Yours is not.[/color]

                          Actually it is ... a little. Pressing the "context menu" button and using tab,
                          I can go through the links in the menu in both IE and Mozilla.

                          It's not great, though (I would prefer arrow keys to navigate)

                          /L
                          --
                          Lasse Reichstein Nielsen - lrn@hotpop.com
                          DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                          'Faith without judgement merely degrades the spirit divine.'

                          Comment

                          • DJ WIce

                            #14
                            Re: Replace Contextmenu with new menu


                            : It did the trick of sending to all the groups. However, when one does
                            that,
                            : it is highly recommended ... to specify which groups
                            : followups should go to.
                            I understand.

                            : I guess there is an option to show more header lines ..
                            Ah I see; View => Check "All headers".
                            Thanks, I did not know that I needed to search such in the header view
                            section!
                            Thanks!


                            : It didn't before, but it does now. Curious. But still, it is not one
                            : of the official 16 named CSS 2 colors (really HTML 4 colors, and there
                            : are 17 in CSS 2.1 - they added "orange").
                            : <URL:http://www.w3.org/TR/CSS21/syndata.html#va lue-def-color>
                            Thanks!
                            I used names to instead of colorcodes because I though it would be more
                            compatible...
                            But now I think I'll go back to RGB :-)


                            : > I'll change it to a color code, thanks. #ccc is about the same.
                            : You could try "silver" (#c0c0c0) if you want to use a named color.
                            Do you know why #ccc and #cccccc exists? I mean what is prefered?

                            : > What other html tag does support hover events?
                            : In IE, only A elements ...
                            Yeah even worse: only on A elements containing href..

                            : <a href="pageRequi resJS.html" onclick="someco de();return false"> ... </a>
                            : Then you can use the link to tell people that your page requires
                            : Javascript, so people without it will know why it fails instead of
                            : just nothing happening.
                            Ah, yeah, an pop up (alert) would not work and proble target="_blank" does
                            not make it more nice :)
                            I'll work on it, it's now a #, scrolling up for users without JS, right?


                            : Read the link I gave! It's a good FAQ.
                            I did partly, block worked great.. now only I have some space to remove..

                            Wouter


                            Comment

                            • Lasse Reichstein Nielsen

                              #15
                              Re: Replace Contextmenu with new menu

                              "DJ WIce" <contextmenu@dj wice.com> writes:
                              [color=blue]
                              > Do you know why #ccc and #cccccc exists? I mean what is prefered?[/color]

                              They are completely equivalent, and neither is prefererred. Use
                              whatever you like better. The short notation is probably just to
                              save space.
                              [color=blue]
                              > Yeah even worse: only on A elements containing href..[/color]
                              Ick.
                              [color=blue]
                              > I'll work on it, it's now a #, scrolling up for users without JS, right?[/color]

                              Or down. Or reloading the page. That depends on the browser.

                              /L
                              --
                              Lasse Reichstein Nielsen - lrn@hotpop.com
                              DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                              'Faith without judgement merely degrades the spirit divine.'

                              Comment

                              Working...