Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: itwerxPosted on 2004-05-15 at 04:03:48ID: 11074854
Hi annas,
_off.gif"; n__over.gi f";
+ "Over.src"); inalImage;
+ "Off.src"); inalImage;
cript>
');" onMouseUp="btnOut('link'); " target="_self"><img src="images/btn_off.gif" alt="Click Here" name="link" width="45" height="22" border="0"></a>
I don't think that this is doable in Fireworks. (Of course I may be wrong and if anyone knows how, please correct me.) You might want to try doing this by modifying a simple "Rollover" JavaScript. Firstly create yourself a .js file. I usually call mine rollover.js but you can call it anything you like. This .js file will reside in the root directory. See below for an example:
----------------Example .js file----------------
*/Comment: Declare new images*/
if (document.images)
{
button_Off=new Image();
button_Over=new Image();
*/Comment: Add file source for images*/
button_Off.src="images/btn
button_Over.src="images/bt
}
else{
}
*/Comment: Add the following for browsers that don't support images*/
button_Off.src="";
button_Over.src="";
}
}
*/Comment: This next part contains the two swap-images functions*/
if(document.images){
function btnOver(imgName)
{
originalImage=eval(imgName
document[imgName].src=orig
}
}
if (document.images){
function btnOut(imgName)
{
originalImage=eval(imgName
document[imgName].src=orig
}
}
---------------End of File------------------
Now to implement this we:
1. Insert the following between the <head> tags to link the page to our external .js file.
<script src="rollover.js" type="text/javascript"></s
2. After inserting the image we are going to use as a rollover, we have to give it a distinctive name. In this example I will call it "link". So now our html for this image should read something like:
<img src="images/btn_off.gif" alt="Click Here" name="link" width="45" height="22">
3. We add the link (in this example to "newpage.htm")
<a href="newpage.htm" target="_self"><img src="images/btn_off.gif" alt="Click Here" name="link" width="45" height="22" border="0"></a>
4. Lastly we link our JavaScript by adding "onMouseDown" which will change the image when clicked on, and if you want it to restore to the upstate, "onMouseUp".
<a href="newpage.html" onMouseDown="btnOver('link
Hope all that makes sense. If you have any problems implementing this I will be happy to steer you in the right direction. Once you get the hang of it, you'll find it is very simple and can be utilised in many ways.
Cheers.