HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

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 Dev Shed Forums Sponsor:
  #1  
Old March 14th, 2003, 03:28 PM
BQ74 BQ74 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 1 BQ74 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Slide Out Menu Problem

I'm trying to get my drop down menus to line up under their assigned topics regardless of the users resolution, as my page uses a centered table design. (Sorry no example at this point).

I have found a script that does this:
ypSlideOutMenus found at YoungPup.net

He includes an example of a centered menu which calculates the current offset of the top left corner of the drop down menu and then initializes it to specific pixels from there.

My problem is, however, that he only includes an example of one menu item. I would like to know how to alter the code below, so it handles 2 or more menus. I guess im just not javasavee enough to get it to do this.

Code:
____________________________________________________

<html>
<head>
<script language="javascript" src="../ypSlideOutMenusC.js"></script>
<script language="javascript">

var myOffset = -37;
// the number you pass to initLeft doesn't matter since it will get
// changed onactivate
var myMenu = new ypSlideOutMenu("menu1", "down", 0, 25, 180, 200)

myMenu.onactivate = repositionMenu

function repositionMenu()
{
var newLeft = getWindowWidth() / 2 + myOffset;
myMenu.container.style ? myMenu.container.style.left = newLeft + "px" : myMenu.container.left = newLeft;
}

function getWindowWidth()
{
return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
}
</script>
<style type="text/css">
.menuActuator a {
color:#666666;
font-weight:bold;
font-size:12px;
font-family:arial;
}
.menu {
font-family:verdana;
color:#666666;
font-size:10px;
background-color:#cccccc;
layer-background-color:#cccccc;
}
</style>
</head>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor="white">
<table align="center" bgcolor="#CCCCCC" cellpadding="2" cellspacing="0" border="0">
<tr>
<td width="50" align="center" class="menuActuator"><a href="#" onmouseover="ypSlideOutMenu.showMenu('menu1');" onmouseout="ypSlideOutMenu.hideMenu('menu1')">menu1</a></td>
</tr>
</table>
<div id="menu1Container">
<div id="menu1Content" class="menu">this is menu 1!</div>
</div>
</body>

-----------------------------------------------------------------------------------

Thanks!

BQ

Reply With Quote
  #2  
Old April 19th, 2003, 12:43 PM
MaxxBass MaxxBass is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 2 MaxxBass User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have the same problem. Can anybody hepl us?

Reply With Quote
  #3  
Old April 19th, 2003, 01:01 PM
mttatkns mttatkns is offline
Got source?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2003
Location: Laguna Niguel, California, USA
Posts: 2,332 mttatkns User rank is Private First Class (20 - 50 Reputation Level)mttatkns User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Why reinvent the wheel? Why not use a premade script like that at www.twinhelix.com?

Reply With Quote
  #4  
Old April 19th, 2003, 04:57 PM
MaxxBass MaxxBass is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 2 MaxxBass User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ypSlideOutMenus are much easier to use dynamicly.

Reply With Quote
  #5  
Old October 14th, 2003, 09:45 AM
proy01 proy01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 14 proy01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
YP Slide Out

I can answer your issues but have a problem with mine. i will say though that it has to be one of the best menus out there.

To answer your issue

var myMenu = new ypSlideOutMenu("menu1", "down", 0, 25, 180, 200)
var myMenu = new ypSlideOutMenu("menu2", "down", 0, 25, 180, 200)
var myMenu = new ypSlideOutMenu("menu3", "down", 0, 25, 180, 200)
var myMenu = new ypSlideOutMenu("menu4", "down", 0, 25, 180, 200)

etc then at the bottom of the page you should have

<div id="menu1Container">
<div id="menu1Content" class="menu">this is menu 1!</div>
</div>

just copy and paste this info and change the numbers according to what you have above for example

<div id="menu2Container">
<div id="menu2Content" class="menu">this is menu 2!</div>
</div>

I hope it helps, if you play around wit it, you can achieve pretty much anything and you dont need to touch the js files.

Reply With Quote
  #6  
Old October 21st, 2003, 09:41 AM
Hotlink Lady Hotlink Lady is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 Hotlink Lady User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 20 sec
Reputation Power: 0
ypSlideOutMenu Problem

Has anyone resolved this issue? I too need help.

I've tried proy01 advice and still did not work. To view a sample of my code click here.

Any help would be appreciated.


- Hotlink Lady

Reply With Quote
  #7  
Old October 21st, 2003, 10:15 AM
proy01 proy01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 14 proy01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Slide Out Menus

Are you triggering the menus via a text link or an image, as you need to adjust your other links and number them accordingly with my previsouly posted info. for example

<a href="this is the actual trigger link details" onmouseover="ypSlideOutMenu.showMenu('menu2');" onmouseout="ypSlideOutMenu.hideMenu('menu2')"><img name="your image link" src="/path to your imagelink" width="x" height="x" border="0" alt="">

there are only 3 places to include another menu. make sure you change the location of the menu at the top of the page.

Let me know if i can help further

Reply With Quote
  #8  
Old October 21st, 2003, 10:17 AM
proy01 proy01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 14 proy01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Slide Out Menu

To see one of the sites ive done with it goto

http://www.domecomputers.co.uk

Reply With Quote
  #9  
Old October 21st, 2003, 10:50 AM
Hotlink Lady Hotlink Lady is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 Hotlink Lady User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 20 sec
Reputation Power: 0
nice site using ypSlideOutMenu

Nice site proy01! Probelm is your layout is aligned left. My design is fluid and the navigation should move with the layout rather than being sedentary.

I'm also having an issue with swap image. The Nav is a jpg and I'd like to swap image onMouseOver but ypSlideOut consumes that event. Can you think of an alternate way to hadle the swap image?

Thanks for the input.


- Hotlink Lady

Reply With Quote
  #10  
Old October 21st, 2003, 11:00 AM
Hotlink Lady Hotlink Lady is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 Hotlink Lady User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 20 sec
Reputation Power: 0
Have a look see

I am using image links have a look at my code on this forum: http://forums.devshed.com/t92562/s.html


- Hotlink Lady

Reply With Quote
  #11  
Old October 21st, 2003, 11:19 AM
proy01 proy01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 14 proy01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
slide.....

I have used the ypslideout a few times centrally and left aligned. im not sure you can get it to mouse over as ive tried a few times but i think it needs a static image. the only way i think that you could get it to work would be to assigned it to a CSS buttons, if you want ill show you some examples but would need to pm you as i dont want my urls splashed all over these forums.

Did you get your other problem sorted?

Whats the link to your site?

Reply With Quote
  #12  
Old October 21st, 2003, 11:25 AM
Hotlink Lady Hotlink Lady is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 Hotlink Lady User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 20 sec
Reputation Power: 0
Images swapped

I've got the image swap thing worked out as followed :

Quote:
<a id="act0" href="#" onmouseover="ypSlideOutMenu.showMenu('menu1'), nav1.src='pics/nav1_on.jpg'" onmouseout="ypSlideOutMenu.hideMenu('menu1'), nav1.src='pics/nav1_off.jpg'"><img src="pics/nav1_off.jpg" name="nav1" width="106" height="29"></a>


I still cannot get the menu to move with the layout.


- Hotlink Lady

Reply With Quote
  #13  
Old October 21st, 2003, 11:29 AM
proy01 proy01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 14 proy01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
menus

I think i need to see an example of what you mean, if its what i think you mean, i would put the whole lot in a table and centre it on the page that way it will move around.

Let me know

Reply With Quote
  #14  
Old October 21st, 2003, 11:36 AM
Hotlink Lady Hotlink Lady is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 Hotlink Lady User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 20 sec
Reputation Power: 0
have a look see

Have a look see

I have posted my code here: http://forums.devshed.com/t92562/s.html


- Hotlink Lady

Reply With Quote
  #15  
Old October 21st, 2003, 11:41 AM
proy01 proy01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 14 proy01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
menu

I had a look at that and whilst i understand youre going to have it centered it doesnt really throw much light onto the bigger picture.

I need to see a file that isnt working so i can have a look and fix it. let me know if you want me to have a look.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Slide Out Menu Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
Stay green...Green IT