PDA

View Full Version : Beating a dead horse- Named anchors


husky
08-26-2008, 07:37 PM
Hello,

I think this posting is like beating a dead horse. probably everybody had this problem but i just can't find a way out of it.

This is what I have using Dreamweaver 8:

<p><a href="#appr">1 - Apprentice</a></p>

The corresponding link where I want to go has:

<p align="center"><span class="blueBG"><a name="appr" id="appr"></a></span>


THE PROBLEM:

It works perfectly under FF3 but not under IE7.


Could anyone tell me what can be done to have this working in both FF3 and IE7?


Thanks for any help.

domedia
08-26-2008, 08:07 PM
Why do you have a link down there? It has no href attribute or anything in it.. try this instead:
<span class="blueBG" id="appr">made it!</span>
:)

husky
08-26-2008, 09:03 PM
Thanks for the reply.


Good. Your example works in IE7 and FF3, but I 'm confused.

Perhaps an explanation will help.

Actually I have:(already changed the first as you suggested). Now what do i have to do with the rest of the definitions to agree with your suggestion?
I entered all the links by hand and not using DW 8.


<p align="center"><span class="blueBG" id="appr"></span>[<a href="#appr">1</a> ]&nbsp;[<a href="#appr">2</a>]&nbsp;[<a href="#mstr">3</a>]&nbsp;[<a href="#secmstr"> 4</a>]&nbsp;[<a href="#perfmstr">5</a>] &nbsp;[<a href="#intimate">6</a>]&nbsp; [<a href="#provost">7</a>]&nbsp; [<a href="#intendant">8</a>] &nbsp;[<a href="#elu9">9</a>] &nbsp;[<a href="#elu15">10</a>]&nbsp; [<a href="#elu12">11</a>]&nbsp; [<a href="#mstrarchit">12</a>] &nbsp;[<a href="#royalarch">13</a>]&nbsp; [<a href="#perfelu">14</a>] &nbsp;[<a href="#keast"> 15</a>] &nbsp;[<a href="#prinjerus">16</a>] &nbsp;[<a href="#keastwest">17</a>]&nbsp; [<a href="#krc">18</a>] &nbsp;[<a href="#pontiff">19</a>] &nbsp;[<a href="#mstrsymblodge"> 20</a>] &nbsp;[<a href="#prussian">21</a>] &nbsp;[<a href="#princelibanus">22</a>]&nbsp; [<a href="#chtabern">23</a>] &nbsp;[<a href="#princetabern">24</a>]&nbsp; [ <a href="#kbrazen">25</a>]&nbsp; [<a href="#princemercy">26</a>] &nbsp;[<a href="#kcomtemple">27</a>] &nbsp;[<a href="#princeadept">28</a>]&nbsp; [<a href="#kstandreas">29</a>]&nbsp; [<a href="#kkadosh"> 30</a>] &nbsp;[<a href="#iinquisitor">31</a>]&nbsp; [<a href="#mastrrs">32</a>]&nbsp;&nbsp;{<a href="#top">TOP</a>} </p>


which is in Design mode;

[1 ] [2] [3] [ 4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [ 15] [16]..........{TOP}

This is repeated 32 different points in the page.So if I'm in 9, I can go to the {TOP} or to some other number.

With your suggestion I'm confused now. How will I define the "entry point" for the 2, 3,4 .. etc ?


With .<span .... . id="secmstr">[ 4]&nbsp;[id="perfmstr">5]&nbsp;... etc... </span>?

This will make all [number] to have the class='blueBG" and that's something I don't want.


Sorry if the explanation is confused but I'm even more confused in terms of what I thought it should be and what is should be according to you.

thanks
....

domedia
08-27-2008, 01:08 PM
Named anchors are not really hard. They're links inside a page. Often used as a link from top of the page to a place further down, or vice-versa.

Do you have a visual representation of what you're trying to do? A Photoshop mockup or something?

husky
08-27-2008, 02:58 PM
Thanks for your patience.

let's see if i can get this right the first time.
I kept my original WITHOUT your suggestion for you to see what I'm up to.

"TOP" ONLY here before the [1]
......
......

<a name="top" id="top"></a> <!-- this is the somewhere in the top of the page-->


[1 ] [2] [3] [ 4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [ 15] [16] [17] [18] [19] [ 20] [21] [22] [23] [24] [ 25] [26] [27] [28] [29] [ 30] [31] [32] {TOP}


<p align="center"><span class="blueBG"><a name="appr" id="appr"></a></span>[<a href="#appr">1</a> ]&nbsp;[<a href="#fc">2</a>]&nbsp;[<a href="#mstr">3</a>]&nbsp;[<a href="#secmstr"> 4</a>]&nbsp;[<a href="#perfmstr">5</a>] &nbsp;[<a href="#intimate">6</a>]&nbsp; [<a href="#provost">7</a>]&nbsp; [<a href="#intendant">8</a>] &nbsp;[<a href="#elu9">9</a>] &nbsp;[<a href="#elu15">10</a>]&nbsp; [<a href="#elu12">11</a>]&nbsp; [<a href="#mstrarchit">12</a>] &nbsp;[<a href="#royalarch">13</a>]&nbsp; [<a href="#perfelu">14</a>] &nbsp;[<a href="#keast"> 15</a>] &nbsp;[<a href="#prinjerus">16</a>] &nbsp;[<a href="#keastwest">17</a>]&nbsp; [<a href="#krc">18</a>] &nbsp;[<a href="#pontiff">19</a>] &nbsp;[<a href="#mstrsymblodge"> 20</a>] &nbsp;[<a href="#prussian">21</a>] &nbsp;[<a href="#princelibanus">22</a>]&nbsp; [<a href="#chtabern">23</a>] &nbsp;[<a href="#princetabern">24</a>]&nbsp; [ <a href="#kbrazen">25</a>]&nbsp; [<a href="#princemercy">26</a>] &nbsp;[<a href="#kcomtemple">27</a>] &nbsp;[<a href="#princeadept">28</a>]&nbsp; [<a href="#kstandreas">29</a>]&nbsp; [<a href="#kkadosh"> 30</a>] &nbsp;[<a href="#iinquisitor">31</a>]&nbsp; [<a href="#mastrrs">32</a>]&nbsp;&nbsp;{<a href="#top">TOP</a>} </p>


Now, I have a huge text divided in 32 chapters
DESIGN:
[1 ] [2] [3] [ 4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [ 15] [16] [17] [18] [19] [ 20] [21] [22] [23] [24] [ 25] [26] [27] [28] [29] [ 30] [31] [32] {TOP}

1 - APPR (chapter 1)
TEXT
TEXT
.......
[1 ] [2] [3] [ 4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [ 15] [16] [17] [18] [19] [ 20] [21] [22] [23] [24] [ 25] [26] [27] [28] [29] [ 30] [31] [32] {TOP}

<p align="center"><span class="blueBG"><a name="fc" id="fc"></a></span>[<a href="#appr">1</a> ]&nbsp;[<a href="#appr">2</a>]&nbsp;[<a href...... {TOP}

2 - FC (chapter 2)

TEXT
TEXT
.......

etc down to 32

[1 ] [2] [3] [ 4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [ 15] [16] [17] [18] [19] [ 20] [21] [22] [23] [24] [ 25] [26] [27] [28] [29] [ 30] [31] [32] {TOP}

PARTIAL CODE .for the chapter 31

<p align="center"><span class="yellowBG"><a name="iinquisitor" id="iinquisitor"></a></span>[<a href="#appr">1</a> ]&nbsp;[<a href="#appr">2</a>]&nbsp; &nbsp;...................... (just to avoid repetition )..................
[<a href="#iinquisitor">31</a>]&nbsp; ;{<a href="#top">TOP</a>}</p>


31 -MASTRSS (chapter 31)

TEXT
TEXT
.......

etc

Logic:

No matter what number I'm at, I always can click one of the numbers or {TOP} and go to the chapter I want or back to the TOP.
The chapter number I want to jump to is always in front of the [1 ] in all start of the chapters.

Thus, it works for FF3 and does not for the IE7.

If I understood it well then instead of <a name="iinquisitor" id="iinquisitor"></a> I should change that to
<span class="blueBG" id="iinquisitor">[31]</span>and the same approach to all other numbers.
Is this correct?


Thanks