Click to See Complete Forum and Search --> : Coding Help


jgnew
07-24-2003, 03:58 PM
I've downloaded this code from the site and find it very useful. Can someone help me modify the code to accept an image file, instead of the text, as the hyperlink? Thanks.



<!-- TWO STEPS TO INSTALL FRAME BRANDING:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Grace Li (gl105@yahoo.com) -->
<!-- Web Site: http://www.sysu.net/gl105 -->
<!-- Modified By: Ronnie T. Moore, Editor -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
percent = "10%";
function frameBranding(actualurl, brandingurl, frametype) {
var framewin = window.open("","brandingframe");
with (framewin.document) {
write("<html><frameset " + frametype + "=" + percent + ",*>");
write("<frame src=" + brandingurl + ">");
write(" <frame src=" + actualurl + ">");
write("</frameset></html>");
}
return false;
}
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
<a target="_new" href="http://www.altavista.com/" onClick="return frameBranding('http://www.altavista.com', 'http://javascript.internet.com/navigation/frames-branding-thanks.html', 'rows');">Altavista (with rows branding)</a>
<p>
<a target="_new" href="http://www.lycos.com/" onClick="return frameBranding('http://www.lycos.com', 'http://javascript.internet.com/thank-you.html', 'cols');">Lycos (with cols branding)</a>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.48 KB -->
This document contains frames, which cannot be edited. The original document is attached.

David Harrison
07-24-2003, 04:19 PM
Just do it like you would for a normal link:

<a target="_new" href="http://www.altavista.com/" onClick="return frameBranding('http://www.altavista.com', 'http://javascript.internet.com/navigation/frames-branding-thanks.html', 'rows');"><img src="Altavista.gif" width="100" height="100"></a>

jgnew
07-24-2003, 04:39 PM
Thanks for your help, I'm really new at this stuff!

David Harrison
07-24-2003, 04:50 PM
Happy to help. :)