|
|
|
|
|
|
|
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
![]() |
#1 |
wtfwjd?
Join Date: May 2007
Posts: 2,103
|
Adding a menu using php call which uses js
I have a menu which uses js to make some sub-items hidden and show when the mouse rolls over. It works as a stand alone when I display in the browser:
Code:
http://www.lusciousdelights.com/menunavrev.php Code:
<?php include("/home/luscious/public_html/menunavrev.php") ?> Code:
http://www.lusciousdelights.com/linklist/amateurt.php Thanks! |
![]() |
![]() |
![]() |
#2 |
Get me!
|
Just a guess, but maybe if you used the full URL in the menunavrev.php to the js, and css ?
|
![]() |
![]() |
![]() |
#3 | |
wtfwjd?
Join Date: May 2007
Posts: 2,103
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#4 |
Get me!
|
I"m glad it worked for ya sweetie
![]() |
![]() |
![]() |
![]() |
#5 |
Are you sure you're an accredited and honored pornographer?
Join Date: Sep 2008
Posts: 67
|
Hi,
I noticed that you are nowing using the new menus throughout the site and not just on the test page: http://www.lusciousdelights.com/linklist/amateurt.php. When I look at the pages the menu appears to go down past its bounding box and there is sometimes no space between the menu and the ad below. I was able to hack a test fix into a downloaded copy of one of your pages that might give you some insight into the problem and lead you towards a fix. I changed Code:
<div class="menunav"> Code:
<div class="menunav" style="padding-bottom: 5em"> Best of luck, fg |
![]() |
![]() |
![]() |
#6 |
wtfwjd?
Join Date: May 2007
Posts: 2,103
|
Thanks for your help. What I did was put a margin at the bottom of the div using a css rule for the class "menunav" which looks ok in IE, but not FF. Ugh...I might try your suggestion and see what happens.
|
![]() |
![]() |
![]() |
#7 | |
Are you sure you're an accredited and honored pornographer?
Join Date: Sep 2008
Posts: 67
|
Quote:
First replace: Code:
<div class="menunav"> Code:
<div class="menunav" id="menunav_id"> Code:
<script type="text/javascript"> <!-- var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> Code:
<script type=text/javascript> <!-- if (! menunav_retry) { // test for safari happiness document.getElementById('menunav_id').style.height = (document.getElementById('menunav1').clientHeight +5) + 'px'; menunav_retry = 1; } var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> If this works for you, you can also remove the height specification from the .menunav css rule. HTH, fg |
|
![]() |
![]() |
![]() |
#8 |
Are you sure you're an accredited and honored pornographer?
Join Date: Sep 2008
Posts: 67
|
Actually - just noticed, for this to work you actually need to change
Code:
height: 755px; Code:
height: auto; |
![]() |
![]() |
![]() |
#9 |
wtfwjd?
Join Date: May 2007
Posts: 2,103
|
Thanks! haven't had a chance to play around with yet, maybe this weekend.
|
![]() |
![]() |
![]() |
#10 | |
Are you sure you're an accredited and honored pornographer?
Join Date: Sep 2008
Posts: 67
|
Quote:
Getting it to work cross browser was trickier than I thought though. At one point I had something that seemed to work for IE8 and FF3 and then got into some trouble adjusting it for Safari. I have now tested a revised version on IE7, IE8, FF3, Safari 5 and Chrome, including FF with JavaScript disabled. I must admit that there was a bit of tweaking for nearly every browser I tested. Anyway the html and css changes are as described above with <div class="menunav" id="menunav_id"> and height: auto for ".menunav". The new JavaScript code is not that lengthy, still replaces the same bit of code, and is included below. It is a bit complicated and the browsers were picky and I will understand if LD stays with something simpler for now. The code assumes that menunav1 has been switched back in for the div tag. If anyone has any questions please send me a pm and I thank everyone for their patience. Code:
<script type=text/javascript> <!-- var h = document.getElementById('menunav1').clientHeight; if (h > 100 && h < 1000) { // test for IE7 and chrome / safari var nav_n = document.getElementById('menunav_id'); h = (h + 5) + 'px'; if (nav_n.style.height==undefined) // more safari nav_n.clientHeight = h; else nav_n.style.height = h; } var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> fg Last edited by flowersgone; 2010-08-06 at 06:05 PM.. |
|
![]() |
![]() |
![]() |
|
|