Layer As Static: Marquee Using An External File For Text
Layer As Static: Marquee Using An External File For Text
.static {
position: fixed;
left: 5px;
top: 5px;
}
for example.
For IE, you're going to need to use a setInterval() and some Javascript - I've recently
experiemented with the expression() property, but the recalculation engine does not seem to
appreciate document.body.scrollLeft and document.body.scrollTop...
function initialize(){
if (document.all){
combowidth=staticcombo.offsetWidth
comboheight=staticcombo.offsetHeight
setInterval("staticit_ie()",50)
staticcombo.style.visibility="visible"
}
else if (document.layers){
combowidth=document.staticcombo.document.width
comboheight=document.staticcombo.document.height
setInterval("staticit_ns()",50)
document.staticcombo.visibility="show"
}
}
function staticit_ie(){
staticcombo.style.pixelLeft=document.body.scrollLeft+document.body.clientWidth-combowidth-30
staticcombo.style.pixelTop=document.body.scrollTop+document.body.clientHeight-comboheight
}
function staticit_ns(){
document.staticcombo.left=pageXOffset+window.innerWidth-combowidth-30
document.staticcombo.top=pageYOffset+window.innerHeight-comboheight
}
window.onload=initialize
</script>
<script language="JavaScript1.2">
/*
External Data Source Marquee Script (Updated 99/11/02)-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of Use, visit dynamicdrive.com
*/
function downloaddata(){
marqueedata.startDownload(externalmarquee.src,displaydata)
}
function displaydata(data){
externalmarquee.innerHTML=data
}
if (document.all)
window.onload=downloaddata
</script>
<![endif]-->
<form> tag contains <input type= radio> in a loop (ie) if a page contain many questions with radio
buttons as options, and if any question left unchecked it should alert me a dialog box saying not
clicked. If there is only one question in a page by wrinting a javascript code, it can be checked.
:rolleyes:
What javascript code should be implemented as soon as the submit button of the page is clicked,
checking all the radio buttons be clicked and if one radio button is unchecked pop a dialog box.
I am sure there are lots of ways to accomplish this but something along these lines ought to do it:
<script type="text/javascript">
<!--//
function radioCheck(){
var temp=bad="", ok=0;
for(var i=0; i<document.f.elements.length; i++){
if(document.f.elements[i].type=="radio"){
if(temp!=document.f.elements[i].name || i==document.f.elements.length-2){
if(ok==0 && temp!="") bad +=" "+temp+"\n";
temp=document.f.elements[i].name;
ok=0;
}
ok+=document.f.elements[i].checked;
}
}
if (bad!=""){
alert("Be sure to choose one of the following:\n\n"+bad);
return false;
}
else{
return true;
}
}
//-->
</script>
<script language="JavaScript1.2">
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
<script language=JavaScript>
<!--
//Disable right click script
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
<html>
<head>
<title>Testing</title>
<style>
@media print { body {visibility: hidden;}}
</style>
<script>
</script>
</head>
<body>
<h1>Test Page</h1>
<form>
</form>
<script>
</script>
</body>
</html>
Try printing that page :D . If you've got enough things on your page that should prevent printing
then that fact alone should give you a lot of ammunition to come back on someone who carries up
a copy of the page regardless of whether they managed to alter any of the content or not.