HighDots Forums  

Setting a link to scroll slightly above an anchor

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Setting a link to scroll slightly above an anchor in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AngryCloud
 
Posts: n/a

Default Setting a link to scroll slightly above an anchor - 06-29-2008 , 03:36 PM






Is it possible to have a link scroll to slightly above an anchor (like 10
pixels above)?

And before anyone suggests it... I cannot physically move the anchors. They
are part of a repeat region, where the anchor names are dynamically defined.


Reply With Quote
  #2  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Setting a link to scroll slightly above an anchor - 06-29-2008 , 07:09 PM






A link scroll to slightly above an anchor? Sorry - I have no idea what you
are trying to accomplish here. Can you say more?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"AngryCloud" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Is it possible to have a link scroll to slightly above an anchor (like 10
pixels above)?

And before anyone suggests it... I cannot physically move the anchors.
They
are part of a repeat region, where the anchor names are dynamically
defined.



Reply With Quote
  #3  
Old   
AngryCloud
 
Posts: n/a

Default Re: Setting a link to scroll slightly above an anchor - 06-29-2008 , 11:49 PM



You know how you can set links to jump to a specific part of a web page, such
as "Jump to Top"? You probably already know this, but the tag that defines
where the link should jump to is called an anchor. If possible, I want to set a
link to jump slightly above the anchor.


Reply With Quote
  #4  
Old   
Alsopo
 
Posts: n/a

Default Re: Setting a link to scroll slightly above an anchor - 06-30-2008 , 05:41 AM



create it dynamically i think

Reply With Quote
  #5  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Setting a link to scroll slightly above an anchor - 06-30-2008 , 06:21 AM



Please don't post if you aren't sure. In this case, you are incorrect.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Alsopo" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
create it dynamically i think


Reply With Quote
  #6  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Setting a link to scroll slightly above an anchor - 06-30-2008 , 06:22 AM



Put another anchor there for the link to jump to. You can also jump to an
element with an ID, e.g.,

<div id="foo">
....
<a href="#foo">Go to FOO</a>

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"AngryCloud" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
You know how you can set links to jump to a specific part of a web page,
such
as "Jump to Top"? You probably already know this, but the tag that defines
where the link should jump to is called an anchor. If possible, I want to
set a
link to jump slightly above the anchor.



Reply With Quote
  #7  
Old   
AngryCloud
 
Posts: n/a

Default Re: Setting a link to scroll slightly above an anchor - 06-30-2008 , 10:57 AM



Here's a demonstration of why I can't, or at least don't know how to, go about
using another anchor or moving the one already there:


<?php do { ?>
<div id="<?php echo $row['id']; ?>">
......
[...stuff to repeat...]
......
<br />
<?php while $row = mysql_fetch_assoc($query); ?>


(the div with the dynamic id is the anchor)

The problem is the anchor is the first thing in the repeat region. The only
method I can think of is putting an anchor with the id of the next record
before the <br />. The problem there is that there is no <br /> before the
first record. Also, I don't know how to get the ID of the next record.


Reply With Quote
  #8  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Setting a link to scroll slightly above an anchor - 06-30-2008 , 11:40 AM



Add some margin to the top of the 'home' container. And by the way, you
cannot have an all numeric ID (looks like your might be)....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"AngryCloud" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Here's a demonstration of why I can't, or at least don't know how to, go
about
using another anchor or moving the one already there:


?php do { ?
div id="<?php echo $row['id']; ?>"
......
[...stuff to repeat...]
......
br /
?php while $row = mysql_fetch_assoc($query); ?


(the div with the dynamic id is the anchor)

The problem is the anchor is the first thing in the repeat region. The
only
method I can think of is putting an anchor with the id of the next record
before the <br />. The problem there is that there is no <br /> before the
first record. Also, I don't know how to get the ID of the next record.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.