Closed Thread Icon

Topic awaiting preservation: document.anchors difficulty (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8901" title="Pages that link to Topic awaiting preservation: document.anchors difficulty (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: document.anchors difficulty <span class="small">(Page 1 of 1)</span>\

 
Blaise
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2003

posted posted 10-13-2003 01:37

Hi guys, I've got a problem editting my anchors using document.anchors, here's my code so far...

code:
function hideButtons(modus, myLink){

var tPos=0 //position in image array of toggle button

//for loop to find the position of the current toggle button
for(i=0; i<document.anchors.length; i++){
if(document.anchors[i].id==myLink.id){
tPos=i;
}
}

//statement to hide/show all buttons for editable region
if(modus.value='WYSIWYG'){//hide buttons
for(i=(tPos-10); i<tPos; i++){
alert(document.anchors[i]..visibility='hidden');
}
}
else{//Show buttons
for(i=(tPos-10); i<tPos; x++){
document.anchors[i].style.visibility='visible';
}
}

}



I've got a couple of text editors on my pages and they each have the same buttons, one of which changes the modus(HMTL/WYSIWYG) all butons are created as images with an anchor tag surrounding it, what I want to do is get the location of the anchor in the anchors array, subtract 10 to get a new position (there are always 10 buttons in a row) and change each of the ten items in the array to hidden/visible depending on the modus.

The errors I keep getting is that document.anchors[i].style is null or not an object.

Any clues here or alternative solution I could try using?

TIA

Blaise.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 10-13-2003 08:47

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu