www.webdeveloper.com
Results 1 to 3 of 3

Thread: Fireworks Frame Image Swapping

  1. #1
    Join Date
    Sep 2005
    Posts
    5

    Fireworks Frame Image Swapping

    Hey yall. I'm a newb. Period.

    Fireworks Rollover button question:

    Instead of having the image swap in onMouseOver, I put it into onClick, so that the frame image is changed when someone clicks instead of just rolling over the button.

    here's the code in a button (with the image names changed for ease of reading):


    <a href="javascript:;" target="_top"
    onMouseOut="MM_nbGroup('out');"
    onMouseOver="MM_nbGroup('over','x2.gif,'x2-2.gif','x2-3.gif',1);"
    onClick="MM_nbGroup('down','navbar1','x2','x2-3.gif',1);MM_swapImage('x20','','x20-3',1);"><img name="x2" src="x2.gif" width="150" height="56" border="0" alt="">
    </a>

    This above code works properly, swapping the image WITHOUT reloading the page, which is what I want! (You can check it out, functioning online at www.maccru.com All the buttons have the same code essentially, as I showed above)

    So you can see the swap image in the onClick. And here's the problem; what does the <a href="javascript:;" target="_top" mean? Is there a better way to prevent the page reload, but ensure that the image is swapping with the onClick? I keep getting nagged about that section of the code, and with good reason; if I left <a href="#" there, then it would reload the page, and I don't really like that.

    Any help? Suggestions? Professional Advice?
    Thanks.
    Deg

  2. #2
    Join Date
    Sep 2005
    Posts
    7
    hey deg,

    I can try to break down your code for you, which might help lend some understanding.

    I think what you have here:

    <a href="javascript:;" target="_top"

    Is referencing your "mm_menu.js" file, which is loaded here:

    <script language="JavaScript1.2" src="mm_menu.js"></script>

    Then I believe you reference a function within that .js file by initializing the function here:

    <script language="JavaScript1.2">mmLoadMenus();</script>

    Last but not least, this activates your menu:

    <a href="javascript:;" target="_top"... means that the _top is calling the javascript function depending on the mouse state:

    onMouseOut="MM_nbGroup('out');"

    The html page takes the state of the mouse and combines that code with javascript:; - where (;) means continue, so depending upon the mouse state, your html page is doing this:

    "javascript:onMouseOut="MM_nbGroup('out');"

    which is similar to one of the most common javascript functions:

    "javascript:openAWindow('ice.html','ice',375,250,1)" which references a .js file called openAWindow.js

    If you'd open your .js file, you'll probably see a function in there called MM_nbGroup('out'); which is doing the mouse out switch.

    So, the answer to your question is: If you replaced [href = javascript] with [href = #], nothing would happen, and your rollovers would cease to work. In using web page generating programs, like Fireworks, there are limitations that you are stuck with. Pick up Dreamweaver if plan to continue with the web development, because Fireworks will take you only so far, and Dreamweaver is the way of the future.

    Anyway, just a stab in the dark, I don't have or use Fireworks, but that's what seems to be happening.

    Nice site, btw. Very tactile.

    ~Chip

    P.S. -

    This is probably counting how many people are coming to your site, at least it seems like that by the way it's implemented at the bottom of your page:
    <script type="text/javascript" language="javascript"
    src="http://www.statcounter.com/counter/counter.js"></script>

    }else{

    what is this?

    }
    Last edited by Chipley; 09-22-2005 at 02:46 PM.

  3. #3
    Join Date
    Sep 2005
    Posts
    5
    So, the answer to your question is: If you replaced [href = javascript] with [href = #], nothing would happen, and your rollovers would cease to work. In using web page generating programs, like Fireworks, there are limitations that you are stuck with. Pick up Dreamweaver if plan to continue with the web development, because Fireworks will take you only so far, and Dreamweaver is the way of the future.
    Chip, thanks for the heads up. In answer to your remarks, the href=# does actually permit the changing of the images, but it doesn't let me change the images without reloading the whole page, and then leaving me back at the top of the page. So, when I took out the href = #, and supplanted it with that strange little javascript bit, it stopped reloading the page, and just changed the graphic. That's what I want...

    Yeah, I have dreamweaver. Problem is I don't know real HTML, XHTML, CSS, javascript etc or any of that, so writing code from the ground up is a difficult thing. I'll probably get much deeper into it; I've been to some flash sites, and they are really inspiring, like pouring gasoline on a candle of web-need.

    Thanks again.
    Deg
    P.S. Yes, the statcounter is there for that very purpose.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles