Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Rollover on Interactive Buttons
Old 06-17-2006, 01:21 AM Rollover on Interactive Buttons
Novice Talker

Posts: 10
Location: Grapevine, Texas
Trades: 0
I am using FrontPage however I do not want to use the built-in interactive buttons. I have copy script from a site (modified to my detail obviously), however it will not produce the results. As the pointer passes over the button, my goal was to have the button highlight as though you had selected that button, then go off if you do not select it.

Could I get some feedback please.

Thanks,

Steve
Attached Files
File Type: txt Index.txt (7.7 KB, 11 views)
SteveT is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-23-2006, 11:04 AM Re: Rollover on Interactive Buttons
scottfree's Avatar
Extreme Talker

Posts: 234
Location: Hamburg
Trades: 0
Firstly, I noticed you have some spaces in image names which are translated into something like: Frames/Tolbert%20Star%20Logo_01.gif. This is not very good practise. Try using all small letters and use underscores instead of spaces. Servers differentiate between capitals and small letters so you will avoid future problems. You should have something like "frames/tolbert_star_logo_01.gif" or "Frames/TolbertStarLogo_01.gif"

Secondly I noticed: src = eval(imageName + "on.src") the on.src call is in "" and that will treat it as the string "on.src" and not call the value for the property src of the object on. Try taking the "" away and just have imageName+on.src

good luck
__________________
I think, therefore I am..... I think.

Last edited by scottfree; 06-23-2006 at 11:06 AM..
scottfree is offline
Reply With Quote
View Public Profile Visit scottfree's homepage!
 
Old 06-28-2006, 06:48 AM Re: Rollover on Interactive Buttons
Average Talker

Posts: 17
Name: Volodymyr
Location: Zaporozhye, Ukraine
Trades: 0
I think error in line:
'document[imageName].src = eval(imageName + "on.src");'
document[imageName] - it's object (image)
document[imageName].src - it's string
so, what do your want use string or object in this line?
if string:
function turnPic(swt)
{
var m_strPath; //path to image ("./Frames/")
var m_strFN; //filename of image
var m_strPos; //turnOn or Off
if (swt) m_strPos = "on.src" else m_strPos = "off.src";
m_strFN = imagePath + imageName + m_strPos; //your can control result: document.write("sourceName: " + m_strFN)
return m_strFN;
}
+
document[imageName].src = turnPic(1);
//********************************
if object your must scan all document.images for equal of need string-Name then use assign to object. It' correct but longer.
*P.S. note: use array of image collection + preload + number's indexing + captureEvents + css
vburin is offline
Reply With Quote
View Public Profile Visit vburin's homepage!
 
Old 06-30-2006, 07:25 PM Re: Rollover on Interactive Buttons
Junior Talker

Posts: 2
Name: Dominick Allen
Trades: 0
There is a much easier way to do this, and it works with all browsers as far as i know...

Code:
<a href="index.html" onmouseover="home.src='homeon.gif';" onmouseout="home.src='home.gif';"><image src="home.gif" name="home" border="0"></a>

In this case, i named my home button "home" so when a user puts there mouse over the anchor it will switch the image named "home" to the new image and when the mouse is off of the image it will switch the image "home" back to the starting image.
ratchethosting is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Rollover on Interactive Buttons
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.91298 seconds with 13 queries