Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Javascript Slashdot style menu with Safari issues

Posted on 2007-11-28
9
Medium Priority
?
340 Views
Last Modified: 2013-12-07
Hi Experts,

I have downloaded and installed the Slashdot style menu from Dynamic Drive. http://www.dynamicdrive.com/dynamicindex1/slashdot.htm

The script is functioning in Firefox, IE AND Safari when it is either in a plain test template page or on the DD site.
Here is the URL to the working 'test' page on my server:
http://www.randomlychallenged.com/SiteMapTEST2.php

However when I come to embed the script in the page I intend to use it in I lose functionality in Safari. Both FF and IE seem unaffected.
I have tried both Transitional and Strict XHTML 1.0 but it doesn't seem to work with either.

Here is the target page:
http://www.randomlychallenged.com/SiteMap.php

I am not very familiar with Javascript and so there may just be a syntax error that I have failed to spot.

Thank you for your expert advise.
0
Comment
Question by:RowdyBurns
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20364234
I get a syntax error here:

Too many commas

onload= "MM_preloadImages('images/LogoutBtnDOWN.gif',
'images/NewsHubBtnDOWN.gif',
'images/ProSearchBtnDOWN.gif',
'images/MyProfileBtnDOWN.gif',,,
'images/InfoBtnDOWN.gif',
'images/ChronicleHubBtnDOWN.gif',
'images/FreestyleChallComBtnDOWN.gif',
'images/ChronicleSearchBtnDOWN.gif',,
'images/ChallengeHubBtnDOWN.gif',
'images/MailHubBtnDOWN.gif',
'images/TrophyCabBtnDOWN.gif')"
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20364269
And on the second page, your menu is in a table... So most likely it is a CSS problem
0
 

Author Comment

by:RowdyBurns
ID: 20364338
I will amend the commas now to see if that works.
Here is the CSS the page references. Can you see anything obviously wrong with this?



div.sdmenu {
	width: 570px;
	font-family: Helvetica;
	font-size: 12px;
	padding-bottom: 10px;
	background: url(bottom.gif) no-repeat  right bottom;
	color: #ffffff;
}
div.sdmenu div {
	background: url(title.gif) repeat-x;
	overflow: hidden;
}
div.sdmenu div:first-child {
	background: url(toptitle.gif) no-repeat;
}
div.sdmenu div.collapsed {
	height: 25px;
}
div.sdmenu div span {
	display: block;
	padding: 5px 35px;
	font-style:italic;
	color: #027AC6;
	background: url(expanded.gif) no-repeat 10px center;
	cursor: default;
	border-bottom: 1px solid #ddd;
}
div.sdmenu div.collapsed span {
	background-image: url(collapsed.gif);
}
div.sdmenu div a {
	padding: 5px 10px;
	background: #ffffff;
	display: block;
	border-bottom: 1px solid #ddd;
	color: #666666;
}
div.sdmenu div a.current {
	background : #027AC6;
}
div.sdmenu div a:hover {
	background : #027AC6 url(linkarrow.gif) no-repeat right top;
	color: #fff;
	text-decoration: none;
}

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:RowdyBurns
ID: 20364454
I tried to remove the errors that you highlighted above but when I did so FF stopped working as well!!?
I have also tried to remove the nested table that contains the menu. This did not effect the functionality in either browser.

Any more suggestions?
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 20364611
Sorry.
Forget what I was mumbling about

You have a simple onLoad conflict

      // <![CDATA[
      var myMenu;
      window.onload = function() {
            myMenu = new SDMenu("my_menu");
            myMenu.init();
      };
      // ]]>

is conflicting with

if(window.addEventListener){window.addEventListener("load", preloadimgsrc, false);}
else{
      if(window.attachEvent){window.attachEvent("onload", preloadimgsrc);}
      else{if(document.getElementById){window.onload=preloadimgsrc;}}
}

from the oodomimagerollover.js

you can change



      // <![CDATA[
      var myMenu;
      window.onload = function() {
            myMenu = new SDMenu("my_menu");
            myMenu.init();
      };
      // ]]>

to add this just before the </body> (end body) tag:

<script type="text/javascript">
var myMenu = new SDMenu("my_menu");
myMenu.init();
</script>
0
 

Author Comment

by:RowdyBurns
ID: 20364635
Do you think I should re-post this as a CSS question?
0
 

Author Comment

by:RowdyBurns
ID: 20364639
Sorry I posted that before I got your response. I'll try your suggestion now....
0
 

Author Comment

by:RowdyBurns
ID: 20364662
BINGO!!! Well done, and thanks for spotting the conflict. Not knowing anything about Javascript I would never have solved it.
Have a good day.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20365029
You too :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question