Posted by: Anil Kumar Panigrahi in: ● August 17, 2009
Hi friends,
if the one site most of functionality in javascript, if the browser is disable the javascript, then total site will not working, to detect the that the javascript is disable or not, to that following code will work:
<noscript>
Javascript is disable, please enable to access the site.
</noscript>
Posted by: Anil Kumar Panigrahi in: ● August 4, 2009
The following code will generate the simple tooltip using Javascript and css.
The Javascript code :
<script language=”javascript” type=”text/javascript”>
/* This tooltip library was created by Anil Kumar */
function showtip(e,message)
{var x=0;
var y=0;
var m;
var h;
if(!e)
var e=window.event;
if(e.pageX||e.pageY) { x=e.pageX; y=e.pageY; }
else if(e.clientX||e.clientY)
{ x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}
m=document.getElementById(‘mktipmsg’);
if((y>10)&&(y<450))
{ m.style.top=y-4+”px”; }
else{ m.style.top=y+4+”px”; }
var messageHeigth=(message.length/20)*10+25;
if((e.clientY+messageHeigth)>510)
{ m.style.top=y-messageHeigth+”px”; }
if(x<850) { m.style.left=x+20+”px”; }
else{ m.style.left=x-170+”px”; }
m.innerHTML=message;m.style.display=”block”;m.style.zIndex=203;
}
function hidetip(){
var m;
m=document.getElementById(‘mktipmsg’);m.style.display=”none”;
}
</script>
The CSS Code:
<style type=”text/css”>
#mktipmsg [...]
Posted by: Anil Kumar Panigrahi in: ● April 29, 2009
Hi friends,
After working hard to complete your design and images ,some persons just save that images and web pages.
This is one idea to disable the right click on webpage.
just put a small javascript code at the place between the head section.
*************************
<SCRIPT LANGUAGE=”JavaScript”>
<!– Disable
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function (“return false”)
document.oncontextmenu=new Function (“return false”)
//if NS6
if [...]
Posted by: Anil Kumar Panigrahi in: ● April 27, 2009
Hi frineds ,
This is a simple script but we are using sometimes.
In the header section of the page:
**********************************
<!– Start the Script –>
<script language=javascript>
//Edit the counter/limiter value as your wish
var count = “125″; //Example: var count = “143″;
function limiter(){
var tex = document.myform.comment.value;
var len = tex.length;
if(len > count){
tex = tex.substring(0,count);
document.myform.comment.value =tex;
return false;
}
document.myform.limit.value = count-len;
}
</script>
<!– end of Script [...]
Comments