Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[javascript] Logo Branding
#1
Credits and Source: http://jsmadeeasy.com/

Name: Logo Branding
Description: Have you seen the floating logo on Geocities sites? How would you like to have your own logo floating in the corner of your site? This script does just that!
Snippet:

Insert into <HEAD>
Code:
<SCRIPT LANGUAGE="JavaScript">
function setVariables() {
imgwidth=235;
imgheight=19;
if (navigator.appName == "Netscape") {
horz=".left";
vert=".top";
docStyle="document.";
styleDoc="";
innerW="window.innerWidth";
innerH="window.innerHeight";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}
else {
horz=".pixelLeft";
vert=".pixelTop";
docStyle="";
styleDoc=".style";
innerW="document.body.clientWidth";
innerH="document.body.clientHeight";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
   }
}
function checkLocation() {
objectXY="branding";
var availableX=eval(innerW);
var availableY=eval(innerH);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
x=availableX-(imgwidth+30)+currentX;
y=availableY-(imgheight+20)+currentY;
evalMove();
setTimeout("checkLocation()",10);
}
function evalMove() {
eval(docStyle + objectXY + styleDoc + horz + "=" + x);
eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}
</script>

Insert into <BODY>
Code:
<!-- STEP TWO: Add this onLoad event handler to the BODY tag    -->

<BODY onload="setVariables(); checkLocation();">

<div id="branding" style="position:absolute; visibility:show; left:235px; top:-50px; z-index:2">
<table width=10 bgcolor=#ffffff><td>
<a href="http://javascript.internet.com" onmouseover="window.status='The JavaScript Source';return true" onmouseout="window.status='';return true"><center><img src="http://javascript.internet.com/img/branding/branding.gif" width="235" height="19" border="0"></center></a></font></td>
</table>
</div>

Thankyou for reading. Be happy always Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Free Worker HTML, CSS, Javascript ImFocuzz 2 1,099 04-05-2014, 10:01 PM
Last Post: VHPanda
  [MyBBError Message] PLEASE HELP ME!! Enable Javascript Registration Error iRun 4 1,637 01-26-2012, 03:13 PM
Last Post: iRun
  Close Tab With Javascript. Qua 3 1,226 07-02-2011, 07:25 AM
Last Post: djakariuz
  Keyboard shortcuts with JavaScript faviouz 12 2,618 05-07-2011, 01:21 AM
Last Post: Danny
  Javascript Help. Form Submission. JohnRonder 0 786 02-01-2011, 11:12 AM
Last Post: JohnRonder

Forum Jump:


Users browsing this thread: 1 Guest(s)