HighDots Forums  

My Button Doesn't Work!

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss My Button Doesn't Work! in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dmchord
 
Posts: n/a

Default My Button Doesn't Work! - 06-30-2008 , 01:21 AM






Building my first site and I'm oh so close (until the next thing goes wrong.)
Right now I'm preoccupied with my navigation buttons. Actually, I'm just trying
to test one button in a #nav div, but all the other buttons are ready to go if
I can figure this one out.

I've created three versions of the button. Outer bevel, for normal, outer
bevel with white text for rollover, and inner shadow with white text for
active. (I know, typical, but this is my first time! I can't wait to get Flash
and learn how to make super sweet nav bars!) I started out inserting rollover
images...but I can only use two images there. Next I tried to use CSS ID rules
ie. #nav a, # nav a:hover, #nav a"active, thinking I could change the
background to the new image, but that didn't work, either. (I'm assuming those
rules are just for simple text buttons, plus I couldn't get that crazy blue
line to go away even though I set decoration to none. In any case, it didn't
work.)

Then I remembered the behaviors palette from my reading, and I started playing
around with that. So I went back to insert rolloever image, and I've got my
onmouseover and onmouseout behaviors there, but I can't figure out how to add
an onclick behavior and get that third image (button) to work! (By the way,
there's some crazy script function stuff going on in code view, which I assume
is all about the behaviors: function swap image restore, preload images, swap
image, etc. No idea what any of that means, which is why I'm learning
Dreamweaver and not writing code!)

I'm not getting anywhere so far, but I think I might be on the right track,
since there's an "onClick" behavior. I just can't make it work. Any help will
be greatly appreciated. I'm going to be jumping for joy when I get my first
site working!


Reply With Quote
  #2  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: My Button Doesn't Work! - 06-30-2008 , 10:17 AM






Quote:
I can't wait to get Flash
and learn how to make super sweet nav bars!
Oh yes you can. If you want to use Flash for navigation, consider this -

1. Some people don't have Flash installed - what do they do?
2. Search engines don't parse Flash links - your site will not be spidered
3. Screen assistive devices don't parse Flash links - what will those users
do?
4. DW cannot maintain links within a Flash movie, so if you move or rename
a linked file, your navigation will break - what will you do?

It's usually a very bad idea for these reasons...

Quote:
but I can't figure out how to add
an onclick behavior and get that third image (button) to work!
You won't be able to. There's not a place for a three-state rollover when
using DW's javascript behaviors. Instead, go back to your CSS approach with
the button images as BACKGROUND images on the anchor tags. Make sure you
give each 'button' a unique ID, like -

<a href="..." id="button1"...
<a href="..." id="button2"...

and then you can use CSS to set the "down" button's background image to the
down state on each page.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"dmchord" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Building my first site and I'm oh so close (until the next thing goes
wrong.)
Right now I'm preoccupied with my navigation buttons. Actually, I'm just
trying
to test one button in a #nav div, but all the other buttons are ready to
go if
I can figure this one out.

I've created three versions of the button. Outer bevel, for normal, outer
bevel with white text for rollover, and inner shadow with white text for
active. (I know, typical, but this is my first time! I can't wait to get
Flash
and learn how to make super sweet nav bars!) I started out inserting
rollover
images...but I can only use two images there. Next I tried to use CSS ID
rules
ie. #nav a, # nav a:hover, #nav a"active, thinking I could change the
background to the new image, but that didn't work, either. (I'm assuming
those
rules are just for simple text buttons, plus I couldn't get that crazy
blue
line to go away even though I set decoration to none. In any case, it
didn't
work.)

Then I remembered the behaviors palette from my reading, and I started
playing
around with that. So I went back to insert rolloever image, and I've got
my
onmouseover and onmouseout behaviors there, but I can't figure out how to
add
an onclick behavior and get that third image (button) to work! (By the
way,
there's some crazy script function stuff going on in code view, which I
assume
is all about the behaviors: function swap image restore, preload images,
swap
image, etc. No idea what any of that means, which is why I'm learning
Dreamweaver and not writing code!)

I'm not getting anywhere so far, but I think I might be on the right
track,
since there's an "onClick" behavior. I just can't make it work. Any help
will
be greatly appreciated. I'm going to be jumping for joy when I get my
first
site working!



Reply With Quote
  #3  
Old   
dmchord
 
Posts: n/a

Default Re: My Button Doesn't Work! - 06-30-2008 , 12:01 PM



Thanks for the Flash heads up. It's easy to overlook such practical issues as
that when I get enthusiastic about something.
I'm not sure I'm following the button advice. Am I correct in saying that it
sounds like I want to create three separate divs for each state of each button?
Each with a specific (and same) width and height? Somehow on top of each other?
Sorry for not being clear on this.


Reply With Quote
  #4  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: My Button Doesn't Work! - 06-30-2008 , 12:49 PM



Quote:
Am I correct in saying that it
sounds like I want to create three separate divs for each state of each
button?
No. You would do this by leveraging the CSS pseudo-classes....

a { background-image:url(image1.jpg); }
a:hover { background-image:url(image2.jpg); }
a#button1 { background-image:url(image3.jpg); }

With this CSS scheme, all buttons would have image1.jpg as a normal button,
image2.jpg as a hover button, and button1 (and button1 ONLY) would have
image3.jpg as a button image, i.e., the DOWN image. On each page where you
would want to set the button image you would just change the button ID in
the rule.

What I normally do is to have the first two rules in the linked stylesheet,
and have the button-specific rule in a little stylesheet immediately above
the </head> tag.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"dmchord" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Thanks for the Flash heads up. It's easy to overlook such practical issues
as
that when I get enthusiastic about something.
I'm not sure I'm following the button advice. Am I correct in saying that
it
sounds like I want to create three separate divs for each state of each
button?
Each with a specific (and same) width and height? Somehow on top of each
other?
Sorry for not being clear on this.



Reply With Quote
  #5  
Old   
dmchord
 
Posts: n/a

Default Re: My Button Doesn't Work! - 06-30-2008 , 01:20 PM



Thanks again! I've got a feeling I might be getting in a little over my head
for having just opened the program for the first time a week or so ago. It
sounds like I'll need to manually insert some code, which I know next to
nothing about. maybe I should keep the first site a little simple (it's just a
fun family picture thing) with just rollovers and such, and try the other after
I read another, more advanced book. Thanks again for taking the time...


Reply With Quote
  #6  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: My Button Doesn't Work! - 06-30-2008 , 01:26 PM



Without a doubt, the most productive thing you can do right now, and for the
next several weeks at least, is to put DW in a drawer and instead study HTML
and CSS. DW will expect (require?) that you have at least MINIMAL
familiarity with them. The more foundation you can acquire there, the
easier DW will become....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"dmchord" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Thanks again! I've got a feeling I might be getting in a little over my
head
for having just opened the program for the first time a week or so ago. It
sounds like I'll need to manually insert some code, which I know next to
nothing about. maybe I should keep the first site a little simple (it's
just a
fun family picture thing) with just rollovers and such, and try the other
after
I read another, more advanced book. Thanks again for taking the time...



Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.