When Links in the Page/Posts in my website are clicked, they correctly open in a new tab. But when the Anchor Texts or Page Jumps targetted to Top or any specific spot in the Page is clicked, that is also opening in a new tab.This may be because, I have inserted the Code '' in the Head using the Plugin Insert Headers and Footers, (after reading some tips like this) How to prevent the Page Jump Links from opening in a new Tab. Thanks for any help
Take a look at the target attribute for the <a> tag:
<a target="_self" href="">MyLink</a> = Open in the same tab window
<a target="_blank" href="">MyLink</a> = Open in new tab or window
If this doesn't work for you, then there's probably a bug in the plugin you're using... You probably either want to fix it or find another solution that suits your needs.
Related
im using wordpress and want to add a link which open in a frame/lightbox. Cant find a small solution for that.
There should be no new window. Just a content box which appear inside the page where i am. I hope u know what i mean
That should be pretty easy using the Easy Fancybox plugin.
Citing the entry from the FAQ section of the plugin's page:
Can I display web pages or HTML files in a FancyBox overlay?
Yes. First, enable the iFrame option on Settings > Media. Then, in your post or page content create a link to any web page or .htm(l) file in your content. Then switch to the Text tab in the Classic Editor or to Edit as HTML (under More options in the block menu) in Gutenberg, find the link <a ... > tag and give it a class="fancybox-iframe" attribute.
Voilà !
Beware, though, that:
Note: Not all external web pages are allowed to be embedded in an iframe and may be blocked by a server response header or script. The result will be either an empty/blank light box or the target page “breaking out” of the light box and loading in the main browser tab.
And you'd probably face the same problem with any other iframe solution. So that would work better with locally served pages.
I have done many Moves to get Get Direct CSS form website in google chrome but i failed. So tell me how to get it.
use view page source and in the opening window find the linking to the css right click it and open it in a new window you can copy it from there
for example in stackoverflow
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/stackoverflow/all.css?v=c9958f49ae3f">
I'm using a mac so it may be different for you. Try right-clicking on the page. Then select 'view page source' from the list. The chrome will open a new tab with the source code inside. From there you can even open the external css and js files. At this point just copy and paste the code. To view a certain elements source code just choose 'inspect element' and click on the element of which you wish to see the css. Then (even though the styles are beside checkboxes it still lets you highlight them) copy and paste those.
I have a task where:
I have a frame which contains some external url content.
This externale content has a list of several links to some articles.
My task is to open each of these links in a seperate window, when clicked.
My code is something similar to this:
I want to open each of the links within ibnlive to open in a new window, instead of the same window.
Could anyone please help or suggest me on this, or please do suggest alternatives if there are any
http://www.emanueleferonato.com/2007/08/22/create-a-lightbox-effect-only-with-css-no-javascript-needed/
You can add target="_blank" on the links you want to open in new window
For example
asd
Try adding target="_blank" in your <a> tag
It should look like this:
Here
Instead of using target="_blank" use target="_parent"
Link
I have a small problem.
I'm using iframe to insert the banner (with link to the outside website).
<iframe src="http://wifi.tucado.com/ads/001.html" name="i001" target="_blank" frameset frameborder=0 id="i001" scrolling="no"></iframe>
The problem I have is when I click on the banner INSIDE the frame it opens a page INSIDE a frame and I want it to open it in new window (or at least in the parent one).
Is there any way to do it without js or jquery?
If not, what should I do in jquery to make it working? I was trying to find an answer here, but found just very specific questions which don't face my problem directly.
Thanks for any help.
If you can control the source file that is loaded inside the iFrame (http://wifi.tucado.com/ads/001.html), try adding a target="_top" or target="_blank" in the links there.
I want to open a link in a new window using reStucturedText. Is this possible?
This opens link in the same window:
You can `check your location here. <http://geoiptool.com>`_
To open a page in a new window or tag you can add the attribute target="_blank" to your hyperlink although I'm not sure how you can add attributes to inline hyperlinks in reStructuredText. However, from the Docutils FAQ, is nested inline markup possible, you can use the raw directive to include raw HTML into your document, for example
You can |location_link|.
.. |location_link| raw:: html
check your location here
Update to address comments
I've had the question "why does reStructuredText not have [insert some awesome feature]".
In this case, "why does reStructuredText not have a way to specify how links are opened" — I think reStructuredText doesn't have an easy way of doing this since the behaviour of how clicking a link works isn't really it's responsibility. reStructuredText transforms markup — how that markup is ultimately displayed is not up to reStructuredText, but whatever browser or viewer the user chooses to use.
In the case of opening a link in a web browser, good useability practice dictates that you should not force a user to open a link in a new tab (which is what adding target="_blank" is doing). Rather, you should leave the choice of how to open the link up to the user. If a user wants to open a link in a new tab, then they can use their middle mouse button (or whatever their favourite shortcut key is).
So I think that it is perfectly acceptable that reStructureText does not have an easy target="_blank" feature. The fact that it is possible is nice for people who really want to do this is good, and the fact that it is a bit of pain to do so is good for discouraging this practice.
If you don't want to modify the theme, you can do what Ivonet did but with a custom.js file in the _static/js folder, then adding it to the conf.py like this:
html_js_files = [
'js/custom.js'
]
Leave out the html tags in _static/js/custom.js if you do this:
$(document).ready(function () {
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
});
This will also work if you'd like a shorter version.
$(document).ready(function () {
$('a.external').attr('target', '_blank');
});
I agree completely with the accepted answer, especially with the part where reStructuredText is not responsible for how a link behaves.
I still want it though so it should be solved in the theme. As I want all my external links to open in a new tab it becomes very cumbersome to do it as described above.
In my case I use a third party theme (sphinx_rtd_theme) and I put the following script near the end of the layout.html:
<script type="text/javascript">
<!-- Adds target=_blank to external links -->
$(document).ready(function () {
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
});
</script>
It seems to do the job just fine.
Hope it helps.
I recommend that you should use JavaScript to set target="_blank" for each external links.
See https://github.com/sphinx-doc/sphinx/issues/1634