Dancing Pics Javascript Trick
Download rar file and extract contents. Open file copy script, select any ie browser window with any website opened with images, past code in ie browser address bar and hit enter. See what happens.
dancing-pics.rar
Funny Javascript Code
Download rar file and extract contents. Open file copy script, past it in ie browser address bar and hit enter. See what happens. You can customize code within.
funny-js-trick.rar
Share This
Download the rar file, extract its content. Open file and copy its contents and past in any already opened window’s address bar containing URL or any web page address bar. You will see the contents of webpage will shift and rearrange position.
js-trick.rar
Share This
We will be needing a js file and a page containing form input field to do this task.
What we are planning is, The input field contains default value. Onclick default value disappears and allows the user to insert text.
If the user types anything it remains there but if he does not write anything and clicks at next input field than the default value reappears in previous field.
JS file Code:
function remName(a, b){
if(a.value==b){
a.value='';
}else if(a.value==''){
a.value=b;
}else{
a.value=a.value;
}
}
function chkName(a, b){
if(a.value==''){
a.value=b;
}else{
a.value=a.value;
}
}
Two functions are controlling the event as above.
Call the js file in the page and define input fields and put some code like this.
Input Fields:
<input name="txtName" type="text" id="txtName" onfocus="remName(this, 'Name');" onblur="chkName(this, 'Name');" value="Name">
<input name="txtEmail" type="text" id="txtEmail" value="Email" onfocus="remName(this, 'Email');" onblur="chkName(this, 'Email');">
and so on…
Share This
Copy and paste in this javascript code in address bar of your browser.
javascript:function Shw(n) {if (self.moveBy) {for (i = 35; i > 0; i–) {for (j = n; j > 0; j–) {self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0); } } }} Shw(6)
Bold i- and j- are i- - and j- - (no space)
Modify these before pressing enter.
Watch your window’s “shaking it”. You can change the value of i if you wish :)
Share This
If you need to change the state of link onclick event t blod in navigation then we will use following code.
<html>
<head>
<title>Change Links State On Click</title>
<style type=”text/css”>
.activate { font-weight: bold; }
</style>
</head>
<body>
<a href=”#” id=”link1″ onclick=”changeActiveStates(this)”>Link A</a>
<a href=”#” id=”link2″ onclick=”changeActiveStates(this)”>Link B</a>
<a href=”#” id=”link3″ onclick=”changeActiveStates(this)”>Link C</a>
<script type=”text/javascript”>
function byId(id) {
return document.getElementById ? document.getElementById(id) : document.all[id];
}
var prevLink = “”;
function changeActiveStates(ele) {
if (prevLink) byId(prevLink).className = “”;
ele.className = ‘activate’;
prevLink = ele.id;
}
</script>
</body>
</html>
This will cause the link to appear bold when clicked and when you click another link then previous clicked link will be normal and active link will be bold.
Simple ;)
Share This
Head Section
<script type=”text/javascript”>
function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, “”)
}
</script>
Body Section
<a href=”javascript:bookmarksite(’my blog’, ‘http://www.javedkhalil.wordpress.com’)”>Bookmark this!</a>
Share This