Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old January 8th, 2004, 06:36 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
OnMouseOver - Javascript

On my site for work I am working on a couple different navigation schemes to go over with the boss to make sure it meets his approval before finishing production. On one layout I want to have a pop out navigation system using javascript. Which I can accomplish just fine and I have completed it. But at the same time I want the original image to have OnMouseOver action as well. But I can't seem to get it to work using one OnMouseOver action to create the rollover effect on the original button and at the same time pop out the sub-menus. Is is possible to have both or do I have to pick on or the other?
Here are the two codes:
Code:
<img src="../Left/Sliced/1.png" width="125" height="44"><a href="corpinfo.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Corporate Information','','../Left/Sliced/2R.png',1)">


The above is for the rollover action to take place on the original graphic.

Code:
<a href=javascript:; onmouseover=s_show('corpinfo',event) onmouseout=s_hide()><img src=../Left/Sliced/1.png></a>


That is the code I use if I want to have the sub-menu pop out. I've tried combining the two but it doesn't work so I thought there might be a secret to it that I'm missing.

Any help would be appreciated.
Thanks!

The Squirrel

Reply With Quote
  #2  
Old January 8th, 2004, 06:45 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: OnMouseOver - Javascript

Just put both javascript calls into the onMouseOver attribute:
Code:
onMouseOver="MM_swapImage('Corporate Information','','../Left/Sliced/2R.png',1); s_show('corpinfo',event);"

Reply With Quote
  #3  
Old January 8th, 2004, 07:17 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
RE: OnMouseOver - Javascript

Thanks that did the trick. I don't know why I didn't think about adding both calls into one onMouseOven event. Just shows my noobieness with Javascript.

Thanks again!
The Squirrel

Reply With Quote
  #4  
Old January 9th, 2004, 02:17 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
RE: OnMouseOver - Javascript

Just found a small problem that is partially related to this. On one of the pages I have a flash 'ducument' if you will, and when I roll over the navigation menu to go to another portion of the site the submenus are under this flash file. I have it in a layer and I made the layer to be on the most bottom level as possible but I am still getting same results. Are there any ways around this?

Found another one... Everything works perfectly in Mozilla Firebird but when I go to IE 6.0 one of the popups does not display. In the bottom left corner of the browser is says it's done loading but with errors on page. I'm trying to track it down but cannot find it yet.

Edit: In IE I found that the error is being caused by line 18 of the code. Here is line 18: }

Yup, that's it. But that belongs to this code:

function MM_swapImgRestore() {
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
} <--Line 18

Here is the complete error message:
Line: 18
Char: 3569
Error: 's_[...].0' is null or not an object
Code: 0
URL: URL to my page

I'm continuing to look into it but any help or suggestions from you guys would be appreciated.

Thanks!
The Squirrel

Reply With Quote
  #5  
Old January 9th, 2004, 05:13 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: OnMouseOver - Javascript

Line 18, Character 3569 looks a little strange since that line isn't near that long. My guess is that the file doesn't have correct wnd-of-line characters and the error is further down the code.

Reply With Quote
  #6  
Old January 9th, 2004, 06:34 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
RE: RE: OnMouseOver - Javascript

Hmmm that is strange.

Here is the whole javascript that is on the page that is causing problems if it will help any:

Code:
<script language=JavaScript>
<!--
function s_show(){return false}
function s_hide(){return false}
if(window.event+''=='undefined')event=0

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>


This is most puzzling.

Reply With Quote
  #7  
Old January 9th, 2004, 07:46 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
RE: OnMouseOver - Javascript

Ok, I got it figured out now. It was a syntax error that should've been fine but IE was extramly picky with it.

At the end of each menu is code such as:
{U:'CoatingBooth-3.php',T:'Coating Booths - p.3'},
{U:'ECSwPrimerBooth.php',T:'Extrusion Coating...'},
{U:'tolulene.php',T:'Tolulene Applicator'}
]
);

At the end of each line you're supposed to seperate it was a comma, well I did that on all lines, including the final line before the closing ] bracket. Removed that single comma and all works well. Reason I didn't discover this sooner is because one of the other menus had a comma on the last line and it worked fine.

But thanks for the help anyways.

The Squirrel

Reply With Quote
  #8  
Old January 10th, 2004, 01:32 PM
jeffcapeshop jeffcapeshop is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 jeffcapeshop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: OnMouseOver - Javascript

to answer your popup menu under flash question,

i had the same problem a while back - to get around it you can add the following:
Code:
<param name="wmode" value="transparent">


with the other lines that "look the same" (can you tell i'm a proffesional? ;)

it was a while ago but i think that's it.

you might get some problems with your flash file - not entirely sure what it actually does, but for the majority of files i've used it with it has worked fine.


Reply With Quote
  #9  
Old January 12th, 2004, 12:33 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
RE: RE: OnMouseOver - Javascript


Quote:
to answer your popup menu under flash question,

i had the same problem a while back - to get around it you can add the following:
Code:
<param name="wmode" value="transparent">


with the other lines that "look the same" (can you tell i'm a proffesional? ;)

it was a while ago but i think that's it.

you might get some problems with your flash file - not entirely sure what it actually does, but for the majority of files i've used it with it has worked fine.




Thanks, but where would I add that code to? I will probably figure it out but thought I'd ask anyways.

The Squirrel

Reply With Quote
  #10  
Old January 12th, 2004, 01:49 PM
jeffcapeshop jeffcapeshop is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 jeffcapeshop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: OnMouseOver - Javascript

sorry - i meant with the other "param name=" bits in your html.

hope it works!

Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="512" height="116">


<param name="wmode" value="transparent">


<param name=movie value="../flash/crowd.swf">
<param name=quality value=high>
<embed src="../flash/crowd.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="512" height="116">
                </embed> 
              </object>


edit: why is there a nasty grinning smilie in my code? i thought it was supposed to avoid that sort of thing..

Reply With Quote
  #11  
Old January 12th, 2004, 07:37 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
RE: OnMouseOver - Javascript

Sorry about my slowness. I don't know why I didn't realize that the param name code went into the flash part of the site. It was still early in (to me) when I wrote that post and I didn't read your post very well.

But anyways, that didn't seem to work. I put in the code and it is still showing up under the flash. I looked at the source code from the internet and that code is not there. I know I copied the file to my directory since I opened it directly from the web site directory in order to make sure the code was still there.

The Squirrel

Reply With Quote
  #12  
Old January 12th, 2004, 08:16 PM
jeffcapeshop jeffcapeshop is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 jeffcapeshop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: OnMouseOver - Javascript

hmm

not sure what your problem is - i made a (very!) quick test here:

http://www.sojomedia.com/codewalker/

both with and without the
Code:
<param name="wmode" value="transparent">


seems to work fine..

good luck!

Reply With Quote
  #13  
Old January 13th, 2004, 01:18 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
RE: OnMouseOver - Javascript

Ok, that helped me figure out the problem. It was my browser... It works fine in IE, but does not work in Mozilla Firebird.

Thanks for your help.

The Squirrel

Reply With Quote
  #14  
Old January 13th, 2004, 04:29 PM
jeffcapeshop jeffcapeshop is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 jeffcapeshop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: OnMouseOver - Javascript

ah, that's interesting..

presumably there's a better method that will work with all browsers..

hopefully..

Reply With Quote
  #15  
Old January 13th, 2004, 05:25 PM
The Squirrel The Squirrel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mid-Indiana, USA
Posts: 153 The Squirrel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to The Squirrel
RE: OnMouseOver - Javascript

I would certainly hope/think so. I will post here if I find anything out about it.

The Squirrel

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > OnMouseOver - Javascript


Thread Tools  Search this Thread 
Search this Thread: