Navi JS-Error

Use GitHub to post feature requests for phpwcms.
Locked
cguenther
Posts: 111
Joined: Sun 11. Jan 2004, 12:41
Location: Halle, Germany
Contact:

Navi JS-Error

Post by cguenther »

Hallo,

the navigation is creating a js-error while using the mouseOver-Funktion. The error comes with IE 5.0 and IE 5.5 coz of, that browser don't know the cursor.style "pointer". In IE 5.0 and 5.5 the "pointer" must be replaced with the style "hand".

I've done a little changes to fix that error:

original code (include/front_func.inc line 700)

Code: Select all

if($nav_table_struct["js_over_effects"]) {
   $js = " onClick=\"location.href='".$link."';\"";
   $js_act = " onMouseOver=\"this.style.cursor='pointer';\"".$js;
   $js .= " onMouseOver=\"this.bgColor='".$nav_table_struct "row_over_bgcolor"]."';
   this.style.cursor='pointer';".$link_image_id.".src='".$nav_table_struct "linkimage_over"]."';\"";
   $js .= " onMouseOut=\"this.bgColor='".$nav_table_struct["row_norm_bgcolor"]."';".$link_image_id.".src='".$nav_table_struct["linkimage_norm"]."';\"";
}
should be changed to:

Code: Select all

if($nav_table_struct["js_over_effects"]) {
   if(strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE 5') ) { $_cursor = 'hand'; } else { $_cursor = 'pointer'; }
   $js = " onClick=\"location.href='".$link."';\"";
   $js_act = " onMouseOver=\"this.style.cursor='".$_cursor."';\"".$js;
   $js .= " onMouseOver=\"this.bgColor='".$nav_table_struct "row_over_bgcolor"]."';
   this.style.cursor='".$_cursor."';".$link_image_id.".src='".$nav_table_struct "linkimage_over"]."';\"";
  [...]
so each browser will get the right cursor-handling.

it a pitty do fix it after every patch-release, so maybe a inclusion in a future release would be great.

greetings
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

just a little help the file is placed in folder: include/inc_front
http://www.studmed.dk Portal for doctors and medical students in Denmark
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

I have just seen that there is also this solution... http://www.phpwcms.de/forum/viewtopic.php?p=2207#2207 which is best?
http://www.studmed.dk Portal for doctors and medical students in Denmark
cguenther
Posts: 111
Joined: Sun 11. Jan 2004, 12:41
Location: Halle, Germany
Contact:

My is the better choice ...

Post by cguenther »

... coz, the link u gave is not a solution.

It just changing one error to another error. E.g. Mozilla, Netscape, IE 6+ knows the style 'pointer' but just IE 5.x dosen't know that, they only know style 'hand'.

So if you generally change 'pointer' to 'hand' you will produce the JS-Error in Mozilla, Netscape and IE 6+.

It's important to check out which browser the user is using, that why i checked via PHP the SERVER_VAR for the browser version.
jmeyknecht
Posts: 112
Joined: Sun 11. Jan 2004, 23:13
Location: Merseburg, Germany
Contact:

Post by jmeyknecht »

lol, as i remember, we (chris and me) already sent this fix to Oliver on 2004-01-12 to include in further releases. :-))

for those, who love cross browser compliant code, it's annoying, to clear this simple fix after each phpwcms update.

*begging for inclusion now* ;-)
Locked