Replace this:
Code:
onClick="jumpto2('http://google.com')"
with:
Code:
onclick="top.location='http://google.com';"
The behavior of a button when clicked is often beyond the control of the designer. But, you can try this:
Code:
.initial2 {
background-color:white
border:1px solid black;
}
in place of:
Code:
.initial2{background-color:white}
The script can be made external by saving this, and only this:
Code:
/***********************************************
* Rollover background-color button Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
//Specify optional button target: "_new" for new window, or name of FRAME target (ie "myframe")
var buttontarget="_new"
function change(e, color){
var el=window.event? event.srcElement: e.target
if (el.tagName=="INPUT"&&el.type=="button")
el.style.backgroundColor=color
}
function jumpto2(url){
if (buttontarget=="")
window.location=url
else if (buttontarget=="_new")
window.open(url)
else
parent[buttontarget].location=url
}
to a text file and calling it - say, button_roll.js
Put this in the head of the page(s) that will use it:
HTML Code:
<script type="text/css" src="button_roll.js">
/***********************************************
* Rollover background-color button Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
If the script isn't in the same folder as the page(s) that use it, you must specify the path to the script in the src attribute, example:
Code:
src="http://www.mydomain.com/scripts/button_roll.js"
You will still need to include the style section on the page(s) or make it an external style sheet.
Bookmarks