TechMynd, Stuff That Works | Downloads, Tips & Tricks, Softwares, Programming, Resources


Javascript Tricks

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

Tags: , ,
Posted in: Fun, Java Script, Tips & Tricks
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Javascript Trick - Corrupt Any Webpage

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

Tags: ,
Posted in: Fun, Java Script
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Form Validation - Input Fields Text Changes at OnClick OnBlur OnFocus

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…

Tags: , ,
Posted in: Forms, HTML, Java Script
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Funny Computer Tricks

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 :)

Tags: , , , , ,
Posted in: Fun, Java Script, Tips & Tricks
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Onclick Change Link State to bold

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 ;)

Tags:
Posted in: Java Script
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Cross Browser Add to Favorites Script

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>

Tags:
Posted in: Java Script
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

    



  Subscribe Via RSS
  Subscribe Via Email


Add to Google Reader
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Add to My AOL
Add to Simpy
Add to Technorati Favorites!
Add to netvibes


Add to Technorati Favorites