PDA

View Full Version : javascript, goto top of the page,


FrozenCreations
08-26-2005, 12:16 PM
hello, id like a js code to make a "to the top" bar on the right side of the screen.
somehting like on http://groups.google.ca/group/alt.pcnews/browse_thread/thread/1237f79f84cad412/2c0b935057feb408?lnk=st&q=vbulletin&rnum=1&hl=en#2c0b935057feb408

_Corvin_
08-26-2005, 01:50 PM
Look into the source code of this site and you know how to do. ;)

FrozenCreations
08-26-2005, 03:13 PM
i already tryed ;)

i need the code code ;) you try it

Adrian Schneider
08-26-2005, 03:26 PM
the two Java Scripts:
function getObjects() {
d = document.getElementById( 'topicfloat' );
t = document.getElementById( 'ln' ).offsetTop + 20;
}
var tot_img = null;
function log_tot() {
try {
if (window.tot_img)
return;
window.tot_img = new Image(1,1);
window.tot_img.src = "http://groups.google.com/groups?lnk=tot&n=" + Math.floor(Math.random() * 1000);
} catch(e) {
// Ignore
}
}
...
<div style="position: absolute; top:0; right:0; z-index:3; display:none; float:right;border-bottom:1px solid #ffcc33;border-left:1px solid #ffcc33; background:#fff4c2; padding:3px;cursor:pointer;" id="topicfloat" onclick="window.scrollTo(0,0);log_tot();"><strong>&nbsp;Topic:&nbsp;Does vBulletin v3.0.0 support foreign languages?</strong> - <a href="javascript:;" style="color:#0000cc">go to top</a></div>

FrozenCreations
08-26-2005, 03:31 PM
whoot..... where do i put that? (so tis on every page) the header?


and can you amke that work 4 my forum? (www.frozencreations.net) i see you just copyed the source...? lol... u must have done it different /;

Adrian Schneider
08-26-2005, 03:33 PM
Wrap the JS in
<script language="JavaScript" type="text/JavaScript">
<!--
...
//-->
</script>
I don't beleive the rest matters, because it has absolute positioning.

FrozenCreations
08-26-2005, 03:51 PM
no, it dosent, and it still has googles info in it /; could u try? and config it 2 go with vb?