diff options
| author | timb <timb@mb.home> | 2010-02-06 18:24:21 -0800 |
|---|---|---|
| committer | timb <timb@mb.home> | 2010-02-06 18:24:21 -0800 |
| commit | 1497e77bacf5966ea3852c3ebc87c6d220521228 (patch) | |
| tree | f2ab0f494c418177fdb36f120d6013e707ed91d8 | |
| parent | 0c6d2615d63f0ff7f7d213a6d8fb8b21ef6b7f35 (diff) | |
fix hand
| -rwxr-xr-x | static/index.html | 21 | ||||
| -rwxr-xr-x | static/js/home.js | 48 | ||||
| -rwxr-xr-x | static/pichat.css | 6 | ||||
| -rwxr-xr-x | template/chat.st | 2 | ||||
| -rwxr-xr-x | template/footer.st | 2 | ||||
| -rw-r--r-- | template/preload.st | 3 |
6 files changed, 55 insertions, 27 deletions
diff --git a/static/index.html b/static/index.html index e761927..c492031 100755 --- a/static/index.html +++ b/static/index.html @@ -1,3 +1,5 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" +"http://www.w3.org/TR/html4/strict.dtd"> <html><head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" src="/static/js/sha1.js"></script> @@ -34,12 +36,18 @@ function MM_swapImage() { //v3.0 <style type="text/css"> + body { background:#EEF2FF url(/static/fade-blue.png) top center repeat-x; background-repeat:repeat-x; background-position:top; margin:5%; } +#preload { + position: absolute; + left: 0px; + top: 0px; +} #main { width:460px; margin: 100px auto 0 auto; @@ -128,20 +136,20 @@ line-height:-1; #signin-submit { display: block; width:300px; - height:37px; + height:33px; font-size:20px; background-image:url(/static/btngrad1.png); font-weight:bold; word-spacing:7; - padding-top:6px; + /*padding-top:6px;*/ text-align:center; z-index:100; - font-size:18px; + font-size:16px; color:#fff; text-shadow:1px 1px 3px #000; border-radius: 5px; -webkit-border-radius: 5px; - -moz-border-radius: 5px; + -moz-border-radius: 5px;*/ border:solid 1px #eee; } @@ -151,6 +159,7 @@ line-height:-1; <div id="main" align="center"> + <img src="/static/flyhorse.gif" id="horse" /> <img src="/static/guaranteed_customer_satisfaction.gif" id="customer" /> @@ -180,5 +189,9 @@ line-height:-1; <img src="/static/valid_html.gif"> </div> +<div id="preload"> + <img src="/static/img/cursors/osx.hand.gif" class="no-cursor invisible" id="cursor-big" /> +</div> + </body> </html> diff --git a/static/js/home.js b/static/js/home.js index af4ee4b..58fc384 100755 --- a/static/js/home.js +++ b/static/js/home.js @@ -53,8 +53,7 @@ function initLoginForm() { $(pass).keypress(ifEnter(login)); $(submit).click(login); - //disable this until i can figure out the bug on the front page... - //initBigHand(submit) + initBigHand(submit) } function initExpandableLoginForm() { @@ -81,10 +80,12 @@ function initExpandableLoginForm() { } function initBigHand(id){ - var cursor = "#cursor-big" + var cursorId = "#cursor-big" + var cursor = $(cursorId)[0] - if (!$(cursor).length) // add cursor image to page if it doesn't exist already... - $('<img src="/static/img/cursors/osx.hand.gif" class="invisible no-cursor" id="cursor-big">').appendTo('body') + // jquery's reported element sizes are not exactly the same as the browser's 'mouseover' target sizes + // so we'll allow a few pixels extra + var fudgeFactor = 2 $(id).addClass("no-cursor") @@ -98,6 +99,7 @@ function initBigHand(id){ // find image co-ords // bind a global mousemove func // bind cursor click event + // unbind mouseover // mousemove func: // move image to mouse co-ords // if mouse co-ords are outside the image co-ords: @@ -106,17 +108,17 @@ function initBigHand(id){ // unbind cursor click event var mousemove = function(e){ - $(cursor).css({ - "top": e.pageY + "px", - "left": e.pageX - 32 + "px" // 32: (4 pixels * 8 pixels per big pixel) to line up pointy finger with cursor - }) - $(id).unbind('mouseover', imageMouseOver) - if (e.pageY < initBigHand.coords.top || - e.pageY > initBigHand.coords.bottom || - e.pageX < initBigHand.coords.left || - e.pageX > initBigHand.coords.right) { - $(cursor).addClass('invisible') - $(cursor).unbind('click', cursorClick) + var y = e.pageY, x = e.pageX, coords = initBigHand.coords + + cursor.style.top = y + "px" + cursor.style.left = x - 32 + "px" // 32: (4 pixels * 8 pixels per big pixel) to line up pointy finger with cursor + if (y < coords.top || + y > coords.bottom || + x < coords.left || + x > coords.right) { + $(cursorId).addClass('invisible') + $(cursorId).css({"top": 0, "left": 0 }) + $(cursorId).unbind('click', cursorClick) $('body').unbind('mousemove', mousemove) $(id).mouseover(imageMouseOver) } @@ -125,15 +127,17 @@ function initBigHand(id){ var cursorClick = function(){ $(id).click() } var imageMouseOver = function(){ + //console.log("moused over...") initBigHand.coords = { - "left": $(id).offset().left, - "top": $(id).offset().top, - "right": $(id).offset().left + $(id).width(), - "bottom": $(id).offset().top + $(id).height() + "left": $(id).offset().left - fudgeFactor, + "top": $(id).offset().top - fudgeFactor, + "right": $(id).offset().left + $(id).width() + fudgeFactor, + "bottom": $(id).offset().top + $(id).height() + fudgeFactor } $('body').mousemove(mousemove) - $(cursor).click(cursorClick) - $(cursor).removeClass('invisible') + $(cursorId).click(cursorClick) + $(cursorId).removeClass('invisible') + $(id).unbind('mouseover', imageMouseOver) } $(id).mouseover(imageMouseOver) diff --git a/static/pichat.css b/static/pichat.css index 3886f95..2ffcd59 100755 --- a/static/pichat.css +++ b/static/pichat.css @@ -316,4 +316,10 @@ left:0; bottom } +#preload { + position: absolute; + left: 0px; + top: 0px; +} + .invisible { display: none !important; }
\ No newline at end of file diff --git a/template/chat.st b/template/chat.st index 223b8ab..522a2ac 100755 --- a/template/chat.st +++ b/template/chat.st @@ -81,6 +81,6 @@ $footer()$ <p> </div> + $preload()$ </body> - </html> diff --git a/template/footer.st b/template/footer.st index 86c983e..ae1df96 100755 --- a/template/footer.st +++ b/template/footer.st @@ -13,3 +13,5 @@ try { var pageTracker = _gat._getTracker("UA-12364576-1"); pageTracker._trackPageview(); } catch(err) {}</script> + + diff --git a/template/preload.st b/template/preload.st new file mode 100644 index 0000000..ca8dbaa --- /dev/null +++ b/template/preload.st @@ -0,0 +1,3 @@ +<div id="preload"> + <img src="/static/img/cursors/osx.hand.gif" class="no-cursor invisible" id="cursor-big" /> +</div>
\ No newline at end of file |
