Dreamweaver rollover help!

baz_m_191

New Member
Messages
18
Reaction score
0
Points
0
Hi,

hope someone can help me figure this out... my rollover buttons on the bottom of the pages wont work!

Any ideas will be greatly appreciated, sorry if its obvious but cant get my head round it!!

Thanks in advance8):

www.becreative.x10.bz
 

Darkmere

New Member
Messages
358
Reaction score
2
Points
0
They are working for me, they all animate when I roll over them
 

baz_m_191

New Member
Messages
18
Reaction score
0
Points
0
Cheers bud, not showing in safari... Strange!!

Which browser are you using? Cheers for looking!:biggrin:
 

baz_m_191

New Member
Messages
18
Reaction score
0
Points
0
Cheers

Have looked at work and your right they work in Firefox.... but not in Safari, or Ie.


Anyone came across a similar thing or see a possible solution.

As ever thanks in advance!
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Hi "baz_m_191",

First of all, I'm curious to know if you're writing the codes yourself, or if you're using Adobe Dreamweaver to design the web page(s) and have it generated the codes for you (I'll let you know in a second the reason why I'm asking this).

Anyway, I think that I've found the problem with your page's rollover buttons. The reason that they're working in Mozilla Firefox is that probably the browser is IGNORING the error, but Microsoft Internet Explorer (and probably Apple Safari too) is NOT.

To fix the problem, you'll need to take out/delete line #33 (<p>&nbsp;</p>) in your JavaScript function "MM_findObj()" at the <HEAD> section of your HTML document:

Code:
27     function MM_findObj(n, d) { //v4.01
28       var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
29         d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
30       if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
31       for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
32       if(!x && d.getElementById) x=d.getElementById(n); return x;
[COLOR="red"]33     <p>&nbsp;</p>[/COLOR]
34     }

This is where the error occurs, and it will fix the error.

Hope this helps. Let me know if the fix is working for you (or NOT).


********

To answer the question WHY I'm asking if you're writing the codes yourself, or if you're using Dreamweaver to generate the codes for you is that on line #80 in the <BODY> section of your HTML document:

Code:
77     <div class="wrapper">
78       <div "style=width:960px; margin:auto="margin:auto"">
79         <p align="center">
[COLOR="red"]80[/COLOR]         <a href="gallery.html" [COLOR="red"]onMouseOver="MM_swapImage('gall','','botgal.png',1)" onMouseOut="MM_swapImgRestore()"[/COLOR] ><img src="botgal grey.png" name="gall" width="171" height="161" hspace="20" border="0" id="gall"></a><a href="services.html" [COLOR="red"]onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('serv','','botser.png',1)"[/COLOR]><img src="botser grey.png" name="serv" width="171" height="161" hspace="20" border="0" id="serv"></a><a href="about us.html" [COLOR="red"]onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('about','','botabout.png',1)"[/COLOR]><img src="botabout grey.png" name="about" width="171" height="161" hspace="20" border="0" id="about"></a><a href="contact.html" [COLOR="red"]onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('cont','','botcont.png',1)"[/COLOR]><img src="botcont grey.png" name="cont" width="171" height="161" hspace="20" border="0" id="cont"></a></p>
81     <p>&nbsp;  </p>
82     </div>
83     </div>

all the "onMouseOver" and "onMouseOut" intrinsic events should have been handled/placed in the <IMG> tags, not the <A> tags, even though the codes work since they're looking for the correct image object ID names (it's more CORRECT this way since you move your mouse over and out of the images, not the links).
 

baz_m_191

New Member
Messages
18
Reaction score
0
Points
0
WOW!!!!

Losthorizon you are a hero! Really really appreciate the time and effort spent on that reply... Thank you very much!

I will try amending that and let you know how I get on, but even if this doesnt fix the problem I am pleased you have taken time to check the coding!

Sorry to be a pain but why do you think that line would have been in there? I am very new to this and am picking up as much as I can along the way ( have managed to get my head round the majority of things but it is hard work when coming from a primarily design background.

With regard the rollover images, I created these (and the rest of the site... Bar the unavoidable checking/changing code, adding wrappers etc) in design view, I simply inserted image/rollover image. The code was fine for a while then as more elements were added the rollover failed ( the additional pages were the coding from page A copied and pasted... Then any images/text or variables changed to suit the relevant page... A bit of a cheat I suppose and also the reason that the other pages fail!).

On a side note I googled this to no avail and also tried creating rollover in fireworks but something ( hopefully this error you have spotted) stopped that from working too!!

Phew - that was a bit long winded!!

Anyway thanks again and I will let you know as soon as I have tested the amend

Cheers
Baz 8)
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
This is exactly why you shouldn't use applications like Dreamweaver. They produce invalid and bloated pages that don't function the same in all browsers.
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Hi "baz_m_191",

Sorry to be a pain but why do you think that line would have been in there?

If what you're referring to is line #33 in:

Code:
27     function MM_findObj(n, d) { //v4.01
28       var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
29         d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
30       if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
31       for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
32       if(!x && d.getElementById) x=d.getElementById(n); return x;
[COLOR="red"]33     <p>&nbsp;</p>[/COLOR]
34     }

That line of codes SHOULDN'T even be in there simply because it's HTML codes while the rest of the codes are JavaScript (I guess it's the result of all your copying & pasting).


HOW DO I COME TO THIS CONCLUSION/FINDING?

If you're using Microsoft Internet Explorer, double-click on the yellow error warning icon on the left of your browser window's status bar (the icon appears whenever you have error(s) in your page), and the browser will show you the line number(s) where the error has occurred (in this case, line #80 after you move your mouse over the rollover image) - or you can view the error(s) in the Developer Tools window (press F12 to bring up), and the rest is just a matter of tracing through the codes:

<line #80>: onMouseOver="MM_swapImage('gall','','botgal.png',1)"
<line #36>: function MM_swapImage() --> MM_findObj(a) <line #38>
<line #27>: function MM_findObj(n, d) --> <p>&nbsp;</p> <line #33>


P.S.: I'm VERY SURE (almost %100 SURE) that removing line #33 will fix your problem to get the rollover images working in Internet Explorer since I've got a subset of your codes (not all of the codes) working on my computer's local drive (I tested the codes first before I replied to your post). But let me know how it turns out anyway regardless.
 

baz_m_191

New Member
Messages
18
Reaction score
0
Points
0
Callum what would you suggest as an alternative?

Like I said above I am from a design background and was under the impression that dreamweaver was the main industry standard (the other cs suite programmes are).

Cheers

Baz
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
Callum what would you suggest as an alternative?

Like I said above I am from a design background and was under the impression that dreamweaver was the main industry standard (the other cs suite programmes are).

Cheers

Baz

It most certainly isn't the industry standard!

There are a lot of alternatives. If you want an IDE (similar to Dreamweaver, but not crap), try Netbeans or Komodo Edit (or IDE if you can afford it, but Komodo Edit, despite the name, is still a good IDE).

http://webdevrefinery.com/forums/to...or-a-permanent-web-developers-toolkit-sticky/
 

baz_m_191

New Member
Messages
18
Reaction score
0
Points
0
Lost horizon you are a genius my friend... Thanks to you the rollovers are all ok now!!!

No idea why a code which is simply a space has created such a pain!

Thanks for being so succinct in your reply too, very informative ( I may have to nag you with future errors now!!!)

P.s do you think the site is ok?

Cheers baz
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
No idea why a code which is simply a space has created such a pain!
A property of most logical systems is that changing a single character can turn a true statement false or (more often) into something that isn't even a valid statement.

Since computers have no real intelligence, they generally don't have a way of recovering from syntax errors and other, ill-formed programs.
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
You're certainly most welcome "baz_m_191",

I may have to nag you with future errors now!!!

SURE, but keep in mind that there're others here who can help you with your future problem(s) too. One thing that I find is there's a lot of GOOD and EXPERIENCED programmers on this board based on my impression of them when reading their posts.


do you think the site is ok?

Your site looks OK to me. A few things that I can think of to improve it (if you don't mind my suggestions) are:

  • (perhaps) add some colors to your pages (they look kind of bland right now),
  • consider of putting your site in a frame (or a round-corner box) with (may be) a darker color background around it so your site would literally jump out,
  • put your service listings in different color box(es) (this way, they would look more interesting and stand out better),
  • (somewhat) smaller font size.

Also, consider of putting your site up for review in the "Review My Site" forum at:
http://x10hosting.com/forums/review-my-site/

You'll get more constructive criticisms other than my own opinions but be ready for them as some of the criticisms/comments may not be to your liking.

---------- Post added at 12:05 PM ---------- Previous post was at 06:04 AM ----------

Hi "baz_m_191",

No idea why a code which is simply a space has created such a pain!

Normally, it's OK (it will NEVER give you any problem since it's valid HTML codes), but in this case, you stick it in where it's not supposed to be between the <SCRIPT type = "text/JavaScript">...</SCRIPT> tags which can only take JavaScript codes (I'm very much SURPRISED that Mozilla Firefox didn't catch the error).
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
It's not that it's a space -- JavaScript is not particularly sensitive to white space -- it's that it's HTML markup made up of characters that have a meaning in JavaScript. The < is a less-than comparison operator in JavaScript, the > is a greater-than, the & is a bitwise AND operator, and so forth. Everything inside the <script>...</script> tags needs to be either valid JavaScript or a comment:

Code:
//this is a comment -- the two slashes mean that everything after them on this line will be ignored

/*
All of this text is also a comment.
The slash+asterisk means that everything will be ignored until
an asterisk+slash comes along.
The next line will end this comment.
*/
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Thank you for clarifying it "essellar",

Actually, I saw the word "space" but I assumed what "baz_m_191" meant was the whole HTML line of codes which is "<p>&nbsp;</p>" (which was the reason why the pages' rollover buttons failed to work in the Internet Explorer and Safari browsers) because that's what we were discussing earlier in our previous posts. I didn't want to go into the details on how the browser parses, interprets, and recognizes the coding languages that's why I wrote "you stick it in where it's not supposed to be between the <SCRIPT type = "text/JavaScript">...</SCRIPT> tags which can only take JavaScript codes", but I'm GLAD that you did (this way, there won't be any confusion or misunderstanding later on).

As always, your input are very NOTEWORTHY and VALUABLE to any post.
 
Top