PDA

View Full Version : Jump to top Link help



SoggyCashew
11-22-2009, 07:27 PM
Hello, im using the Jump to top Link (http://www.dynamicdrive.com/dynamicindex5/jumptop.htm) script from here and everything is working except I want to use an image instead of text. How would I do this? Here is what I want to use:
img src="includes/templates/pure_black/images/float3-top2.gif Thanks!

jscheuer1
11-23-2009, 05:48 AM
Consider using:

http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm

It's more robust. However, the current script you have can be edited -

At the very top of the jumptop.js file we see:


/***********************************************
* Jump To Top Link Script- Dynamic Drive (www.dynamicdrive.com)
* Last updated Nov 13th, 03'.
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Specify the text to display
var displayed="<nobr><b>[Top]</b></nobr>"

///////////////////////////Do not edit below this line////////////

Change that to:


/***********************************************
* Jump To Top Link Script- Dynamic Drive (www.dynamicdrive.com)
* Last updated Nov 13th, 03'.
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Specify the text to display
var displayed='<img src="includes/templates/pure_black/images/float3-top2.gif" alt="">';

///////////////////////////Do not edit below this line////////////

One thing to keep in mind though is that the path to the image as listed in its src attribute is relative to the page(s) using the script, not to the script itself. If there is any question or if the same script will be use by pages in different folders on your site, use the absolute path to the image.