51 users online (1 members and 50 guests)  

Thread: Side Bar Target


  Results 1 to 6 of 6

Related

  1. Side by side html tables    Forum: HTML Forum
    Replies: 7
  2. Replies: 2
  3. Replies: 3
  4. tables appear side by side?    Forum: HTML Forum
    Replies: 1
  5. target    Forum: HTML Forum
    Replies: 5
  1. #1
    ghstbster's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2002
    Location
    Las Vegas
    Posts
    2

    Question Side Bar Target

    I recently changed my buttons on my vertical side bar and they use to open up a new window, so people could stay on my site longer. I had to change them because it took too long to load the page. So I found this tool that will builds a vertical bar for the side, ok my point is I now added the bar and the link wont open in a new window, Help I have the code but just dont know what to do to change that I used http://www.freesitetemplates.com/generators.html
    for the vertical links. and my site is http://pub95.ezboard.com/bghstbstersghosts
    Thankyou

  2. #2
    Anomoly's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2002
    Posts
    8
    to make a link open in a new window all u have to do is add a target that doesnt exist yet, for example... <a href=blah.html target=new> would open a new page. (i think thats wat u wanted? lol)

  3. #3
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi there.

    The links work via javascript, so we need to alter that.

    Assuming that you want all the links on the left to open in a new window change this code -

    Code:
    function LmUp(path)
    {location.href = path;}
    to
    Code:
    function LmUp(path)
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(path, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=500,height=500,left = 150,top = 50');");
    That should work. The code was generated using the popup maker on the left of this page.

    You will also have to change the <a href= of each link to look like this

    Code:
    <a href="#"
    otherwise, both pages will go to the clicked link
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  4. #4
    ghstbster's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2002
    Location
    Las Vegas
    Posts
    2
    Ok I tried that, And just so you know im blonde and I am having trouble with it. Ive tried numerous things and they dont work. The code you gave me is in there and do I need to type anything more into it. also the href="#" thing opened in a new window but my forum was the new window. Do you know of another vertical board that would be easier or do I need to keep trying. Note this is only a rough draft of my links I will be adding tons more to it. Sorry about this im just going nuts over here If this helps me any I pasted the beginning code so you can see what I have, only to the first link and then I stopped :
    <style type="text/css">
    <!--

    .Navlink {COLOR: #CC9900; TEXT-DECORATION: none; font-family: cursive; font-size: 10pt; font-weight: bold;}
    a:link.Navlink {color : #CC9900;}
    a:visited.Navlink {color : #CC9900;}
    a:active.Navlink {text-decoration: none;}
    a:hover.Navlink {text-decoration: none;}

    -->
    </style>
    <script language = "javascript">
    <!--

    function LmOver(elem, clr)
    {elem.style.backgroundColor = clr;
    elem.children.tags('A')[0].style.color = "#FFFFFF";
    elem.style.cursor = 'hand'}

    function LmOut(elem, clr)
    {elem.style.backgroundColor = clr;
    elem.children.tags('A')[0].style.color = "#CC9900";}

    function LmDown(elem, clr)
    {elem.style.backgroundColor = clr;
    elem.children.tags('A')[0].style.color = "#FFFFFF";}

    function LmUp(path)
    {location.href = path;}

    //-->
    </script>

    <table border="0" width="120" bgcolor="#000000" cellspacing="0" cellpadding="0">
    <tr><td width="100%">

    <table border="0" width="100%" cellspacing="1" cellpadding="1">
    <tr><td width="100%" onMouseover="LmOver(this, '#CC9900')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#CC9900')"
    onMouseUp="LmUp('http://www.ghostsandlegends.com/')" bgcolor="#000000"><A HREF="http://www.ghostsandlegends.com/" Class="navlink">&nbsp; Queen Mary</a></td></tr>
    Last edited by ghstbster; 08-16-2002 at 01:31 AM.

  5. #5
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    The code you hav given is the code before you changed it, so I do not know what is wrong with the version I gave you.

    To be honest, javascript is a bad idea for links, especially when you can achieve it better and simpler using CSS.

    Try -

    Code:
    Paste this into your <head> -
    <style type="text/css">
    a.leftBar {
    padding: 5px;
    font: 10pt verdana, sans-serif;
    background-color: white;
    color: black;
    margin-top: 10px;
    display: block;
    width: 100px;
    }
    a.leftBar:hover {
    background-color: black;
    color: white;
    }
    a.leftBar:active {
    background-color: #eeeeee;
    }
    </style>
    
    Then make your links like this -
    <a class="leftBar" href="ahfb_bak.php">Test link</a>
    This should make a 'menu bar' effect. Play with the colors , play with the width value until you are happy.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  6. #6
    asoft's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2007
    Posts
    1

    Re: Side Bar Target

    Hi
    I have implemented it through iframe but i have face some problem when i click iframe page the selected link appear as normal; background color remove have some idea to do this plz help me i am in trouble
    Thanks & regards



Tags for this Thread