Jump to content
php.lv forumi

HELP - steidzami, PLS


Recommended Posts

Steidzoties rakstiiju lapu, izmantojot Javascript, visu laiku paarbaudiiju ar Firefox browseri, tagad izmeegjinaaju IE - deelj javascripta nekas nestraadaa...kas pie vainas - a javascript ta taads:

<script language="JavaScript" type="text/JavaScript">

<!--

window.onload = function () {

var x = document.getElementsByTagName('div');

for (var i=0;i<x.length;i++)

{

if (x.className == 'label')

x.onclick = clickNav;

}

closeNav();

if (top.setNav)

setNav(top.setNav,'currentPage');

}

 

function closeNav()

{

var x = document.getElementsByTagName('div');

for (var i=0;i<x.length;i++)

{

if (x.className == 'content')

x.style.display = 'none';

}

}

 

function clickNav(e)

{

if (!e) var e = window.event;

if (e.target) var tg = e.target;

else if (e.srcElement) var tg = e.srcElement;

while (tg.nodeName != 'DIV') // Safari GRRRRRRRRRR

tg = tg.parentNode;

var nextSib = tg.nextSibling;

while (nextSib.nodeType != 1)

nextSib = nextSib.nextSibling;

var nextSibStatus = (nextSib.style.display == 'none') ? 'block' : 'none';

nextSib.style.display = nextSibStatus;

}

 

function setNav(page,newID)

{

var test = page.indexOf('#')+1;

if (test)

page = page.substring(0,test-1);

var x = document.getElementsByTagName('a');

var i;

for (i=0;i<x.length;i++)

{

if (x.href == page)

{

x.id = newID;

break;

}

}

if (i < x.length && newID == 'currentPage')

{

var parDiv = x;

while (parDiv.parentNode.tagName == 'DIV')

{

parDiv = parDiv.parentNode;

parDiv.style.display = 'block';

}

}

}

</script>

 

Lūdzu lieto paste.php.lv vai

 bbtagus!! (bubu)[/color]
Link to comment
Share on other sites

×
×
  • Create New...