473,382 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Menu Issues

Trying to do some updating and beyond frustrations with making it
compatibal with Mac's I am primarily done. Biggest problem I am having now
is with Opera not displaying the menu. works fine in IE, NS, and Firefox.
Due to the problem of having to have it target an iframe to update had to
write my own menu. Do not get any errors, simply will not display at all.
code of the menu and the css file is below. location of the html file is:
http://www.otts.com/index_beta.html

Expand|Select|Wrap|Line Numbers
  1. var g_build_totOffset = 0;    // Begining offset (from left) + counter for
  2. horizontal menus
  3. var g_sub_vis = "";
  4. var divMaster = "divMaster";
  5. var ie = document.all;
  6. var totTop = 0;
  7. var vertical = 1;
  8. var maxWidth = 165;
  9. var lastVisible = "";
  10. var visStack = new Array();
  11. // Initialize area
  12.  
  13. function mnu_init() {
  14. if (!document.getElementById("divMaster")) {
  15. var ceDiv = document.createElement('DIV');
  16. ceDiv.setAttribute("id", divMaster);
  17. document.getElementById("mnuLocation").appendChild(ceDiv);
  18. document.getElementById("divMaster").className = divMaster;
  19. document.getElementById("divMaster").style.top = 0+'px';
  20. document.getElementById("divMaster").style.left = 0+'px';
  21. document.getElementById("divMaster").style.height = 22+'px';
  22. }
  23. document.body.onclick = hideall;
  24. document.body.id = 'body';
  25. addMenu("Adhesives & Tapes", "AdhesivesTapes",0,"AdhesivesNTapes");
  26. addMenu("Airbrushes", "Airbrushes",0 ,"Airbrushes");
  27. addItem("Books", "Airbrushes", "Airbrush_Books",0 ,"", "AirbrushBooks");
  28. addItem("Paint", "Airbrushes", "Airbrush_Paint",0 ,"", "AirbrushPaint");
  29. addItem("Supplies", "Airbrushes", "Airbrush_Supplies",0 ,"",
  30. "AirbrushSupplies");
  31. addItem("Compressors", "Airbrushes", "Compressors",0 ,"", "Compressors");
  32. addItem("Parts", "Airbrushes", "Parts",0 ,"", "Parts");
  33. addMenu("Art Accessories", "ArtAccessories",0 , "Art_Accessories");
  34. addMenu("Books", "Books", 0, "Books");
  35. addMenu("Brushes", "Brushes", 0, "Brushes");
  36. addItem("Accessories", "Brushes", "Brushes_Accessories",0 ,""
  37. ,"BrushAccessories");
  38. addItem("Sets", "Brushes", "Brushes_Sets",0 ,"", "BrushSets");
  39. addMenu("Canvas", "Canvas", 0, "Canvas");
  40. addItem("Tools", "Canvas", "Canvas_CanvasTools",0 ,"", "CanvasTools");
  41. addItem("Panels", "Canvas", "Canvas_Panels",0 ,"", "Panels");
  42. addItem("Stretched", "Canvas", "Canvas_Stretched",0 ,"", "Stretched");
  43. addMenu("Clay", "Clay", 0, "Clay");
  44. addItem("Modelling Tools", "Clay", "Clay_Tools", 0, "", "ModellingTools");
  45. addMenu("Drafting", "Drafting", 0, "Drafting");
  46. addMenu("Easels", "Easels", 0, "Easels");
  47. addMenu("Lighting & Projectors", "LightingNProjectors", 0,
  48. "LightingNProjectors");
  49. addItem("Lightboxes", "LightingNProjectors", "LightingNProjectors_Tools",
  50. 0, "", "Lightboxes");
  51. addMenu("Mat Cutters", "MatCutters", 0, "MatCutters");
  52. addMenu("Palettes & Accessories", "PalettesNAccessories", 0,
  53. "PalettesNAccessories");
  54. addItem("Mixing Trays", "PalettesNAccessories",
  55. "PalettesNAccessories_MixingTrays", 0, "", "MixingTrays");
  56. addItem("Pallette Knives", "PalettesNAccessories",
  57. "PalettesNAccessories_PalletteKnives", 0, "", "PalletteKnives");
  58. addMenu("Painting", "Painting", 0, "");
  59. addItem("Acrylic", "Painting", "PaintingAcrylic", 0, "", "Acrylic");
  60. addItem("Accessories", "Painting_PaintingAcrylic", "AcrylicAccessories",
  61. 1, "", "AcrylicAccessories");
  62. addItem("Books", "Painting_PaintingAcrylic", "AcrylicBooks", 0, "",
  63. "AcrylicBooks");
  64. addItem("Mediums", "Painting_PaintingAcrylic", "AcrylicMediums", 0, "",
  65. "AcrylicMediums");
  66. addItem("Paint-Basics", "Painting_PaintingAcrylic", "AcrylicPaintBasics",
  67. 0, "", "Basics");
  68. addItem("Paint-Concentrated", "Painting_PaintingAcrylic",
  69. "AcrylicPaintConcentrated", 0, "", "Concentrated");
  70. addItem("Paint-Glossies", "Painting_PaintingAcrylic",
  71. "AcrylicPaintGlossies", 0, "", "Glossies");
  72. addItem("Acrylic_Sets", "Painting_PaintingAcrylic", "AcrylicSets", 0, "",
  73. "AcrylicSets");
  74. addItem("Oil", "Painting", "PaintingOil", 0, "", "Oil");
  75. addItem("Accessories", "Painting_PaintingOil", "Oil_Accessories", 0, "",
  76. "OilAccessories");
  77. addItem("Books", "Painting_PaintingOil", "Oil_Books", 0, "", "OilBooks");
  78. addItem("Mediums", "Painting_PaintingOil", "Oil_Mediums", 0, "",
  79. "OilMediums");
  80. addItem("Sets", "Painting_PaintingOil", "Oil_Sets", 0, "", "OilSets");
  81. addItem("Paint", "Painting_PaintingOil", "Oil_Paint", 0, "", "OilPaint");
  82. addItem("Watercolor", "Painting", "PaintingWatercolor", 0, "",
  83. "Watercolor");
  84. addItem("Accessories", "Painting_PaintingWatercolor",
  85. "Watercolor_WatercolorAccessories", 0, "", "WatercolorAccessories");
  86. addItem("Books", "Painting_PaintingWatercolor",
  87. "Watercolor_WatercolorBooks", 0, "", "WatercolorBooks");
  88. addItem("Mediums", "Painting_PaintingWatercolor",
  89. "Watercolor_WatercolorMediums", 0, "", "WatercolorMediums");
  90. addItem("Sets", "Painting_PaintingWatercolor",
  91. "Watercolor_WatercolorSets", 0, "", "WatercolorSets");
  92. addItem("Paint", "Painting_PaintingWatercolor",
  93. "Watercolor_WatercolorPaint", 0, "", "WatercolorPaint");
  94. addItem("Method Painting", "Painting", "MethodPainting", 0, "",
  95. "MethodPainting");
  96. addItem("Art Kits", "Painting", "ArtKits", 0, "", "ArtKits");
  97. addMenu("Paper", "Paper", 0, "Paper");
  98. addItem("Bristol", "Paper", "Paper_Bristol", 0, "", "Bristol");
  99. addItem("Charcoal Media", "Paper", "Paper_CharcoalMedia", 0, "",
  100. "CharcoalMedia");
  101. addItem("Illustration", "Paper", "Paper_Illustration", 0, "",
  102. "Illustration");
  103. addItem("Mylar", "Paper", "Paper_Mylar", 0, "", "Mylar");
  104. addItem("Newsprint", "Paper", "Paper_Newsprint", 0, "", "Newsprint");
  105. addItem("Origami", "Paper", "Paper_Origami", 0, "", "Origami");
  106. addItem("Pastel Media", "Paper", "Paper_PastelMedia", 0, "",
  107. "PastelMedia");
  108. addItem("Sketching", "Paper", "Paper_Sketching", 0, "", "Sketching");
  109. addItem("Tracing", "Paper", "Paper_Tracing", 0, "", "Tracing");
  110. addItem("Watercolor Media", "Paper", "Paper_WatercolorMedia", 0, "",
  111. "WatercolorMedia");
  112. addItem("Drawing", "Paper", "Paper_Drawing", 0, "", "Drawing");
  113. addMenu("Storage & Presentation", "StorageNPresentation", 0,
  114. "StorageNPresentation");
  115. addItem("Storage Boxes", "StorageNPresentation",
  116. "StorageNPresentation_StorageBoxes", 0, "", "StorageBoxes");
  117. addItem("Portfolios", "StorageNPresentation",
  118. "StorageNPresentation_Portfolios", 0, "", "Portfolios");
  119. addMenu("Tools", "Tools", 0, "Tools");
  120. addItem("X-acto", "Tools", "Tools_acto", 0, "", "Xacto");
  121. addMenu("Writing", "Writing", 0, "Writing");
  122. addItem("Calligraphy", "Writing", "Writing_Calligraphy", 0, "",
  123. "Calligraphy");
  124. addItem("Charcoal", "Writing", "Writing_Charcoal", 0, "", "Charcoal");
  125. addItem("Erasers", "Writing", "Writing_Erasers", 0, "", "Erasers");
  126. addItem("Ink", "Writing", "Writing_Ink", 0, "", "Ink");
  127. addItem("Markers", "Writing", "Writing_Markers", 0, "", "Markers");
  128. addItem("Pastels", "Writing", "Writing_Pastels", 0, "", "Pastels");
  129. addItem("Pencils", "Writing", "Writing_Pencils", 0, "", "Pencils");
  130. addItem("Pens", "Writing", "Writing_Pens", 0, "", "Pens");
  131. addItem("Writing Accessories", "Writing", "Writing_WritingAccessories", 0,
  132. "", "WritingAccessories");
  133. addItem("Block Printing", "Writing", "Writing_BlockPrinting", 0, "",
  134. "BlockPrinting");
  135. }
  136.  
  137. function docmd(cmd){
  138. if (cmd!=null) { eval(cmd); return true; } else { return false;}
  139. }
  140.  
  141. function load() {
  142. document.getElementById('divError').innerHTML = "document loaded";
  143. }
  144.  
  145. function hideall() {
  146. for (n=0; n<=visStack.length; n++) {
  147. tmpStr = visStack.pop();
  148. if (tmpStr) {
  149. document.getElementById(tmpStr).style.visibility = 'hidden';
  150. }
  151. }
  152. }
  153.  
  154. function addMenu(mnuText, strMenuTxt, bDisabled, CiD) {
  155. this.mnuBarObj = "mnu" + strMenuTxt;
  156. this.strMenuTxt = strMenuTxt;
  157.  
  158. var ceDiv = document.createElement('DIV');
  159. var ceA = document.createElement('a');
  160. var ceFONT1 = document.createElement('FONT');
  161. var ceFONT2 = document.createElement('FONT');
  162.  
  163. objRef = strMenuTxt;
  164. mnuBarObj = "mnu" + strMenuTxt;
  165. mnuAObj = "mnuA" + strMenuTxt;
  166. divObj = "div" + strMenuTxt;
  167. tmpStr = "";
  168.  
  169. sT1 = document.createTextNode(mnuText);
  170. sT2 = document.createTextNode(mnuText);
  171. ceFONT1.appendChild(sT1);
  172. ceFONT1.setAttribute("id", mnuBarObj + "B");
  173. ceFONT1.setAttribute("class", "mnuBackTextNorm");
  174. ceFONT1.setAttribute("size", 2);
  175. ceFONT2.appendChild(sT2);
  176. ceFONT2.setAttribute("id", mnuBarObj);
  177. ceFONT2.setAttribute("class", "mnuForeTextNorm");
  178. ceFONT2.setAttribute("size", 2);
  179. ceA.appendChild(ceFONT1); ceA.appendChild(ceFONT2);
  180. ceA.setAttribute("id", mnuAObj);
  181. ceA.setAttribute("itmSub", "0");
  182. ceA.setAttribute("CiD", CiD);
  183. ceDiv.appendChild(ceA);
  184. ceDiv.setAttribute("id", divObj);
  185. ceDiv.setAttribute("class", "mnuDiv");
  186. ceDiv.setAttribute("align", "left");
  187. ceDiv.setAttribute("itmSub", "0");
  188. ceDiv.setAttribute("CiD", CiD);
  189.  
  190. document.getElementById(divMaster).appendChild(ceDiv);
  191. document.getElementById(mnuBarObj + "B").className = "mnuBackTextNorm";
  192. document.getElementById(mnuBarObj).className = "mnuForeTextNorm";
  193. document.getElementById(mnuBarObj).bDisabled = 0;
  194. document.getElementById(divObj).CiD = CiD;
  195. if (bDisabled) {
  196. document.getElementById(mnuBarObj + "B").className = "mnuBackTextDisab";
  197. document.getElementById(mnuBarObj).className = "mnuForeTextDisab";
  198. document.getElementById(mnuBarObj).bDisabled = 1;
  199. }
  200. if (ie) {
  201. document.getElementById(mnuBarObj).style.left = g_build_totOffset;
  202. document.getElementById(mnuBarObj + "B").style.left = g_build_totOffset;
  203. } else {
  204. document.getElementById(divObj).style.left = g_build_totOffset;
  205. }
  206. if (vertical) {
  207. if (ie) { // vertical
  208. document.getElementById(mnuBarObj).style.left = 0;
  209. document.getElementById(mnuBarObj + "B").style.left = 0;
  210. document.getElementById(mnuBarObj).style.top = totTop;
  211. document.getElementById('divMaster').style.height = totTop + 18;
  212. document.getElementById('divMaster').style.width = maxWidth;
  213. } else {
  214. document.getElementById(divObj).style.left = 0;
  215. document.getElementById(mnuBarObj + "B").style.left = 0;
  216. document.getElementById(divObj).style.top = totTop;
  217. document.getElementById('divMaster').style.height = totTop + 18;
  218. document.getElementById('divMaster').style.width = maxWidth;
  219. }
  220. } else { // horizontal (untested)
  221. if (ie) {
  222. document.getElementById(mnuBarObj).style.left = g_build_totOffset;
  223. document.getElementById(mnuBarObj + "B").style.left = g_build_totOffset;
  224. document.getElementById(mnuBarObj).style.top = totTop;
  225. } else {
  226. document.getElementById(divObj).style.top = 0;
  227. document.getElementById(divObj).style.left = g_build_totOffset;
  228. }
  229. }
  230. document.getElementById(mnuAObj).onmouseover = mnuMouseOver;
  231. document.getElementById(mnuAObj).onmouseout = mnuMouseOut;
  232. document.getElementById(mnuAObj).onmousedown = mnuSelect;
  233. document.getElementById(mnuAObj).onclick = mnuClick;
  234. g_build_totOffset += document.getElementById(mnuBarObj).offsetWidth;
  235. totTop += parseInt(document.getElementById(mnuBarObj).offsetHeight);
  236. }
  237.  
  238. function addItem(mnuText, mnu, itm, bDisabled, itmDo, CiD) {
  239. var subMnu = "sub" + mnu;
  240. var mnuItm = "mnu"+mnu+"_"+itm;
  241. var mnuAObj = "mnA"+mnu+"_"+itm;
  242. var divItm = "div"+mnu+"_"+itm;
  243. if (!(!document.getElementById("sub" + mnu))) {
  244. var refMnu = "sub" + mnu;
  245. } else {
  246. var refMnu = "mnu" + mnu;
  247. var refSub = "sub" + mnu;
  248. var refDiv = "div" + mnu;
  249. }
  250. tst01 = 1;
  251. if (!document.getElementById(subMnu)) {
  252. tst01 = 0;
  253. var ceDiv = document.createElement('DIV');
  254. ceDiv.setAttribute("id", subMnu);
  255. ceDiv.setAttribute("class", "subDiv");
  256. ceDiv.setAttribute("align", "left");
  257. document.body.appendChild(ceDiv);
  258. document.getElementById(subMnu).className = "subDiv";
  259. document.getElementById(refMnu).itmSub = "1";
  260. document.getElementById(refMnu).subName = subMnu;
  261. document.getElementById(refMnu).CiD = CiD;
  262. document.getElementById(refMnu).parrentName = refMnu;
  263. var re = /_/i;            //Create regular expression pattern.
  264. var widthadd = 0;
  265. var topadd = 0;
  266. if (subMnu.search(re)>0) {
  267. t = subMnu.search(re)
  268. widthadd = parseInt(document.getElementById(subMnu).offsetWidth);
  269. if (ie) {
  270. topadd =  document.getElementById(subMnu.substr(0, t)).offsetTop  +
  271. document.getElementById(subMnu.substr(0, t)).offsetHeight - 15;
  272. } else {
  273. topadd =  document.getElementById(subMnu.substr(0, t)).offsetTop  +
  274. document.getElementById(subMnu.substr(0, t)).offsetHeight - 15;
  275. }
  276. }
  277. if (vertical) {  // Vertical
  278. if (topadd) {
  279. document.getElementById(subMnu).style.top = topadd;
  280. } else {
  281. if (ie) {
  282. document.getElementById(subMnu).style.top =
  283. parseInt(document.getElementById(refMnu).offsetTop) +
  284. parseInt(document.getElementById("divMaster").offsetTop);
  285. } else {
  286. document.getElementById(subMnu).style.top =
  287. parseInt(document.getElementById(refDiv).offsetTop) +
  288. parseInt(document.getElementById("divMaster").offsetTop);
  289. }
  290. }
  291. document.getElementById(subMnu).style.left = widthadd +
  292. parseInt(document.getElementById("divMaster").offsetWidth)+parseInt(document
  293. ..getElementById(refMnu).offsetLeft)+parseInt(document.getElementById("divMas
  294. ter").offsetLeft)+'px';
  295. document.getElementById(subMnu).style.height = 0+'px';
  296. } else { // Horizontal (untested)
  297. document.getElementById(subMnu).style.top =
  298. parseInt(document.getElementById("divMaster").style.height)+parseInt(documen
  299. t.getElementById("divMaster").offsetTop)+'px';
  300. document.getElementById(subMnu).style.left =
  301. parseInt(document.getElementById(refMnu).offsetLeft)+parseInt(document.getEl
  302. ementById("divMaster").offsetLeft)+'px';
  303. document.getElementById(subMnu).style.height = 0+'px';
  304. }
  305. }
  306. var ceA = document.createElement('a');
  307. var ceFONT1 = document.createElement('FONT');
  308. var ceFONT2 = document.createElement('FONT');
  309. var ceDiv = document.createElement('DIV');
  310. sT1 = document.createTextNode(mnuText);
  311. sT2 = document.createTextNode(mnuText);
  312. ceFONT1.appendChild(sT1);
  313. ceFONT1.setAttribute("id", mnuItm + "B");
  314. ceFONT2.appendChild(sT2);
  315. ceFONT2.setAttribute("id", mnuItm);
  316. ceFONT2.setAttribute("class", "mnuForeTextNorm");
  317. ceA.appendChild(ceFONT1); ceA.appendChild(ceFONT2);
  318. ceA.setAttribute("id", mnuAObj);
  319. ceA.setAttribute("itmDo", itmDo);
  320. ceA.setAttribute("itmSub", "0");
  321. ceDiv.setAttribute("id", divItm);
  322. ceDiv.setAttribute("className", "itmDiv");
  323. ceDiv.appendChild(ceA);
  324. document.getElementById(subMnu).appendChild(ceDiv);
  325. document.getElementById(mnuAObj).itmDo = itmDo;
  326. document.getElementById(divItm).className = "itmDiv";
  327. document.getElementById(mnuItm + "B").className = "mnuBackTextNorm";
  328. document.getElementById(mnuItm).className = "mnuForeTextNorm";
  329. document.getElementById(mnuItm).bDisabled = 0;
  330. document.getElementById(mnuItm).CiD = CiD;
  331. document.getElementById(subMnu).style.height =
  332. (parseInt(document.getElementById(mnuItm).offsetHeight) - 0) +
  333. parseInt(document.getElementById(subMnu).style.height) + 'px';
  334. if (bDisabled) {
  335. document.getElementById(mnuItm + "B").className = "mnuBackTextDisab";
  336. document.getElementById(mnuItm).className = "mnuForeTextDisab";
  337. document.getElementById(mnuItm).bDisabled = 1;
  338. }
  339. document.getElementById(mnuItm).onmouseover = mnuMouseOver;
  340. document.getElementById(mnuItm).onmouseout = mnuMouseOut;
  341. document.getElementById(mnuItm).onmousedown = mnuSelect;
  342. document.getElementById(mnuItm).onclick = mnuClick;
  343. }
  344.  
  345. function mnuMouseOver(e) {
  346. targid = "";
  347. if (ie) { targid = window.event.toElement.id; } else { targid =
  348. e.target.id; }
  349. if (targid.slice(-1) == "B") { return false; }
  350. var re = /_/i;            //Create regular expression pattern.
  351.  
  352. if (targid.search(re)>0) {              // Item is a submenu
  353. if (document.getElementById(targid).bDisabled) {        // Item is
  354. disabled
  355. if (targid.slice(0, 3) == "mnu") {           // Double check mouse event
  356. ID
  357. document.getElementById(targid).className = "mnuForeTextDisabItmMsOvr";
  358. } else { return false; }            // was not proper ID, throw out.
  359. } else {                 // Item is not disabled
  360. if (targid.slice(0, 3) == "mnu") {           // Double check mouse event
  361. ID
  362. document.getElementById(targid).className = "mnuForeTextNormItmMsOvr";
  363. if (document.getElementById(targid).itmSub == '1') {     // If item has
  364. a sub, open it.
  365. hideall();
  366. pname = targid.substr(0, targid.search(re));      // get parent
  367. pname = "sub" + pname.substr(3);         // refine parent name
  368.  
  369. document.getElementById(document.getElementById(targid).subName).style.visib
  370. ility = 'visible'; // get name of sub.
  371. document.getElementById(pname).style.visibility = 'visible';
  372. visStack.push(pname);
  373. visStack.push(document.getElementById(targid).subName);
  374. lastVisible = document.getElementById(targid).subName;
  375. }
  376. } else { return false; }            // was not proper ID, throw out.
  377. }
  378. } else {
  379. if (document.getElementById(targid).bDisabled) {
  380. if (targid.slice(0, 3) == "mnu") {
  381. document.getElementById(targid).className = "mnuForeTextDisabMsOvr";
  382. document.getElementById('divError').innerHTML =
  383. document.getElementById(targid).itmSub
  384. } else { return false; }
  385. } else {
  386. if (targid.slice(0, 3) == "mnu") {
  387. document.getElementById(targid).className = "mnuForeTextNormMsOvr";
  388. if (document.getElementById(targid).itmSub == '1') {
  389. hideall();
  390. if (lastVisible != "") {
  391. document.getElementById(lastVisible).style.visibility = 'hidden'; }
  392.  
  393. document.getElementById(document.getElementById(targid).subName).style.visib
  394. ility = 'visible';
  395. if (ie) { // menu displaying offscreen if list is too long, correct it
  396. if needed.
  397. tmpInt = parseInt(document.getElementById(targid).offsetTop) +
  398. parseInt(document.getElementById(document.getElementById(targid).subName).st
  399. yle.height)
  400. tmpInt2 = parseInt(document.getElementById('dispMain').offsetHeight)
  401. if (tmpInt > tmpInt2) {
  402. tmpInt3 = tmpInt2 - tmpInt;
  403. tmpInt = parseInt(document.getElementById(targid).offsetTop) +
  404. tmpInt3;
  405. } else {
  406. tmpInt = parseInt(document.getElementById(targid).offsetTop);
  407. }
  408.  
  409. document.getElementById(document.getElementById(targid).subName).style.top =
  410. parseInt(document.getElementById('divMaster').offsetTop) + tmpInt + 'px';
  411. } else {
  412. divId = 'div' + targid.substr(3)
  413. tmpInt = parseInt(document.getElementById(divId).offsetTop) +
  414. parseInt(document.getElementById(document.getElementById(targid).subName).st
  415. yle.height)
  416. tmpInt2 = parseInt(document.getElementById('dispMain').offsetHeight)
  417. if (tmpInt > tmpInt2) {
  418. tmpInt3 = tmpInt2 - tmpInt;
  419. tmpInt = parseInt(document.getElementById(divId).offsetTop) + tmpInt3;
  420. } else {
  421. tmpInt = parseInt(document.getElementById(divId).offsetTop);
  422. }
  423.  
  424. document.getElementById(document.getElementById(targid).subName).style.top =
  425. parseInt(document.getElementById('divMaster').offsetTop) + tmpInt + 'px';
  426. }
  427. visStack.push(document.getElementById(targid).subName);
  428. lastVisible = document.getElementById(targid).subName;
  429. } else { hideall(); }
  430. } else { return false; }
  431. }
  432. }
  433. }
  434.  
  435. function mnuMouseOut(e) {
  436. targid = "";
  437. if (ie) { targid = window.event.fromElement.id; } else { targid =
  438. e.target.id; }
  439. if (targid.slice(-1) == "B") { return false; }
  440. if (document.getElementById(targid).bDisabled) {
  441. if (targid.slice(0, 3) == "mnu") {
  442. document.getElementById(targid).className = "mnuForeTextDisab"
  443. } else { return false; }
  444. } else {
  445. if (targid.slice(0, 3) == "mnu") {
  446. document.getElementById(targid).className = "mnuForeTextNorm"
  447. } else { return false; }
  448. }
  449. }
  450.  
  451. function mnuSelect() { return false; }
  452.  
  453. function mnuClick(e) {
  454. targid = "";
  455. msClick(4);
  456. if (ie) { targid = window.event.srcElement.id; } else { targid =
  457. e.target.id; }  // evaluate for IE or NS
  458. if (targid.slice(-1) == "B") { return false; }          // managed to click
  459. on the 1px behind font, throw out.
  460. if (document.getElementById(targid).bDisabled) { return false; }     //
  461. item disabled, throw out.
  462. var re = /_/i;                   //Create regular expression pattern.
  463. if (targid.search(re)>0) {
  464. mnu = targid.slice(3);
  465. var subMnu = "mnA" + mnu;
  466. var subMnu1 = "mnu" + mnu;
  467. tmpStr = targid.substr(targid.search(re) + 1);
  468. document.getElementById('dispMain').src =
  469. "http://www.otts.com/cid.php?code=" + document.getElementById(subMnu1).CiD;
  470. } else { // Hit main menu
  471. mnu = targid.slice(3);
  472. var subMnu = "sub" + mnu;
  473. var divMnu = "div" + mnu;
  474. document.getElementById('dispMain').src =
  475. "http://www.otts.com/cid.php?code=" + document.getElementById(divMnu).CiD;
  476. }
  477. }
  478.  
  479. function mnuHide(e) {
  480. targid = "";
  481. if (ie) { targid = window.event.srcElement.id; } else { targid =
  482. e.target.id; } // evaluate for IE or NS
  483. if (targid.slice(0, 3) != "mnu") {
  484. if (g_sub_vis != "") {
  485. document.getElementById(g_sub_vis).style.visibility = "hidden";
  486. g_sub_vis = "";
  487. }
  488. }
  489. return true;
  490. }
  491.  
  492.  
  493. //--------------------------------------------------------------------------
  494. ---------------------------------------
  495. Delim = "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  496. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;";
  497. sNews = "An amazing selection of art supplies at up to 75% off. <font
  498. face='Wingdings'>(</font>(800) 356-3289" + Delim;
  499. sNews += "☼ Same Day Shipping Avalible!" + Delim;
  500. sNews += "☼ Outstanding Customer Service!" + Delim;
  501. sNews += "☼ Huge Selection of Products!" + Delim;
  502. sNews += "<font face='webdings'>&#0254</font> Visit our Toys & Hobbies
  503. website: <a href='http://www.hungates.com'>http://www.hungates.com!</a>
  504. <font face='webdings'>&#0253</font>" + Delim;
  505. sNews += "Come back often! We are constantly changing our special offers." +
  506. Delim;
  507. sNews += "Pages are Optimized for Internet Explorer 6.0 or Netscape 7.1.
  508. Minimum recommended screen size: 800x600" + Delim;
  509. sNews +=  Delim;
  510.  
  511. ts = new Array(0, 0, 0, 0, 0, 0, 0);
  512. tmnu = new Array(0, 1, 0, 0, 0, 0, 0);
  513. omnu = new Array("", "mnuHome", "mnuAbout", "mnuSpecials", "mnuStore",
  514. "mnuFAQ", "mnuContact");
  515. smnu = new Array("", "home.html", "about.html", "specials.html", "",
  516. "faq.html", "contact.html");
  517. lastopen = 0; curopen = 1; var msNum = 0;
  518.  
  519. function msOver(num) {
  520. msNum = num;
  521. if (!ts[num]){
  522. document.getElementById("mnuHigh").style.top =
  523. parseInt(document.getElementById(omnu[num]).style.top) + 0 + "px";
  524. document.getElementById("mnuHigh").style.left =
  525. parseInt(document.getElementById(omnu[num]).style.left) + 5 + "px";
  526. }
  527. }
  528.  
  529. function msOut() {
  530. msNum = 0;
  531. document.getElementById("mnuHigh").style.top ="30px";
  532. }
  533.  
  534. function msClick(num) {
  535. num = parseInt(num);
  536. if (tmnu[num]) { return false }   // this menu is already open, opt out.
  537. lastopen = curopen; curopen = num;
  538. tmnu[lastopen] = 0; tmnu[curopen] = 1;
  539. if (ts[curopen] == 0) {
  540. ts[curopen] = window.setTimeout("mvUp('" + omnu[curopen] + "', '" +
  541. curopen + "');", 10);
  542. ts[lastopen] = window.setTimeout("mvDown('" + omnu[lastopen] + "', '" +
  543. lastopen + "');", 10);
  544. document.getElementById('dispMain').src = smnu[curopen];
  545. cartclick('list');
  546. document.getElementById('cart2').checked = "true";
  547. }
  548. }
  549.  
  550. function mvDown(obj, num) {
  551. y = document.getElementById(obj).style.top; y = parseInt(y) + 1;
  552. if (y <= 10) {
  553. document.getElementById(obj).style.top = y + 'px';
  554. if ((msNum) && (msNum==num)) {
  555. document.getElementById("mnuHigh").style.top = y + 'px';
  556. document.getElementById("mnuHigh").style.left =
  557. parseInt(document.getElementById(omnu[num]).style.left) + 5 + "px";
  558. }
  559. ts[num] = window.setTimeout("mvDown('" + obj + "', '" + num + "');", 10)
  560. } else {
  561. ts[num]=0; return true;
  562. }
  563. }
  564.  
  565. function mvUp(obj, num) {
  566. y = document.getElementById(obj).style.top; y = parseInt(y) - 1;
  567. if (y >= 0) {
  568. document.getElementById(obj).style.top = y + 'px';
  569. if ((msNum) && (msNum==num)) {
  570. document.getElementById("mnuHigh").style.top = y + 'px';
  571. document.getElementById("mnuHigh").style.left =
  572. parseInt(document.getElementById(omnu[num]).style.left) + 5 + "px";
  573. }
  574. ts[num] = window.setTimeout("mvUp('" + obj + "', '" + num + "');", 10)
  575. } else {
  576. ts[num]=0; return true;
  577. }
  578. }
  579.  
  580. function init() {
  581. document.getElementById("newsHtm").innerHTML = sNews;
  582. document.getElementById("newsHtm").loop = "-1";
  583. window.setTimeout("popdown1();", 1000);
  584. if (document.all) {
  585. document.getElementById('dispMain').height =
  586. parseInt(document.body.clientHeight) - 57;
  587. document.getElementById('dispBask').style.top =
  588. document.getElementById('dispMain').offsetTop;
  589. document.getElementById('dispBask').style.left =
  590. document.getElementById('dispMain').offsetLeft;
  591. document.getElementById('dispBask').height =
  592. parseInt(document.body.clientHeight) - 57;
  593. document.getElementById('dispBask').style.visibility = "hidden";
  594. } else {
  595. document.getElementById('dispMain').height
  596. =parseInt(document.body.clientHeight) - 57;
  597. document.getElementById('dispBask').style.top =
  598. document.getElementById('dispMain').offsetTop;
  599. document.getElementById('dispBask').style.left =
  600. document.getElementById('dispMain').offsetLeft;
  601. document.getElementById('dispBask').style.height =
  602. parseInt(document.body.clientHeight) - 57;
  603. document.getElementById('dispBask').style.visibility = "hidden";
  604. }
  605. }
  606.  
  607. function doNews() {
  608. document.getElementById("newsHtm").start();
  609. document.getElementById("divTest").innerHTML = "hit!";
  610. }
  611. function normNews() {
  612. document.getElementById("newsHtm").scrollDelay = 10;
  613. document.getElementById("newsHtm").scrollAmount = 3;
  614. }
  615.  
  616. function slowNews() {
  617. document.getElementById("newsHtm").scrollDelay = 50;
  618. document.getElementById("newsHtm").scrollAmount = 1;
  619. }
  620.  
  621. function popdown1() {
  622. window.setTimeout("popdownGo('popdown1', 0, 5, 175)", 50);
  623. }
  624. popagain=1;
  625. function popdownGo(obj, curY, dir, end) {
  626. curY = curY + dir;
  627. if (curY == end) {
  628. document.getElementById(obj).style.clip = "rect(0 230px "+curY+"px 0)";
  629. if (popagain) {
  630. popagain=0;
  631. dir = dir * -1;
  632. window.setTimeout("popdownGo('" + obj + "'," + curY + "," + dir + "," + 0
  633. + ")", 20000);
  634. }
  635. return false;
  636. } else {
  637. document.getElementById(obj).style.clip = "rect(0 230px "+curY+"px 0)";
  638. window.setTimeout("popdownGo('" + obj + "'," + curY + "," + dir + "," +
  639. end + ")", 50);
  640. }
  641. }
  642.  
  643. function doBasket() {
  644. window.setTimeout('document.getElementById("dispBask").src =
  645. "http://www.otts.com/bask.php"', 2500);
  646. }
  647.  
  648. function cartclick(obj) {
  649. if (obj == 'list') {
  650. document.getElementById("dispMain").style.visibility = 'visible';
  651. document.getElementById("dispBask").style.visibility =  'hidden';
  652. }
  653. if (obj == 'view') {
  654. document.getElementById("dispMain").style.visibility = 'hidden';
  655. document.getElementById("dispBask").style.visibility =  'visible';
  656. document.getElementById("dispBask").src = "http://www.otts.com/bask.php"
  657. }
  658. }
  659.  
[css]
A {
text-decoration: none;
}
..mnuForeTextNorm {
font-family: sans-serif;
font-strech: normal;
border: #c0c0c0 1px solid;
color: #000000;
position: absolute;
z-index: 1025;
top: 0px;
left: 0px;
height: 18px;
width: 165px;
}
..mnuBackTextNorm {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
BORDER: #c0c0c0 1px solid;
color: #c0c0c0;
POSITION: absolute;
z-index: 1015;
top: 1px;
left: 1px;
height: 18px;
width: 165px;
}
..mnuForeTextDisab {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
BORDER: #c0c0c0 1px solid;
color: #505050;
POSITION: absolute;
top: 0px;
left: 0px;
z-index: 1025;
height: 18px;
width: 165px;
}
..mnuBackTextDisab {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
BORDER: #c0c0c0 1px solid;
color: #FFFFFF;
POSITION: absolute;
z-index: 1015;
top: 1px;
left: 1px;
height: 18px;
width: 165px;
}
..mnuForeTextNormMsOvr {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
BORDER: #c0c0c0 1px solid;
color: #FFFFFF;
BACKGROUND-COLOR: #003399;
POSITION: absolute;
z-index: 1025;
top: 0px;
left: 0px;
height: 18px;
width: 165px;
cursor: hand;
}
..mnuForeTextDisabMsOvr {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
BORDER: #c0c0c0 1px solid;
color: #505050;
BACKGROUND-COLOR: #003399;
POSITION: absolute;
top: 0px;
left: 0px;
z-index: 1025;
height: 18px;
width: 165px;
cursor: hand;
}
..mnuForeTextNormItmMsOvr {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
BORDER: #c0c0c0 1px solid;
color: #FFFFFF;
BACKGROUND-COLOR: #003399;
POSITION: absolute;
z-index: 1025;
top: 0px;
left: 0px;
height: 18px;
width: 165px;
cursor: hand;
}
..mnuForeTextDisabItmMsOvr {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
BORDER: #c0c0c0 1px solid;
COLOR: #505050;
BACKGROUND-COLOR: #003399;
POSITION: absolute;
top: 0px;
left: 0px;
z-index: 1025;
height: 18px;
width: 165px;
cursor: hand;
}

..mnuDiv {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
position: absolute;
background-color: #c0c0c0;
top: 0px;
left: 0px;
width: 165px;
height: 18px;
overflow: hidden;
z-Index: 1011;
}
..mnuDivMsOvr {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
POSITION: absolute;
BACKGROUND-COLOR: #003399;
top: 0px;
left: 0px;
width: 165px;
height: 18px;
overflow: hidden;
z-Index: 1011;
}
..subDiv {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
POSITION: absolute;
BACKGROUND-COLOR: #c0c0c0;
BORDER: 1px #000000 solid;
top: 0px;
left: 0px;
width: 165px;
height: 18px;
overflow: hidden;
visibility: hidden;
z-Index: 10100;
}
..itmDiv {
FONT-FAMILY: sans-serif;
FONT-STRECH: normal;
POSITION: relative;
BACKGROUND-COLOR: #c0c0c0;
BORDER: 0px #000000 solid;
top: 0px;
left: 0px;
width: 165px;
height: 18px;
overflow: hidden;
z-Index: 10100;
}
..divMaster {
position: relative;
width: 175px;
height: 200px;
top: 0px;
left: 0px;
BACKGROUND-COLOR: #C0C0C0;
BORDER: #c0c0c0 1px solid;
z-Index: 1010;
}
[/css]

--
Matthew Hagston
Hungates Creative Toys and Hobbies
ma************@hungates.com ........ http://www.hungates.com
Jul 23 '05 #1
13 2024
Matthew Hagston wrote:
Trying to do some updating and beyond frustrations with making it
compatibal with Mac's I am primarily done. Biggest problem I am having now
[snip] ceDiv.setAttribute("id", divMaster);


You're right, the centre part doesn't work in Safari. I got as far as
the above line, which should be:

ceDiv.setAttribute("id", "divMaster");

Note extra set of double quotes.

Fred.
Jul 23 '05 #2
On Wed, 27 Oct 2004 19:21:16 +1000, Fred Oz <oz****@iinet.net.auau> wrote:
Matthew Hagston wrote:
ceDiv.setAttribute("id", divMaster);
You're right, the centre part doesn't work in Safari. I got as
far as the above line, which should be:

ceDiv.setAttribute("id", "divMaster");


Really, it should be:

ceDiv.id = divMaster;

(Note to Fred: divMaster is a variable with the value, 'divMaster')

The setAttribute method should be reserved for XML documents. HTML
documents are given properties for convenience, so use them. I also
believe that IE has problems with setAttribute, though I don't know the
specifics.

From the original post:
document.getElementById("divMaster").className = divMaster;
document.getElementById("divMaster").style.top = 0+'px';
document.getElementById("divMaster").style.left = 0+'px';
document.getElementById("divMaster").style.height = 22+'px';


These would also be better written as:

ceDiv.className = divMaster;
ceDiv.style.top = '0px';
ceDiv.style.left = '0px';
ceDiv.style.height = '22px';

As a parting comment, I'm afraid to say I think that script is horrific.
No feature detection, use of object inference, no possibility of graceful
degradation, the use of FONT in the 21st century, and general inefficiency.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3
Michael Winter wrote:
[snip]

(Note to Fred: divMaster is a variable with the value, 'divMaster')
Yup - I got confused 'cos I was testing code snippets and the OP
switched between the variable divMaster and the string "divMaster".

I can't see the point of making a variable name identical to the string
it contains - but that's no excuse for my error. Further, why use this
variable maybe three times, and use the identical string 17 times?

[snip] As a parting comment, I'm afraid to say I think that script is
horrific. No feature detection, use of object inference, no possibility
of graceful degradation, the use of FONT in the 21st century, and
general inefficiency.


To which could be added no attempt to isolate the errors and present a
concise example.

Anyhow, I ran the page through the w3c HTML validator. It barfed at
line 69 because of the MARQUEE tag - it is not part of the HTML
specification:

"Task: Do not create scrolling text with the marquee element.

...

The marquee element is not part of the HTML specification. Use
@@EcmaScript if you must have scrolling text."

Also, running a cursor over the dynamic menus pretty quickly fills the
console with "(event handler):Undefined value" errors in Safari.
Cheers, Fred.
Jul 23 '05 #4
On Wed, 27 Oct 2004 21:48:44 +1000, Fred Oz <oz****@iinet.net.auau> wrote:
Michael Winter wrote:
(Note to Fred: divMaster is a variable with the value, 'divMaster')
Yup - I got confused 'cos I was testing code snippets and the OP
switched between the variable divMaster and the string
"divMaster".


I didn't see it originally, either.
[...] Further, why use this variable maybe three times, and use
the identical string 17 times?
[guess]
Perhaps an (abortive) attempt to make the script reusable by making the
container name variable?
[/guess]
As a parting comment, I'm afraid to say I think that script is
horrific. No feature detection, use of object inference, no possibility
of graceful degradation, the use of FONT in the 21st century, and
general inefficiency.


To the OP: I would like to point out that I didn't enjoying writing that
paragraph.
To which could be added no attempt to isolate the errors and
present a concise example.
True.
[...] the MARQUEE tag
What MARQUEE element?

[snip]
Use @@EcmaScript if you must have scrolling text."
Really, scrolling text should be avoided completely. If it's too fast, the
user has to wait for several repetitions to read the text. Too slow and
the user has to wait just to get through one. Moreover, it's distracting.
It could be worse though: scrolling images. *ack*
Also, running a cursor over the dynamic menus pretty quickly fills
the console with "(event handler):Undefined value" errors in
Safari.


I assume you're looking at the OP's web site? As the OP admitted himself,
the menu doesn't work with Opera, so I see nothing but: "Menu is loading
please wait...".

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #5
Yes, I know about the marquee tag not being liked by w3c, will be
corrected when I get the time to write my own. At the moment it will just
have to do.

The previous version of this menu was a lot cleaner and worked in any
browser I could throw it on. but due to it's use of innerHTML is not
compliant with w3c so decided to give it a re-write with the "new way" of
doing it. Also I do know there is a lot of repetition, more concerned with
getting it working first, then optimizing. I've found that if I try to
optimize as I go that I end up shooting myself in the foot.

The reason this seems over complicated is I want a menu that I can make
changes to in real time. Enable, disable, add to, delete, change colors, add
remove images. so fourth. This is the third total re-write of this silly
attempt of mine and is starting to seem like an exercise in futility. Would
show you an example of the last menu that utilizes .innerHTML but my
wonderfully intelligent webhost I use to work on my non-business related
items for testing, puked on itself and all my work is gone except for the
php items I made backup's of. Anyways, will make the suggested modifications
and see how it goes. Oh, and the reason divMaster = "divMaster"; was just
for ease of change. So I could re-define the primary div target (where the
menu is to be drawn) easier.

Matthew Hagston...

"Fred Oz" <oz****@iinet.net.auau> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Matthew Hagston wrote:
Trying to do some updating and beyond frustrations with making it
compatibal with Mac's I am primarily done. Biggest problem I am having
now
[snip]
ceDiv.setAttribute("id", divMaster);


You're right, the centre part doesn't work in Safari. I got as far as
the above line, which should be:

ceDiv.setAttribute("id", "divMaster");

Note extra set of double quotes.

Fred.

Jul 23 '05 #6
"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsgi3i8zgx13kvk@atlantis...
On Wed, 27 Oct 2004 21:48:44 +1000, Fred Oz <oz****@iinet.net.auau> wrote:
Michael Winter wrote:
(Note to Fred: divMaster is a variable with the value, 'divMaster')
Yup - I got confused 'cos I was testing code snippets and the OP
switched between the variable divMaster and the string
"divMaster".


I didn't see it originally, either.
[...] Further, why use this variable maybe three times, and use
the identical string 17 times?


[guess]
Perhaps an (abortive) attempt to make the script reusable by making the
container name variable?
[/guess]
As a parting comment, I'm afraid to say I think that script is
horrific. No feature detection, use of object inference, no possibility
of graceful degradation, the use of FONT in the 21st century, and
general inefficiency.


To the OP: I would like to point out that I didn't enjoying writing that
paragraph.
To which could be added no attempt to isolate the errors and
present a concise example.


True.
[...] the MARQUEE tag


What MARQUEE element?

[snip]
Use @@EcmaScript if you must have scrolling text."


Really, scrolling text should be avoided completely. If it's too fast, the
user has to wait for several repetitions to read the text. Too slow and
the user has to wait just to get through one. Moreover, it's distracting.
It could be worse though: scrolling images. *ack*
Also, running a cursor over the dynamic menus pretty quickly fills
the console with "(event handler):Undefined value" errors in
Safari.


I assume you're looking at the OP's web site? As the OP admitted himself,
the menu doesn't work with Opera, so I see nothing but: "Menu is loading
please wait...".


....menu is loading please wait???... site this script is on is at:
http://www.otts.com/index_beta.html
was wondering why i couldn't seem to find a few of the references you all
were looking at.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.

Jul 23 '05 #7
On Wed, 27 Oct 2004 13:31:24 GMT, Matthew Hagston <ot***@earthlink.net>
wrote:
"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsgi3i8zgx13kvk@atlantis...


[snip]
I assume you're looking at the OP's web site? As the OP admitted
himself, the menu doesn't work with Opera, so I see nothing but: "Menu
is loading please wait...".


...menu is loading please wait???... site this script is on is at:
http://www.otts.com/index_beta.html
was wondering why i couldn't seem to find a few of the references you
all were looking at.


Not that it really matters. Aside from that one instance, my comments have
been based on what's been posted in this thread.

There are a couple of things I will mention, though, now that I've looked
at the correct link.

1) On the About page, rather than making the "Auggie" link,
javascript:void(0), why not link to the picture of the dog? That way, the
link will actually do something useful for users without scripting.
2) Without scripting enabled, your site is completely unnavigable. Not
only will the left-side menu fail to work at all, but neither will the
links at the top of the page. Surely this is not a good idea for a
commercial site.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #8
hrm, definatly good idea just so that the link is more functional than just
for the popup. There will be an alternate site for no-script or older
browsers though. just haven't put in the detection script yet, keep
forgetting to send it to myself at work. haven't loaded it yet, but removed
the FONT, replaced with div, only needed to add one line in the css file for
font-size, other than that worked fine as div instead of font.

oh, and you all haven't pointed it out yet, but reason that it seems to set
the 'class' or 'className' twice, is netscape see's it one way, ie see's it
another. will have it declare it better when it's working in opera, just
worried about getting it working. hate it when a script just doesn't give an
error. bleh!

--
Matthew Hagston
Hungates Creative Toys and Hobbies
ma************@hungates.com ........ http://www.hungates.com
"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsgi78eemx13kvk@atlantis...
On Wed, 27 Oct 2004 13:31:24 GMT, Matthew Hagston <ot***@earthlink.net>
wrote:
"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsgi3i8zgx13kvk@atlantis...


[snip]
I assume you're looking at the OP's web site? As the OP admitted
himself, the menu doesn't work with Opera, so I see nothing but: "Menu
is loading please wait...".


...menu is loading please wait???... site this script is on is at:
http://www.otts.com/index_beta.html
was wondering why i couldn't seem to find a few of the references you
all were looking at.


Not that it really matters. Aside from that one instance, my comments have
been based on what's been posted in this thread.

There are a couple of things I will mention, though, now that I've looked
at the correct link.

1) On the About page, rather than making the "Auggie" link,
javascript:void(0), why not link to the picture of the dog? That way, the
link will actually do something useful for users without scripting.
2) Without scripting enabled, your site is completely unnavigable. Not
only will the left-side menu fail to work at all, but neither will the
links at the top of the page. Surely this is not a good idea for a
commercial site.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.

Jul 23 '05 #9
On Wed, 27 Oct 2004 14:13:17 GMT, Matthew Hagston <ot***@earthlink.net>
wrote:

[snip]
There will be an alternate site for no-script or older browsers though.
You don't need to make two sites. In fact, that's a terrible idea as
you're giving yourself more work to do. Instead, learn how to make a
feature gracefully degrade. That is, give the document basic content that
will work in any browser, then add extra features to it. If the browser
doesn't support them, it doesn't matter. It will get the basics and,
whilst it might look so nice, it will still work.
just haven't put in the detection script yet,
What kind of detection script? Browser detection, by any method, is flawed
and should be avoided. For more information, see
<URL:http://www.jibbering.com/faq/faq_notes/not_browser_detect.html>.

[snip]
oh, and you all haven't pointed it out yet, but reason that it seems to
set the 'class' or 'className' twice, is netscape see's it one way, ie
see's it another.


I sort of did. Using

elementRef.className = '...';

should work fine for any dynamic browser. However, using

elementRef.setAttribute(...);

isn't very reliable. All standard element attributes have proper accessors
provided for your convenience. Use them.

[snip]

Mike
Please don't top-post. I know you're using OE, and I feel sorry for you in
that regard (:P), but please don't let it make you post incorrectly.

Responses should be made after the relevant points (as I've done above),
and unrelated text should be deleted (preferably marking when you do that).

Signatures should always be the last thing on your reply, and never quoted
unless you're actually commenting on them. In that case, make sure you
remove the "-- " that denotes them.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #10
Hehehe, sorry bout that top-postin thang. ;-)

probably right about just pulling it all into one site. shouldn't be a
problem to make a non-script version. Oh, and the biggest reason for that
marquee tag thing (don't really like it either), is it hides the top-menu,
and it hides the animated gif. if hide/unhide a gif, seems to stop
animating. simply move it behind something, keeps animating. not of much use
beyond just looks, but one of the few scripts that's working right now. lol

removed those 'class' attributes, and netscape then won't display the menu
correctly (jumbles them all up at the top). starting to look better
logically though. if i can get this class thing working for ie & ns, will
finish removing all of those setAttribute things, from what i read in some
netscape documentation thought was a requirement to set them that way.
typing ceDiv.id = "bla", much easier.

--
Matthew Hagston
Hungates Creative Toys and Hobbies
ma************@hungates.com ........ http://www.hungates.com
"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsgi9obt8x13kvk@atlantis...
On Wed, 27 Oct 2004 14:13:17 GMT, Matthew Hagston <ot***@earthlink.net>
wrote:

[snip]
There will be an alternate site for no-script or older browsers though.
You don't need to make two sites. In fact, that's a terrible idea as
you're giving yourself more work to do. Instead, learn how to make a
feature gracefully degrade. That is, give the document basic content that
will work in any browser, then add extra features to it. If the browser
doesn't support them, it doesn't matter. It will get the basics and,
whilst it might look so nice, it will still work.
just haven't put in the detection script yet,


What kind of detection script? Browser detection, by any method, is flawed
and should be avoided. For more information, see
<URL:http://www.jibbering.com/faq/faq_notes/not_browser_detect.html>.

[snip]
oh, and you all haven't pointed it out yet, but reason that it seems to
set the 'class' or 'className' twice, is netscape see's it one way, ie
see's it another.


I sort of did. Using

elementRef.className = '...';

should work fine for any dynamic browser. However, using

elementRef.setAttribute(...);

isn't very reliable. All standard element attributes have proper accessors
provided for your convenience. Use them.

[snip]

Mike
Please don't top-post. I know you're using OE, and I feel sorry for you in
that regard (:P), but please don't let it make you post incorrectly.

Responses should be made after the relevant points (as I've done above),
and unrelated text should be deleted (preferably marking when you do

that).
Signatures should always be the last thing on your reply, and never quoted
unless you're actually commenting on them. In that case, make sure you
remove the "-- " that denotes them.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.

Jul 23 '05 #11
Ok, well. made the recommended changes to the script. looks nice and pretty.
still no dice for opera

--
Matthew Hagston
Hungates Creative Toys and Hobbies
ma************@hungates.com ........ http://www.hungates.com
[snip]
Jul 23 '05 #12
Matthew Hagston wrote:
Ok, well. made the recommended changes to the script. looks nice and pretty.
still no dice for opera


Still no dice for Safari. The menus look better and seem to work, but
selecting an option causes Safari to crash (I'm using 1.03, which is not
the latest version).

The main content in the middle of you page still does not display.

Cheers, Fred.
Jul 23 '05 #13
Hrm, that's a menu that i didn't write, got it from dynamic drive. Kinda
gave up on getting that last pos I was working on. I'm just going to have to
get to the local school and hop on a Mac there. Spending too much time
getting it to work. thanks for the efforts though.

--
Matthew Hagston
Hungates Creative Toys and Hobbies
ma************@hungates.com ........ http://www.hungates.com

"Fred Oz" <oz****@iinet.net.auau> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Matthew Hagston wrote:
Ok, well. made the recommended changes to the script. looks nice and pretty. still no dice for opera


Still no dice for Safari. The menus look better and seem to work, but
selecting an option causes Safari to crash (I'm using 1.03, which is not
the latest version).

The main content in the middle of you page still does not display.

Cheers, Fred.

Jul 23 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jawahar Rajan | last post by:
All, I have an ASP site that uses frames two frames. (yes I should be using include files, but we started ou using frames so we have been stuck with frames.) When I get a page expired warning...
2
by: Brian | last post by:
Hello, I want to design some menus for websites with submenus. I'd like to learn the code myself and I was wondering a good place to pick up on some tips on how to design them. Also, is there...
18
by: Andromeda | last post by:
I've been trying to add a tree menu to my website with some luck (more or less). I came across a script on simplythebest.net, but I seem to be having a problem with it... and since they have no...
2
by: Hareth | last post by:
I created a context menu, linked to notifyicon. (a system tray menu). The menu pops up when u right click on it, in the system tray. (it works fine) When I delete some of the menuitems & rebuild...
4
by: Enrika | last post by:
Greetings! I'm working on a CSS drop-down menu, which, to my surprise, is actually working, more-or-less, in both IE *and* Firefox (and Netscape). But there are two changes that I want to make that...
9
by: =?Utf-8?B?ZHBvbXQ=?= | last post by:
Hello, I have a problem with the ASP.NET menu when rendered in IE7: If the menu is inside a div with style="position:fixed;top:3em;", all the submenus also have the top:3em. Is this an IE7...
6
by: roguefeebo | last post by:
Hello everyone, thanks for looking. I'll get right to the point: I'm having problems trying to figure out a hierarchy of menus in C; command-line style. Say, for example the program analyzes a...
8
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I created a user control that handles certain keystrokes, e.g. Ctrl-C for cut, Ctrl-V for paste, plus other more specialized keystrokes. I want to list these in the menubar like any other menu...
3
by: win | last post by:
I've create menu in a webform. <asp:Menu ID="Menu1" runat="server" CssClass="toolbar" Orientation="Horizontal"> <Items> <asp:MenuItem Text="Master" Value="Master"> <asp:MenuItem...
4
by: SAL | last post by:
Hello, is there a way to menu control dynamically center itself horizontally on a page? I have placed a menu control in a panel control (no ajax) and would like it to center itself. Depending on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.