Jump to content

anchors in div with hidden overflow


Guest aragee

Recommended Posts

Guest aragee

Hi guys.I have a quick question. I need to be able to jump to a certain piece of text within a div (using named anchors) with hidden overflow.I have made custom up/down arrows to scroll the div, but, for example, I need to know how to jump to a certain line and scroll the div to a particular section when a named anchor is linked to within the div (from outside the div, ie a menu).Hope my explanation is clear.Thanks in advance.

Link to comment
Share on other sites

If i m not wrong, u want to toggle in the same page, i.e., when u click on a text or an image which is on the top of the pagethat should link on the mibble or bottem part of the same page...If yes... following example code may help you out.

Just by clicking on text - "div":<body><a href="#div">div</a>----------<a name="div"> linked part on the same page </a>----------</body>
or
Just by clicking on image - "div.gif":<body><a href="#div"><img src = "div.gif"></a>----------<a name="div"> linked part on the same page </a>----------</body>
or
moving up and down:<body><a href="#div", name="top">div</a>----------<a name="div"> linked part on the same page </a>----------<a href="#top">top</a></body>
Link to comment
Share on other sites

Please use IDs, not names. Also, why use an anchor just to give some text a name? ANY element can have IDs.

<p><a href="#whoo">Link</a></p><p id="whoo">Content that the link brings to.</p>

However, aragee, I am not sure what you want with your hidden overflow...

Link to comment
Share on other sites

Yes I agree you. Mine piece of code is long.

Please use IDs, not names. Also, why use an anchor just to give some text a name? ANY element can have IDs.
<p><a href="#whoo">Link</a></p><p id="whoo">Content that the link brings to.</p>

However, aragee, I am not sure what you want with your hidden overflow...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...