PDA

View Full Version : "Jump to Top" script problem



PaulRPearson
05-21-2008, 01:54 AM
1) CODE TITLE: Jump to Top Link script

2) AUTHOR NAME/NOTES: Dynamic Drive

3) DESCRIPTION: Blue "Back to Top" floats in bottom R of page

4) URL TO CODE: http://www.dynamicdrive.com/dynamicindex5/jumptop.htm

Hi, I have posted the code to the page and up to the site. The "BACK TO TOP", when clicked, gives a page with the text "The system cannot find the file specified." on the url http://gyebags.com/javascript:window.scrollTo(0,0)

Relevant pages:
http://gyebags.com/bags.html
and
http://gyebags.com/js/jumptop.js

I have corrected the code on the page to direct to /js/jumptop.js

Thank you for any help.

Paul
:confused:

ddadmin
05-21-2008, 06:42 AM
There are a couple of errors on your page. Firstly, the code in red below:


<script type="text/javascript">
<!--
<script type="text/javascript" src="jquery-1.2.2.pack.js">
<script type="text/javascript" src="ddaccordion.js">

They should not be inside the outermost script tag. Modify the above to:


<script type="text/javascript" src="jquery-1.2.2.pack.js"></script>
<script type="text/javascript" src="ddaccordion.js"></script>
<script type="text/javascript">
<!--

Secondly, inside jumpto.js, you need to modify the line below:


crosslogo.innerHTML='<a href="../'+logolink+'">'+displayed+'</a>'

to:


crosslogo.innerHTML='<a href="'+logolink+'">'+displayed+'</a>'

cyberx
08-14-2008, 07:31 AM
Hi all!

I use Jump to top Link script, it works fine but i want to modify the code for an image. I want to use an image instead of using a text to show the top link. I tried several times but it did not work.
how can i change the text with an image? Any idea?

The text code is like this.

var displayed="<nobr><b>[Top]</b></nobr>"

I attached the image.

ddadmin
08-15-2008, 05:45 AM
cyberx, in the future, please start your own thread when asking a question. To your question, simply replace the text with an image tag:


var displayed="<nobr><img src='myimage.gif' /></nobr>"

Make sure the quotation marks surrounding the image path are single quotes!