M
M
Mikhail Mirgorodsky2020-04-20 09:25:02
HTML
Mikhail Mirgorodsky, 2020-04-20 09:25:02

How to open a tab in a new window?

Hello,
I have a code:

<div class="container">
<div class="row">
<div class="uk-panel col-xl-2 col-lg-4 col-md-4 col-6" onclick="location.href='/okna';">
<div class="uk-panel-teaser">
<figure class="uk-overlay uk-overlay-hover "><img alt="ОКНА" src="media/widgetkit/icon_okna-349f469ed987244dda27ec14f10fb941.png" width="100" height="100" /> <img class=" uk-overlay-panel uk-overlay-image" alt="ОКНА" src="media/widgetkit/cvet_okna-6e04448160c2590d7feb8f57b0bc782e.png" width="100" height="100" />
<div class="uk-overlay-panel uk-overlay-background uk-overlay-fade"> </div>
</figure>
</div>
<div class="uk-panel-title uk-margin-bottom-remove">ОКНА</div>
</div>
<div class="uk-panel col-xl-2 col-lg-4 col-md-4 col-6" onclick="location.href='/dveri';">
<div class="uk-panel-teaser">
<figure class="uk-overlay uk-overlay-hover "><img alt="ДВЕРИ" src="media/widgetkit/icon_dveri-ff15563210dba781d6b8d5e284858229.png" width="100" height="100" /> <img class=" uk-overlay-panel uk-overlay-image" alt="ДВЕРИ" src="media/widgetkit/cvet_dver-de947d606fdf587635668dfd7d31ec5c.png" width="100" height="100" />
<div class="uk-overlay-panel uk-overlay-background uk-overlay-fade"> </div>
</figure>
</div>
<div class="uk-panel-title uk-margin-bottom-remove">ДВЕРИ</div>
</div>
<div class="uk-panel col-xl-2 col-lg-4 col-md-4 col-6" onclick="location.href='/vhodnye-gruppy';">
<div class="uk-panel-teaser">
<figure class="uk-overlay uk-overlay-hover "><img alt="ВХОДНЫЕ ГРУППЫ" src="media/widgetkit/icon_vhodnie_gruppi-4bfce28bc79d18f84132e1f17dc71acd.png" width="100" height="100" /> <img class=" uk-overlay-panel uk-overlay-image" alt="ВХОДНЫЕ ГРУППЫ" src="media/widgetkit/cvet_vhodnye_gruppy-2286623c97a38a0d2f2d811ab074d7ea.png" width="100" height="100" />
<div class="uk-overlay-panel uk-overlay-background uk-overlay-fade"> </div>
</figure>
</div>
<div class="uk-panel-title uk-margin-bottom-remove">ВХОДНЫЕ ГРУППЫ</div>
</div>
<div class="uk-panel col-xl-2 col-lg-4 col-md-4 col-6" onclick="location.href='/peregorodki';">
<div class="uk-panel-teaser">
<figure class="uk-overlay uk-overlay-hover "><img alt="ПЕРЕГОРОДКИ" src="media/widgetkit/icon_peregorodki-1d051ea418cad5a438b0e63699dc3416.png" width="100" height="100" /> <img class=" uk-overlay-panel uk-overlay-image" alt="ПЕРЕГОРОДКИ" src="media/widgetkit/cvet_ofisnaya_peregorodka-89063888696319346175cbbc00cf0708.png" width="100" height="100" />
<div class="uk-overlay-panel uk-overlay-background uk-overlay-fade"> </div>
</figure>
</div>
<div class="uk-panel-title uk-margin-bottom-remove">ПЕРЕГОРОДКИ</div>
</div>
<div class="uk-panel col-xl-2 col-lg-4 col-md-4 col-6" onclick="location.href='/osteklenie';">
<div class="uk-panel-teaser">
<figure class="uk-overlay uk-overlay-hover "><img alt="Остекление" src="media/widgetkit/icon_osteklenie-1dab42910f5e061d841ac64738d317b2.png" width="100" height="100" /> <img class=" uk-overlay-panel uk-overlay-image" alt="Остекление" src="media/widgetkit/cvet_osteklenie-7c0f470653d3d3344ffc448e2823ffd3.png" width="100" height="100" />
<div class="uk-overlay-panel uk-overlay-background uk-overlay-fade"> </div>
</figure>
</div>
<div class="uk-panel-title uk-margin-bottom-remove">ОСТЕКЛЕНИЕ</div>
</div>
<div class="uk-panel col-xl-2 col-lg-4 col-md-4 col-6" onclick="location.href='/svetoprozrachnye-konstrukcii';">
<div class="uk-panel-teaser">
<figure class="uk-overlay uk-overlay-hover "><img alt="ИНОЕ" src="media/widgetkit/icon_inoe-bb1e5eb5a32ec05abd1b8b084650a995.png" width="100" height="100" /> <img class=" uk-overlay-panel uk-overlay-image" alt="ИНОЕ" src="media/widgetkit/cvet_inoe-0d020c32b573e6bd2d4dbad14cd04fd4.png" width="100" height="100" />
<div class="uk-overlay-panel uk-overlay-background uk-overlay-fade"> </div>
</figure>
</div>
<div class="uk-panel-title uk-margin-bottom-remove">ИНОЕ</div>
</div>
</div>
</div>

It does not open in a new tab when you click on the middle button, there is also no item to open in a new tab if you right-click the menu.
How to fix please tell me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pashenka, 2020-04-20
@PiZZaDoXa

Learn HTML. The target attribute , which is responsible for opening the link in a new window, belongs to the a tag .

V
Vladislav, 2020-04-20
@cr1gger

You have a location hanging on the onclick event.
Change to Location changes the url of the current tab. a window.open opens a new tab with the specified url Tagged with a: target="_blank" - Indicates that the link will open in a new window
window.open('http://example.com');
<a href="#" target="_blank">Открой меня</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question