Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on imageSwap and stay...

Status
Not open for further replies.

soonkhoo

Programmer
Dec 8, 2000
133
MY
Hi everyone..

On a button. I know how to rollover or swap images by using 2 images. However, if I want to use 3 images, that means..
1)onMouseUp (e.g. blue)
2)onMouseOver (e.g. red), and
3)onClick (e.g. green)

But hold up! I have a frameset. Top and bottom. And I have a list of buttons. Ok, when I click on one of the buttons, it changes to green and STAY GREEN to denote started, even if I've gone to other pages and back. Is this possible?

Regards,
Soon
 
it's logical ! you tell the button : if you're clicked, go green. You never tell him : if i change page, please go any other color.

 
Well... what if you've clicked...THEN come back to the page.. will it still stay green? Oh, by the way, I was using a default script from Macromedia Dreamweaver to do the image swapping. Perhaps that's the cause for restoring the image back to the blue After visiting other pages. Is there a simpler way to swap images then?
 
Surely with a frameset it will stay green - since you never load another page into thre frame containint the button? If your worried you could do something with a query string or cookie. if you do visit other pages in the same frame that you clicked the button, then yes all conditions will be set back to original - unless you were to specify in it's URL that that button should be green.

Or I guess you could check the referrer - and set the color depending on where they are coming from?
b2 - benbiddington@surf4nix.com
 
THis is what I did...The frameset is in a window not a browser...

And it was opened from the browser using this script...


<script>
function NewWindow(mypage, myname, w, h, scroll, resize) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
</script>


and adding..

<a href=&quot;menu.htm&quot; onClick=&quot;NewWindow(this.href,'name','794','565','no','no');return false;&quot;><img src=&quot;images/menu.gif&quot; width=&quot;250&quot; height=&quot;30&quot; border=&quot;0&quot; name=&quot;Image9&quot;></a>


And

In this first page of this window, it's a menu with a few buttons. (Note: Topframe and BottomFrame) The buttons are in the bottom. Now I'll swap images...here is an example of one of the buttons.

<a href=&quot;page1.htm&quot; onClick=&quot;NewWindow(this.href,'name','794','565','no');return false;&quot; onMouseOut=&quot;document.page1.src='images/blue.gif'&quot; onMouseOver=&quot;document.page1.src='images/red.gif'&quot; onMouseDown=&quot;document.page1.src='images/green.gif'&quot;><img src=&quot;images/blue.gif&quot; width=&quot;342&quot; height=&quot;30&quot; border=&quot;0&quot; name=&quot;page1&quot;></a></td>


NOTICE...the link to next page? It's overwriting the window with a new window. That's because I need to change the NavBar to something else. Ok... I hope everyone kinda understand what's going on...

Ok, so how then can I go back to the Menu page with the image still green??

Bangers... how do i specify the button using URL??

Thanks...

Regards
Soon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top