새 브라우저 창을 열 링크를 만들 수 있는 방법이 아닌 shift+tab) 을 사용하지 않고 javascript?
새 창을 열 수 있는 것이 아니라, 탭 (JavaScript 와 있지만 상당히 라코니콜리):
<a href="print.html"
onclick="window.open('print.html',
'newwindow',
'width=300,height=250');
return false;"
>Print</a>
, T # 39 이 대화상자와 영향력 있는 너회가 can& 모든 현대 순수 HTML 브라우저 (= 사용자) 가 이 비헤이비어를 완벽하게 제어할 수 있기 때문에 잘못 과거에 많이 왔다.
새 창을 열 수 있습니다 (HTML4) 또는 새로운 검색 컨텍스트로 (HTML5). 최근의 브라우저에서 검색 컨텍스트로 주로 ", 새로운 tab". 대신 새로운 window" ";). 그 영향력을 없습니다 # 39, t " can& 진실이며당신이 force"; 최신 브라우저 새 창을 열려면.
이를 위해서는 list. [앵커 요소점] (https://html.spec.whatwg.org/multipage/text-level-semantics.html # a 요소점) & # 39 의 속성 '대상' < sup>. [1] < /sup>.;; 가치를 찾고 있다. [2] ',' _blank < sup> /sup> <;).
<a href="www.example.com/example.html" target="_blank">link text</a>
이로 인해 새로운 창을 통해 볼 수 있다 - [ievgen& # 39 의 뛰어난 오토메이티드 아래] (/a/ javascript 의 javascript 솔루션이므로 15766254/1047823)
시간을 거슬러 올라간다. [1] 이 속성은 <, sub> 브라우저를 사용하고 있지 않은 것은 탭들 프레임셋을 state of the art 한편 기능을 이 속성에는 약간 변경일 (http://otl. [매든 문서는] (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a # 속성 대상) < /sub>;
< sub>. [2], 몇 가지 다른 값이 훨씬 더 이상 할 말이 없는 (프레임세트 염두에 두고 설계되어 있기 때문에) ',' '또는', 'like' _parent _self .< _top /sub>.
내가 아는 그 이전 Q 약어입니다 신앙이니라 와-u 여기서 얻을 수 있는 솔루션을 통해 검색을 통해 i got a nice 한 그러하매 jquery
jQuery('a[target^="_new"]').click(function() {
var width = window.innerWidth * 0.66 ;
// define the height in
var height = width * window.innerHeight / window.innerWidth ;
// Ratio the hight to the width as the user screen ratio
window.open(this.href , 'newwindow', 'width=' + width + ', height=' + height + ', top=' + ((window.innerHeight - height) / 2) + ', left=' + ((window.innerWidth - width) / 2));
});
이 모든 '< 타겟일 = " _new" > 열립니다 새 창에서;;;;'
첫째, I did 일부 변화가 거의 완벽하게 이어 이제는 새 창을 열고 원본 코드가 사용자가 화면 비율 (가로 desktops)
그러나 추천합니까 싶다 다음 코드를 사용할 수 있는 링크를 새 탭이 열려 있는 경우 모바일 in (덕분에 [즈보나 오토메이티드 다른 질문] (https://stackoverflow.com/a/8833025):
jQuery('a[target^="_new"]').click(function() {
return openWindow(this.href);
}
function openWindow(url) {
if (window.innerWidth <= 640) {
// if width is smaller then 640px, create a temporary a elm that will open the link in new tab
var a = document.createElement('a');
a.setAttribute("href", url);
a.setAttribute("target", "_blank");
var dispatch = document.createEvent("HTMLEvents");
dispatch.initEvent("click", true, true);
a.dispatchEvent(dispatch);
}
else {
var width = window.innerWidth * 0.66 ;
// define the height in
var height = width * window.innerHeight / window.innerWidth ;
// Ratio the hight to the width as the user screen ratio
window.open(url , 'newwindow', 'width=' + width + ', height=' + height + ', top=' + ((window.innerHeight - height) / 2) + ', left=' + ((window.innerWidth - width) / 2));
}
return false;
}
이 시도해 볼 수 있습니다 -
<a href="some.htm" target="_blank">Link Text</a>
또한 이 번호요 시도하시겠습니까 또한 -
<a href="some.htm" onclick="if(!event.ctrlKey&&!window.opera){alert('Hold the Ctrl Key');return false;}else{return true;}" target="_blank">Link Text</a>