Kamrad.ru

Kamrad.ru (https://kamrad.ru/index.php)
- Веб-дизайн, вёрстка и веб-программирование (https://kamrad.ru/forumdisplay.php?forumid=87)
-- Таг URL (https://kamrad.ru/showthread.php?threadid=49915)



Neo 21-05-2003 00:49:

Таг URL

Вот есть у мя такой скрипт - вот его кусочек -

code:
<!--[if IE]>
<div id="ie5menu" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">
<div class="menuitems" url="start.html">На главную</div>
<div class="menuitems" url="http://kos.ru/forum/">На Форум</div>
<div class="menuitems" url="http://kos.ru/chat/">В чат</div>
<div class="menuitems" url="ustav.html">Прочитать устав</div>
<div class="menuitems" url="http://kos.ru/forum/">Заявка на вступление</div>
<div class="menuitems" url="util.html">Полезное</div>
<div class="menuitems" url="java sсript :popupPage()">Библиотека БК</div>
<div class="menuitems" url="games.html">Развлечения</div>
</div>
<![endif]-->
<sсript language="JavaScript1.2">


Как для тага URL прописать target="_blank" ??, или чем его заменить???



Anafay 21-05-2003 02:14:

BlackneoForever
Покажи, пожалуйста, код функции jumptoie5(). Скорее всего, это в ней.



Neo 21-05-2003 03:22:

code:

<sсript language="JavaScript1.2">
//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
var display_url=0


function showmenuie5(){
//Find out how close the mouse is to the corner of the window
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<ie5menu.offsetWidth)
//move the horizontal position of the menu to the left by it's width
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
ie5menu.style.left=document.body.scrollLeft+event.clientX

//same concept with the vertical position
if (bottomedge<ie5menu.offsetHeight)
ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight
else
ie5menu.style.top=document.body.scrollTop+event.clientY

ie5menu.style.visibility="visible"
return false
}

function hidemenuie5(){
ie5menu.style.visibility="hidden"
}

function highlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="highlight"
event.srcElement.style.color="white"
if (display_url==1)
window.status=event.srcElement.url
}
}

function lowlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor=""
event.srcElement.style.color="black"
window.status=''
}
}

function jumptoie5(){
if (event.srcElement.className=="menuitems")
window.location=event.srcElement.url
}
</sсript>
</head>

</head>
<body>
<!--[if IE]>
<div id="ie5menu" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">
<div class="menuitems" url="start.html">На главную</div>
<div class="menuitems" url="http://kos.ru/forum/">На Форум</div>
<div class="menuitems" url="http://kos.ru/chat/">В чат</div>
<div class="menuitems" url="ustav.html">Прочитать устав</div>
<div class="menuitems" url="http://kos.ru/forum/">Заявка на вступление</div>
<div class="menuitems" url="util.html">Полезное</div>
<div class="menuitems" url="java sсript :popupPage()">Библиотека БК</div>
<div class="menuitems" url="games.html">Развлечения</div>
</div>
<![endif]-->
<sсript language="JavaScript1.2">
document.oncontextmenu=showmenuie5
if (document.all&&window.print)
document.body.onclick=hidemenuie5
</sсript>




Токо мне ненадо для всех ссылок, а то токо для ссылки на форум и чат.....



Anafay 21-05-2003 05:07:

BlackneoForever
function jumptoie5(){
if (event.srcElement.className=="menuitems")
window.location=event.srcElement.url
}

Вот здесь. Сделать вызов window.open() вместо работы с location текущего окна.

Либо убрать дурацкий onClick и сделать нормальный <A href="" target="">...



Alex Spade 22-05-2003 11:15:

Делать ссылки через JS без особой необходимости - это
1) Некоторые любят отключать JS
2) Не все поисковые роботы понимают JS-ссылки, а остальные не понимают всё разнообразие JS-ссылок в связи с их большим разнообразием и нестандартностью.
3) Большинство офф-лайн браузеров не понимают JS-ссылки вообще. Исключение Web-Zip, да и тот не все понимает.


Текущее время: 04:48

Powered by: vBulletin Version 2.0.1
Copyright © Jelsoft Enterprises Limited 2000, 2001.
Любое использование материалов сайта
возможно только с разрешения его администрации.