Posted in Uncategorized

JS Post 8 – Some plugins I am planing to exploit Ψ(☆w☆)Ψ

As is my nature, I always tend to pick out random libraries and test it out for almost all the languages I happen to stumble upon. And JS is not an exception!!!

A plug-in is a piece of code written in a standard JavaScript file. These files provide useful jQuery methods which can be used along with jQuery library methods.

I found a few things… actually loads cause there just some amazing JS developers out there!!!
So without further ado, and not in any particular order…

And since the list was getting a bit too long I’ll just add 2 links that kinda sums up everything that I want to convey for today.

And I don’t know about you but I really like how the eyes turned out!!!

(≚ᄌ≚)ƶƵ

// <![CDATA[ var width=50; // width of the eyes in pixels var colour="#90f"; // colour of the eye – bluey green in this case var iris="#000"; // colour of the iris (normally black); var swide=800; var shigh=600; var sleft=sdown=0; var glasses, lefteye, righteye; function addLoadEvent(funky) { var oldonload=window.onload; if (typeof(oldonload)!='function') window.onload=funky; else window.onload=function() { if (oldonload) oldonload(); funky(); } } addLoadEvent(draw_eyes); function draw_eyes() { var i, j, l, m; glasses=document.createElement("div"); i=glasses.style; i.position="fixed"; i.top="50%"; i.left="50%"; i.width="1px"; i.height="1px"; i.overflow="visible"; i.zIndex="100"; document.body.appendChild(glasses); lefteye=document.createElement("div"); righteye=document.createElement("div"); i=lefteye.style; j=righteye.style; i.position=j.position="absolute"; i.width=j.width="1px"; i.height=j.height="1px"; i.overflow=j.overflow="visible"; i.zIndex=j.zIndex="101"; glasses.appendChild(lefteye); glasses.appendChild(righteye); for (m=-1.1; m<2; m+=2.2) for (i=-width; i<width; i++) { l=Math.pow(width*width-i*i, 0.5); j=line(m*width-l, i, 2*l, colour, 0.5); glasses.appendChild(j); } for (i=-width/2; i<width/2; i++) { l=Math.pow(width*width/4-i*i, 0.5); j=line(-1.1*width-l, i, 2*l, iris, 0.8); lefteye.appendChild(j); } for (i=-width/2; iwidth/2.5) { xdiff=xdiff*width/distn/2.5; ydiff=ydiff*width/distn/2.5; } lefteye.style.top=ydiff+”px”; lefteye.style.left=xdiff+”px”; xdiff=x-(1.1*width)-(swide*0.5); ydiff=y-shigh/2; distn=Math.pow(xdiff*xdiff+ydiff*ydiff,0.5); if (distn>width/2.5) { xdiff=xdiff*width/distn/2.5; ydiff=ydiff*width/distn/2.5; } righteye.style.top=ydiff+”px”; righteye.style.left=xdiff+”px”; } document.onscroll=set_scroll; function set_scroll() { if (typeof(self.pageYOffset)==”number”) { sdown=self.pageYOffset; sleft=self.pageXOffset; } else if (document.body.scrollTop || document.body.scrollLeft) { sdown=document.body.scrollTop; sleft=document.body.scrollLeft; } else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) { sleft=document.documentElement.scrollLeft; sdown=document.documentElement.scrollTop; } else { sdown=0; sleft=0; } } window.onresize=set_width; function set_width() { var sw_min=999999; var sh_min=999999; if (document.documentElement && document.documentElement.clientWidth) { if (document.documentElement.clientWidth>0) sw_min=document.documentElement.clientWidth; if (document.documentElement.clientHeight>0) sh_min=document.documentElement.clientHeight; } if (typeof(self.innerWidth)!=”undefined” && self.innerWidth) { if (self.innerWidth>0 && self.innerWidth0 && self.innerHeight0 && document.body.clientWidth0 && document.body.clientHeight

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s