Open two links in different new tabs, not in the same - html

I have two links in my page with target="_blank", but if i open the first link in a new tab, when i click in the second, the page loads in tha tab that the first link are already open, i need to make they open in different tabs, not in the same. Thanks.
Add the code...
<ul style="float: left;">
<li><span>Help Desk</span></li>
<li><span>Bússola</span></li>
</ul>

target="_blank" is the correct (and possibly the only) way to do this but how it behaves depends on the browser and browser settings.
See HTML: how to force links to open in a new tab, not new window for more details.
A workaround might be to give them different names like so:
<ul style="float: left;">
<li><span>Help Desk</span></li>
<li><span>Bússola</span></li>
</ul>
That should force the browser to open two new tabs and if you click the first link, then always the same frame will reload (same for the second tab).

Try with javascript function like this
Html:
Target
Javascript:
<script>
function open_win()
{
window.open("https://www.google.co.in/");
}
</script>
https://stackoverflow.com/a/18764547/1428854

Related

Highlighting Current Page Menu Tab Using HTML and CSS

Can someone please offer me some advice?
I'm trying to customise a website and its HTML Nav Menu. By default, the menu already highlights the current tab for all existing pre-built pages.
http://webservices.retrotorque.com
I've added a new page to the website - Website Design - and I've added a tab to the menu for that page. All fine. But I can't find a way of making that tab become highlighted for only when that page is viewed.
Here is the existing code for one of the default tabs, which works fine.
<li class="first <#tag:homesection /#>">
Home
Here's my code for the menu tab I've created for my new page:
<li class="levelone <#tag:webdesignsection /#> ">
Website Design
<li>
My problem is that I can't find where to define:
<#tag:webdesignsection /#>
So I may need to find another solution.
I've thought of another approach:
<li class="levelone active">
Website Design
<li>
This code does work, but only in so much as the tab is always highlighted, whichever page is being viewed.
Is there a way of wrapping this up in a 'conditional'? So that it only applies when viewing the websitedesign page. And I could have a non-active alternative, conditionally set up for when viewing any of the other pages.
Thanks.
i think you should put JQuery there that can addClass and removeClass active from li element.
there is for example
var url = document.URL;
$('#example li a[href="'+url+'"]').parent().addClass('active');

Getting a link to go to a specific section on another page

I have a link on one page that needs to go to a different page, but load to a specific section on that other page.
I have done this before with bootstrap but they take all the 'coding' out of it, so I need to know how to do from scratch. Here is the markup I have based on this link (not the best resource, I know): http://www.w3schools.com/html/html_links.asp
**Page One**
<a href="/academics/page.html#timeline> Click here </a>
**Page I am linking to**
<div id="timeline" name="timeline"> ... </div>
Can I do this with just HTML, or do I need some JavaScript? If I need to do it via JS, it needs to be on the target page, right?
I believe the example you've posted is using HTML5, which allows you to jump to any DOM element with the matching ID attribute. To support older browsers, you'll need to change:
<div id="timeline" name="timeline" ...>
To the old format:
<a name="timeline" />
You'll then be able to navigate to /academics/page.html#timeline and jump right to that section.
Also, check out this similar question.
You can simply use
<a href="directry/filename.html#section5" >click me</a>
to link to a section/id of another page by
To navigate to a section of another page use:
<a href="example.html#example-section>name-of-link</a>
The example.html would be the page you want to go to, and the #example-section would be the name of the id on that page that you want to navigate to.
To link from a page to another section of the page, I navigate through the page depending on the page's location to the other, at the URL bar, and add the #id. So what I mean;
This takes you #the_part_that_you_want at the page before
I tried the above answer - using page.html#ID_name it gave me a 404 page doesn't exist error.
Then instead of using .html, I simply put a slash / before the # and that worked fine. So my example on the sending page between the link tags looks like:
El Chorro
Just use / instead of .html.
To link from a page to another section just use
my first div

Moving to a tab and a specific location within that tab

I have a page with a link on, and three tabs. Default view is Tab 1
The tabs are below the page fold
The end result should be that, when the person clicks on the link, it should open Tab3 and move the page up so that the user can view the content of the tab.
As it stands now, the user clicks on the link and it opens the tab3, but because the tabs are below the page fold, it seems like nothing is happening.
I want the screen to move down to the tab as well. Im currently using onClick="parent.location='#contact'" to open the tab
This is the code for the link
<form>
<input class="listbutton" type="button" onClick="parent.location='{site_url}
{url_title text="`$action_object->m_listing_info->title`"}/
{route_suffix for="listings"}{$action_object->m_listing_info->listing_id}#contact'"
value="{translate text='contact_owner'}" title="{translate
text='listestablishmentforfree'}">
</form>
This is the code where it's linking to
<li>
<span>{translate text='contact_owner'}</span>
</li>
As you did not have code, so what i can understand i am helping u
$('#anchorID').click(function() {
$("#contacts").focus();
});

link vs button dilemma

Can anyone shed some light to this situation: I have a link that opens in a modal, i add a link and a button that are set to go to the same url. If i click the link, the modal goes to the link, and shows the article properly. If i click the button, it shows the article embedded on the page.
Here's the url, click on newtest2
http://zaazoolive.thewebbusters.com/index.php?option=com_content&view=category&id=1&Itemid=2
Here's the code
<head>
<script type="text/javascript">
function change_url(){
window.location.href="http://zaazoolive.thewebbusters.com/index.php?option=com_content&view=article&id=1:newtest&catid=1:test&Itemid=2"
}
</script>
next
</head>
<body>
<button onclick="location.href='http://zaazoolive.thewebbusters.com/index.php?option=com_content&view=article&id=1:newtest&catid=1:test&Itemid=2'">Next</button>
</body>
</html>
There is a apparent difference, being that the link calls window.location, while the button just sets location, but this is semantically the same.
That popup you got is created by JavaScript. So the link is just used for its url, but when you click it, a script gets executed that loads the content asynchronously and shows it in a popup.
This script does not affect the button (though it could). Find the script that does this and apply it to the button too.
A workaround could be:
<a href="http://zaazoolive.thewebbusters.com/index.php?option=com_content&view=article&id=1:newtest&catid=1:test&Itemid=2">
<button></button>
</a>
Edit: Although it's working, is not a recommended code, as HTML spec clearly says that using tag for item is invalid, so treat this ONLY as a workaround.
P.S. Why are you using <a></a> in section head?

Removing HTML frames

I have a website which splits the screen into two frames; the top half is the name of my website; the bottom half is an advertised website.
I want it so if the user clicks the link on the top half (my website) the user is taken to my homepage.
This works, but my website is loaded into the top half and not the whole screen.
How do I get the link to remove the frames and display my website in the whole browser.
Here's what I'm talking about:
http://www.thefacebookies.com/advertise.php
Have tried target="_top" which doesn't work.
Many thanks.
You have:
<a onClick="window.location ='bet.php'" target="_top">
That should be:
<a href="bet.php" target="_top">
Don't use JavaScript when HTML will
do.
The target attribute doesn't influence assignments to window.location
<A HREF="http://www.xyz.com" TARGET="_top">
"_top" loads the linked document in the topmost frame, that is, the new page fills the entire window.
See
target Property
From javascript you can
parent.location = new location;