aPossible to Make A "Dummy" Anchor Tag **without** Jumping Back Up???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Prisoner at War

    aPossible to Make A "Dummy" Anchor Tag **without** Jumping Back Up???

    Hi, People,

    Is it possible to have an "empty" or "dummy" <a href***without* **
    the browser jumping back up the page??

    I have a hyperlink that doesn't point to another document, but is used
    to call forth a modal window onClick (or is there another way, without
    text or image links, of calling forth JavaScript on user activity??).
    I would like to spare my visitors the inconvenience and visually
    jarring effect of getting thrown back up to the top of the page! =(
  • Prisoner at War

    #2
    Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???


    Ah, well, using "javascript :;" for a value did the trick! The browser
    no longer throws the viewer back up to the top of the page.

    Unfortunately, that modal window doesn't center vertically, so *it* is
    still up at the top of the page!

    How can I center an element *vertically*, please?

    It's just a box, actually, and I know that with CSS "auto" centers it
    horizontally -- but what about vertically??

    Comment

    • Jim Moe

      #3
      Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???

      On 05/01/08 04:16 pm, Prisoner at War wrote:
      >
      Is it possible to have an "empty" or "dummy" <a href***without* **
      the browser jumping back up the page??
      >
      I have a hyperlink that doesn't point to another document, but is used
      to call forth a modal window onClick (or is there another way, without
      text or image links, of calling forth JavaScript on user activity??).
      >
      You can use the onClick attribute with just about any element. It soes
      not have to be an anchor.

      --
      jmm (hyphen) list (at) sohnen-moe (dot) com
      (Remove .AXSPAMGN for email)

      Comment

      • dorayme

        #4
        Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping Back Up???

        In article
        <1964716b-5459-44c9-9380-93059c5a6857@m4 5g2000hsb.googl egroups.com>,
        Prisoner at War <prisoner_at_wa r@yahoo.comwrot e:
        Ah, well, using "javascript :;" for a value did the trick! The browser
        no longer throws the viewer back up to the top of the page.
        >
        Unfortunately, that modal window doesn't center vertically, so *it* is
        still up at the top of the page!
        >
        How can I center an element *vertically*, please?
        >
        It's just a box, actually, and I know that with CSS "auto" centers it
        horizontally -- but what about vertically??
        Looked at

        <http://www.jakpsatweb. cz/css/css-vertical-center-solution.html>

        ?

        --
        dorayme

        Comment

        • Dan

          #5
          Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???

          On May 1, 7:16 pm, Prisoner at War <prisoner_at_.. .@yahoo.comwrot e:
          Hi, People,
          >
          Is it possible to have an "empty" or "dummy" <a href***without* **
          the browser jumping back up the page??
          End the JavaScript with "return false;" and that will suppress the
          jump to the normal href destination.

          It's then a good idea to make the href value a URL to a separate page
          with the same content as the attempted popup, so as to make that
          content accessible to non-JavaScript users.

          --
          Dan

          Comment

          • Herbert Blenner

            #6
            Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???

            On May 1, 7:16 pm, Prisoner at War <prisoner_at_.. .@yahoo.comwrot e:
            Hi, People,
            >
            Is it possible to have an "empty" or "dummy" <a href***without* **
            the browser jumping back up the page??
            >
            I have a hyperlink that doesn't point to another document, but is used
            to call forth a modal window onClick (or is there another way, without
            text or image links, of calling forth JavaScript on user activity??).
            I would like to spare my visitors the inconvenience and visually
            jarring effect of getting thrown back up to the top of the page!  =(
            Try using <a href="#" onclick=" . . . ;return false">

            Herbert

            Comment

            • Stanimir Stamenkov

              #7
              Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???

              [Note: follow-up to comp.lang.javas cript]

              Thu, 1 May 2008 16:16:49 -0700 (PDT), /Prisoner at War/:
              Is it possible to have an "empty" or "dummy" <a href***without* **
              the browser jumping back up the page??
              >
              I have a hyperlink that doesn't point to another document, but is used
              to call forth a modal window onClick (or is there another way, without
              text or image links, of calling forth JavaScript on user activity??).
              I would like to spare my visitors the inconvenience and visually
              jarring effect of getting thrown back up to the top of the page! =(
              If the element is not really a hyper link why marking it as such?
              Better use generic SPAN element or A(nchor) element without 'href'
              and attach 'click' handler to it. This will spare your visitors the
              confusion with encountering hyper links which are not really hyper
              links.

              Apart from that from the incorrect hyper link usage note, you could
              always return false in the 'click' handler to prevent the browser
              from doing its default action - to follow the link:

              <script type="text/javascript">
              function openWindow(url, name, features) {
              if (open) {
              var n = (name) ? name : "_blank";
              var f = (features) ? features : "resizable,scro llbars";
              var win = open(url, n, f);
              if (win) {
              return false;
              }
              }
              return true;
              }
              </script>

              <a href="http://www.w3.org/"
              onclick="return openWindow(this .href);">W3C</a>

              --
              Stanimir

              Comment

              • Prisoner at War

                #8
                Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???

                On May 1, 8:19 pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
                >
                >
                Looked at
                >
                <http://www.jakpsatweb. cz/css/css-vertical-center-solution.html>
                >
                ?
                >
                --
                dorayme

                Hmmm!! Looks interesting!

                Thanks, this just might be the ticket! I'll have to give it a shot --
                but it looks like it will work! (At least I can understand the
                example in theory!)

                Comment

                • Prisoner at War

                  #9
                  Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???

                  On May 1, 8:26 pm, Dan <d...@tobias.na mewrote:
                  >
                  >
                  End the JavaScript with "return false;" and that will suppress the
                  jump to the normal href destination.
                  Good grief! I'd totally forgotten that!!

                  Yes, it says just so in Chapter 4, Rollover Buttons, of "The Book of
                  JavaScript, Second Edition!" Damn, in one ear, out the other....
                  It's then a good idea to make the href value a URL to a separate page
                  with the same content as the attempted popup, so as to make that
                  content accessible to non-JavaScript users.
                  Actually, the href doesn't point to a document, but to text that's
                  invisible until invoked by an onClick, creating that modal window.

                  God, what a dilemma! Just what in heck am I supposed to do about
                  those people (like me!) whose IE7 disabled ActiveX Controls??
                  --
                  Dan

                  Comment

                  • Prisoner at War

                    #10
                    Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???

                    On May 1, 8:26 pm, Herbert Blenner <a1ea...@verizo n.netwrote:
                    >
                    >
                    Try using <a href="#" onclick=" . . . ;return false">
                    >
                    Herbert
                    Many thanks -- for the reminder! Can't believe I forgot that one....

                    Comment

                    • Neredbojias

                      #11
                      Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping Back Up???

                      On 01 May 2008, Prisoner at War <prisoner_at_wa r@yahoo.comwrot e:
                      I have a hyperlink that doesn't point to another document, but is used
                      to call forth a modal window onClick (or is there another way, without
                      text or image links, of calling forth JavaScript on user activity??).
                      Sure. onmouseover, onmouseout, onsubmit, etc., etc.
                      I would like to spare my visitors the inconvenience and visually
                      jarring effect of getting thrown back up to the top of the page! =(
                      --
                      Neredbojias

                      Great sights and sounds

                      Comment

                      • Prisoner at War

                        #12
                        Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???


                        Say, just as an update: it turns out that I was able to achieve
                        vertical alignment by simply using the position:fixed property and
                        value, in conjunction with margin:23% (it was originally margin:
                        400px)....

                        I may have lucked out, though, as I'm not sure exactly how it's
                        working in the code I've got (below)...also rather bummed that Sam
                        Collison's good if dry CSS book didn't discuss the vertical-align
                        property at all despite listing it in the appendix!


                        #overlay div
                        {
                        width:300px;
                        margin: 23% auto;
                        background-color: #fff;
                        border:1px dashed #000;
                        padding:15px;
                        text-align:center;
                        position:fixed;
                        left: 38%;
                        }

                        Comment

                        • Prisoner at War

                          #13
                          Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???


                          Ackk!!

                          That position:fixed property and value has an odd visual artifact in
                          Firefox 2! (It has a different one in Opera 9!)

                          The modal window that's "on" the page is invisible until turned on by
                          a function that's called onClick -- except when scrolling the webpage,
                          without having clicked on the hyperlink that calls the function: text
                          scrolling past that invisible modal window "drags by" in the form of
                          that modal window! It's like when in the Schwarzenegger movie
                          "Predator" the alien goes invisible, but you can still see the vague
                          "shimmer" of its outline, especially when it moves....

                          In Opera 9, position:fixed causes the bottom half of the text in the
                          modal window to not display if that modal window pops up below "the
                          fold" (the halfway scroll-point of a webpage)!

                          Can somebody tell me what's the matter with all this?? Some kind of
                          inheritance bugaboo??

                          #overlay div
                          {
                          width:300px;
                          margin: 23% auto;
                          background-color: #fff;
                          border:1px dashed #000;
                          padding:15px;
                          text-align:center;
                          position:fixed;
                          left: 38%;
                          }

                          Comment

                          • Jukka K. Korpela

                            #14
                            Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping Back Up???

                            Scripsit Prisoner at War:
                            Hi, People,
                            People just left after noticing your pointless crossposting without even
                            setting followups and your continued violation of netiquette when you
                            comment without quoting what you are responding to. Stay tuned to
                            getting ignored in future unless you learn some habits.
                            Is it possible to have an "empty" or "dummy" <a href***without* **
                            the browser jumping back up the page??
                            Yes, <a href="#foo" name="foo">. But why would you do that? It's 100.1%
                            certain that you don't understand what your real problem is and that you
                            are consequently creating new problems.
                            I have a hyperlink that doesn't point to another document, but is used
                            to call forth a modal window onClick
                            So what made you use a link when you don't want to link?
                            (or is there another way, without
                            text or image links, of calling forth JavaScript on user activity??).
                            Yes of course. Read any introduction to basics of the elements of using
                            client-side scripting on www pages. Make sure it's a modern one that
                            discusses the problem "how do I create the <input type="button"el ement
                            dynamically so that it does not appear when it does not work, i.e. when
                            scripting is disabled?".
                            I would like to spare my visitors the inconvenience and visually
                            jarring effect of getting thrown back up to the top of the page! =(
                            Spare them the nasty effects of creating new windows for them.

                            Followups set to alt.html.

                            --
                            Jukka K. Korpela ("Yucca")


                            Comment

                            • Prisoner at War

                              #15
                              Re: aPossible to Make A &quot;Dummy&quo t; Anchor Tag **without** Jumping BackUp???

                              On May 2, 1:52 am, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
                              >
                              >
                              People just left after noticing your pointless crossposting without even
                              setting followups and your continued violation of netiquette when you
                              comment without quoting what you are responding to. Stay tuned to
                              getting ignored in future unless you learn some habits.
                              I don't understand what you mean. How's the cross-posting pointless?
                              I'm working on my site, which involves CSS and JavaScript in addition
                              to HTML and general design issues.
                              Yes, <a href="#foo" name="foo">.
                              Hmmm, using a name or id attribute stops the browser from trying to
                              follow the href the way a "javascript :;" or "return false;" does?
                              Interesting!
                              But why would you do that?
                              "
                              I have a hyperlink that doesn't point to another document, but is used
                              to call forth a modal window onClick (or is there another way, without
                              text or image links, of calling forth JavaScript on user activity??).
                              I would like to spare my visitors the inconvenience and visually
                              jarring effect of getting thrown back up to the top of the page! =(

                              "
                              It's 100.1%
                              certain that you don't understand what your real problem is and that you
                              are consequently creating new problems.
                              Very possible. That's why I'm asking around!
                              So what made you use a link when you don't want to link?
                              Well, the user has to have a way of calling forth information in that
                              modal window. (And no I really do want that information in a modal
                              window instead of "cluttering " up the rest of my paragraph.)
                              Yes of course. Read any introduction to basics of the elements of using
                              client-side scripting on www pages. Make sure it's a modern one that
                              discusses the problem "how do I create the <input type="button"el ement
                              dynamically so that it does not appear when it does not work, i.e. when
                              scripting is disabled?".
                              Hmm, an input button! I would need it very small, though...I'm using
                              a modal window like a footnote, see, or an endnote...I wonder if I can
                              style that button to be visually minuscule....
                              Spare them the nasty effects of creating new windows for them.
                              But that's the thing -- I don't want a webpage full of footnotes, or
                              redirect the user to another page full of endnotes. A modal window is
                              the only way I can think of where somewhat extraneous information can
                              still be offered...unles s...I use some kind of "thought balloon"??
                              Hey, can I do them Ajax-style onMouseOver balloons with *JavaScript*??
                              Followups set to alt.html.
                              Why? The topic of modal windows and how to best implement them seems
                              relevant to all the newsgroups I'd chosen.
                              --
                              Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
                              I hate yucca...it's cactus -- helpful for thirst in the desert I
                              suppose but not a good-tasting plant to cook with!

                              Comment

                              Working...