setTimeout( function(){ getElementById('msg').style.display = 'none'; }, 3000);ukrycie, elementu "msg" po 3 sekundach (setTimeout ->; 3000)
setTimeout( function(){ getElementById('msg').style.display = 'none'; }, 3000);ukrycie, elementu "msg" po 3 sekundach (setTimeout ->; 3000)
var cont = document.getElementById('content').getElementsByTagName('div');
for(i=0;i<cont.length;i++)
if (cont[i].className.match(/^belka/))
cont[i].style.display = 'none';Przyklad ukrycia elementów, wykorzystanie match:
<div id="content">
<div class="belka">odnajdywanie klasa belki</div>
<div class="belka">odnajdywanie klasa belki</div>
</div> function red_alert() {
var red = 'alert';
var blad = '';
blad += test_red(table);
blad += test_alert();
if(blad!='') {
blad = "Red Alert: Proszę wypełnić prawidlowo kod:" + blad;
alert(blad);
return false;
}
updateData(table);
}Definicja funkcji sprawdzenia kodu red alert.
Standardowe nazwy kursorów myszki:
auto
crosshair
default
help
move
pointer
text
waiti mniej standardowe
hand
progress
not-allowed
no-drop
vertical-text
all-scroll <html>
<head>
<script type="text/javascript">
var IE = document.all ? true : false;
if (!IE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = myMouseXY;
var pX = 0;
var pY = 0;
function myMouseXY(e) {
if (IE) {
pX = event.clientX + document.body.scrollLeft;
pY = event.clientY + document.body.scrollTop;
} else {
pX = e.pageX;
pY = e.pageY;
}
if (pX < 0) pX = 0;
if (pY < 0) pY = 0;
document.getElementById("ws").value = pX + ',' + pY;
document.getElementById("dymek").style.left = pX;
document.getElementById("dymek").style.top = pY;
return true;
}
</script>
</head>
<body>
<div id="dymek" style="position: absolute;">
<input type="text" id="ws">
</div>
</body>
</html>