FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Java Hide/Show Link Error

 


smokey4life
Hello everyone, i have a little problem. On my site at http://www.blacknmild.frih.net you will see right below the header graphic i have a little java script to hide and show my menu to the left. It works just fine but the problem is that when your not on the main index page it automatically redirects you to the main index page. The link when you click the hide/show is http://www.blacknmild.frih.net/# How can i make this work on every page other then just the main index page? I need it to know the pathway as you browse the site so that it will automatically update the link for each page. Heres the code for the script thats in my main template page Thanks for all your help i appreciate it a lot!


Code:
<div id="pathway_text">
               <a href="#" onclick="opacity.toggle();"></a>
   <a href="#" onclick="fadesize.toggle('width');"><img src="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/images/showhide.png" id="showhide" border="0"></a><?php mosPathWay(); ?>
            </div>
Ranfaroth
The a element is for link. So don't use it if there is no link...
smokey4life
Ranfaroth wrote:
The a element is for link. So don't use it if there is no link...
Yes but if i remove the link reference along with the # and all that it does not work i just need to get it to call the current page they you are on and have it add the # at the end correct? How would i go about doing this? Anyone knowledgeable here?
BlueVD
if you were to cut everything in the href param of the A tag it should work
That is, your link should be like this:
Code:
<a href="#">Menu</a>

Or post your JS in a pastebin so we can see it and find another way to run it other than the link...
Ranfaroth
smokey4life wrote:
Yes but if i remove the link reference along with the # and all that it does not work i just need to get it to call the current page they you are on and have it add the # at the end correct?
Sorry, I can't understand your sentence...
smokey4life
BlueVD wrote:
if you were to cut everything in the href param of the A tag it should work
That is, your link should be like this:
Code:
<a href="#">Menu</a>

Or post your JS in a pastebin so we can see it and find another way to run it other than the link...


Im sorry but i understand how that would work if i was to cut the rest of it out and only used what you suggested it would no longer hide what it is supposed to.... it has to come complete with the
Code:
onclick="fadesize.toggle('width');">
See my problem is that it works fine on the homepage as it is right now but if i was to go to say /videos.php and click the hide link it hides the menu just fine but then it redirects me to my index.php I need this to work on EVERY page not just the main index.
smokey4life
I still have been unable to fix this problem, also for some reason i cant use anchors... If i add an anchor on an item and put the anchor link on something it redirects me as if it was an actual link, its kinda weird never had something like this happen before. Example, if i add the anchor to something say "video" then on the top of the page i add the "#video" link to a table of contents section it redirects me to my /index.php page. No one seems to know why this would be doing this and i cannot get it fixed any help would be appreciated thanks in advance.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.