Forums

This topic is locked

got to be simple, but can't figure out! Pls help!

Posted 17 Aug 2002 07:44:52
1
has voted
17 Aug 2002 07:44:52 crystal clear posted:
I have different topics on the same page. By the end of each topic, I have 'BACK TO TOP' text but don't know how to link that text so tht when the mouse goes over 'BACK TO TOP' it should go to the top of the page.

Thanks for any help.

Replies

Replied 17 Aug 2002 17:03:52
17 Aug 2002 17:03:52 Dave Thomas replied:
onMouseOver is a bad choice, you should leave it as a clickable url (normal folks who know nothing of rollovers will get immensely frustrated at jumping to the top of the page if they move their mouse in the wrong place.

simply add a link of "<b>#</b>" in the properties box

so you end up with <b>&lt;a href="#"&gt;Back to Top&lt;/a&gt;</b>

"No-one ever said this stuff was easy <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>"

Edited by - UltraDav on 17 Aug 2002 17:04:47
Replied 18 Aug 2002 08:43:09
18 Aug 2002 08:43:09 crystal clear replied:
Thanks for ur reply but I tried adding "#" in the properties box but it did'nt work. Also I tried "#logo", logo being my flash file used on the top left side of the page. It does'nt work either. Am I not getting it right!

Edited by - Keepcool on 18 Aug 2002 09:07:47
Replied 18 Aug 2002 19:15:30
18 Aug 2002 19:15:30 Dave Thomas replied:
the "#" symbol in the link box will add a default anchor to make it jump to to the top.

if you want it to jump to a specific place in the page then you must create an anchor yourself.

This script will give you a watrmark [TOP] link, that scrolls with the page. Insert it into the &lt; HEAD &gt; of the page

##### Start copying below this line #######
&lt;script&gt;
&lt;!--

// Change the text TOP to the text that you want to be displayed as the link on your page.
var displayed="&lt;nobr&gt;&lt;font size=2 face=Arial&gt;&lt;b&gt;[Top]&lt;/b&gt;&lt;/font&gt;&lt;/nobr&gt;"

// === DO NOT EDIT ANYTHING BELOW THIS LINE!!! === //

var logolink='javascript:window.scrollTo(0,0)'
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (ns4)
setTimeout("window.onresize=regenerate",400)
}

if (ie4||ns6)
document.write('&lt;span id="logo" style="position:absolute;top:-300;z-index:100"&gt;'+displayed+'&lt;/span&gt;')

function createtext(){ //function for NS4
staticimage=new Layer(5)
staticimage.left=-300
staticimage.document.write('&lt;a href="'+logolink+'"&gt;'+displayed+'&lt;/a&gt;')
staticimage.document.close()
staticimage.visibility="show"
regenerate2()
staticitns()
}

function staticit(){ //function for IE4/ NS6
var w2=ns6? pageXOffset+w : document.body.scrollLeft+w
var h2=ns6? pageYOffset+h : document.body.scrollTop+h
crosslogo.style.left=w2
crosslogo.style.top=h2
}

function staticit2(){ //function for NS4
staticimage.left=pageXOffset+window.innerWidth-staticimage.document.width-28
staticimage.top=pageYOffset+window.innerHeight-staticimage.document.height-10
}

function inserttext(){ //function for IE4/ NS6
if (ie4)
crosslogo=document.all.logo
else if (ns6)
crosslogo=document.getElementById("logo"
crosslogo.innerHTML='&lt;a href="'+logolink+'"&gt;'+displayed+'&lt;/a&gt;'
w=ns6? window.innerWidth-crosslogo.offsetWidth-20 : document.body.clientWidth-crosslogo.offsetWidth-10
h=ns6? window.innerHeight-crosslogo.offsetHeight-15 : document.body.clientHeight-crosslogo.offsetHeight-10
crosslogo.style.left=w
crosslogo.style.top=h
if (ie4)
window.onscroll=staticit
else if (ns6)
startstatic=setInterval("staticit()",100)
}

if (ie4||ns6){
window.onload=inserttext
window.onresize=new Function("window.location.reload()"
}
else if (ns4)
window.onload=createtext

function staticitns(){ //function for NS4
startstatic=setInterval("staticit2()",90)
}

//--&gt;
&lt;/script&gt;
########### Stop copying above this line ##########

Regards,
Dave
"No-one ever said this stuff was easy <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>"

Edited by - UltraDav on 18 Aug 2002 19:17:47
Replied 18 Aug 2002 19:54:37
18 Aug 2002 19:54:37 crystal clear replied:
Thks a lot, it works. Also "#" works. I had # in quotes so it did'nt work earlier.

*This stuff is NOT easy <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>*
Replied 18 Aug 2002 19:59:33
18 Aug 2002 19:59:33 Dave Thomas replied:
Theres a tutorial on using a Flash button to submit a form on UDNewbie found here.

www.udnewbie.com/AdvancedTutorials/flashsubmitbutton/

Regards,
Dave

"No-one ever said this stuff was easy <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>"
Replied 27 Aug 2002 21:34:05
27 Aug 2002 21:34:05 crystal clear replied:
Thks for all ur help <img src=../images/dwzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic