I'm using HTML5 and I get the website url links to open up in another window named "collegeWin" via, , but i'd like for all the links I click to open to that same window, not a new window everytime. I don't want many new windows every click on a link. I did what the book said to, using the base element and use the target="collegeWin" but no luck. Any thoughts?
Here's my code:
<meta charset="UTF-8" />
<title>Wisconsin Colleges and Universities</title>
<script src="modernizr-1.5.js"></script>
<link href="hestyles.css" rel="stylesheet" type="text/css" />
<base target="collegeWin" />
Basically, you want to open all of your links 1 particular frame. Try this...
function callme(event) {
event.preventDefault();
document.frames["frame"].location = $(this).attr('href');
}
markup:
<a href="http://google.com" target="frame" onclick="callme.call(this,event)">
Link
</a>
<a href="http://yahoo.com" target="frame" onclick="callme.call(this,event)">
Link
</a>
Try this:
jsFiddle
Related
I'm trying to add a payment button to my web page (wix). When clicked, it opens in the same iframe like a widget, but I would like it to open in a new tab when clicked. target="_blank" does not work.
Example code:
<html>
<body>
<script src="https://www.example.com./integrations/v1/web-payment-checkout.js"
data-preference-id="example" data-source="button">
</script>
</body>
</html>
With Bootstrap you can use an anchor like a button.
OR use style to customize link as to appear like a button.
And use target="_blank" to open the link in a new tab.
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<br>
<a class="btn btn-success" href="https://www.google.com" target="_blank">open google in new tab</a>
</body>
</html>
If you want to open a link in a new tab from velo, I made a video workaround below:
https://joelgrayson.com/open-in-new-tab-wix-code
https://youtu.be/7yp-kLGu1Yw
Essentially, you cannot use <a href='' target='_blank'> in velo, but you can do it in an HTML frame. In the workaround, I messaged the HTML frame from velo. Upon receiving the message, the HTML frame opened using <a href='' target='_blank'.
I have a private (not public) website. In this website I want to use Lightbox2 (image gallery), but when I run lightbox2, the links of my home page and my background picture don't work.
There is a style.css in my template, and there is also one in lightbox2. I think this is the problem, but I'm not sure. Can anyone help me please?
Simply load in your own stylesheet and the one lightbox uses in the header
<link rel="stylesheet" href="css/lightbox.css">
<link rel="stylesheet" href="css/my_style.css">
At the end of the page you must also load in the javascript that comes with lightbox:
<script src="js/lightbox-plus-jquery.js"></script>
Don't forget to set the right attribute for all your pictures:
<a href="./pic.jpeg" data-lightbox="lightbox">
<img src="./pic.jpeg" style="width:100%">
</a>
How can i navigate from one HTML page to other HTML page using Mobile jQuery?
I tried this one:
function temperature()
{
$.mobile.changePage("temperature.html",{reloadPage:true});
}
when i clicked on temperature button temperature function is called.
<button id="TempConvert" data-theme="b" onClick="temperature()">Temprature Converter</button>
i got error message Error while Loading Page.
I used below scripts tags to include .js files
`<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.min.css" />
<link rel="stylesheet" href="index.css" />
<script src="jquery.mobile/jquery-1.7.2.min"></script>
<script src="jquery.mobile/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
`
You could use an anchor: Go temp! and style it so it looks like a button (that is what the data-role="button" part does).
The anchor will still behave like a regular anchor but it will look like a button.
I'm building a course site for my students, with different 'chapters' accessed from different links. I would like to be able to have two or more popups of the same page so I can view different parts of the same chapter side by side. Is this possible in highslide (I don't think it is...). Any solution, using highslide or not, would be appreciated!
Here's a jsfiddle demo that lets you open multiple HTML popups. In this case, both links are opening the same page of stuff, but that's just to keep the demo setup simple - normally you would have each link opening a different iframed page, but for your specific requirement, I guess you'd be opening the same page twice, just like this demo. Open the first link, then drag it by the header to one side, and open the second link.
http://jsfiddle.net/MisterNeutron/Qk6U6/1/
The code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Demo by MisterNeutron</title>
<script type='text/javascript' src="http://highslide.com/highslide/highslide-full.js"></script>
<link rel="stylesheet" href="http://highslide.com/highslide/highslide.css">
<script type='text/javascript'>
hs.graphicsDir = 'http://highslide.com/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
</script>
</head>
<body>
<div>
<a id="thumb1" href="http://highslide.com/examples/includes/include-short.htm" onclick="return hs.htmlExpand(this, { objectType: 'iframe' } )">First iframe</a>
<br><br>
<a id="thumb2" href="http://highslide.com/examples/includes/include-short.htm" onclick="return hs.htmlExpand(this, { objectType: 'iframe' } )">Second iframe</a>
</div>
</body>
</html>
I have used Dreamweavers menues to do give my site a dropdown list that I can then edit. Perhaps "open in new window" when you click the link will work. I have found that most clicks will default to open in the same window.
Opening tab with
require("sdk/tabs").open({
url:require("sdk/self").data.url("demo.html")
});
demo.html contains this element:
<a target="_blank" href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs">click me</a>
The target attribute is not honored, the page opens in the same tab and of course is subjected to all attach events on the tab.
I would comment but don't have enough reputation.
I just set up fresh firefox addon repo using cfx init to test this out, and in my case, it did open the link in a new tab.
Here is the code.
main.js
require("sdk/tabs").open({
url:require("sdk/self").data.url("demo.html")
});
and demo.html:
<html>
<head>
</head>
<body>
<p>Hello!</p>
<a target="_blank" href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs">click me</a>
</body>
</html>