PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.html > aPossible to Make A "Dummy" Anchor Tag **without** Jumping Back Up???
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
aPossible to Make A "Dummy" Anchor Tag **without** Jumping Back Up???

Réponse
 
LinkBack Outils de la discussion
Vieux 02/05/2008, 00h16   #1 (permalink)
Prisoner at War
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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! =(
  Réponse avec citation
Vieux 02/05/2008, 00h30   #2 (permalink)
Prisoner at War
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: aPossible to Make A "Dummy" 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??
  Réponse avec citation
Vieux 02/05/2008, 01h18   #3 (permalink)
Jim Moe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: aPossible to Make A "Dummy" 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)
  Réponse avec citation
Vieux 02/05/2008, 01h26   #4 (permalink)
Dan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: aPossible to Make A "Dummy" Anchor Tag **without** Jumping BackUp???

On May 1, 7:16 pm, Prisoner at War <prisoner_at_...@yahoo.com> wrote:
> 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
  Réponse avec citation
Vieux 02/05/2008, 01h26   #5 (permalink)
Herbert Blenner
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: aPossible to Make A "Dummy" Anchor Tag **without** Jumping BackUp???

On May 1, 7:16pm, Prisoner at War <prisoner_at_...@yahoo.com> wrote:
> 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
  Réponse avec citation
Vieux 02/05/2008, 01h28   #6 (permalink)
Stanimir Stamenkov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: aPossible to Make A "Dummy" Anchor Tag **without** Jumping BackUp???

[Note: follow-up to comp.lang.javascript]

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,scrollbars";
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
  Réponse avec citation
Vieux 02/05/2008, 02h56   #7 (permalink)
Prisoner at War
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: aPossible to Make A "Dummy" Anchor Tag **without** Jumping BackUp???

On May 1, 8:19 pm, dorayme <doraymeRidT...@optusnet.com.au> wrote:
>
>
> 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!)
  Réponse avec citation
Vieux 02/05/2008, 02h58   #8 (permalink)
Prisoner at War
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: aPossible to Make A "Dummy" Anchor Tag **without** Jumping BackUp???

On May 1, 8:18 pm, Jim Moe <jmm-list.AXSPA...@sohnen-moe.com> wrote:
>
>
> You can use the onClick attribute with just about any element. It soes
> not have to be an anchor.


Ah, yes, thanks; I'd forgotten that! As it is, I do need a hyperlink,
though it doesn't point to another document, but to a function that
manipulates a <div> or two in order to present a modal window....

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


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 06h49.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12606 seconds with 16 queries