Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Floating/static menus

I've added various code as snippets to try to gat a floating or static menu or image, but none seem to work.

Any ideas what I'm doing wrong?

Here are two I tried:

http://www.dynamicdrive.com/dynamicindex1/staticmenu.htm

http://www.quackit.com/css/codes/cssfloatingmenu.cfm

Thanks!

Several MacBook Pros and an iPhone 3GS (how did I ever manage before iPhones?), Mac OS X (10.6.2), An Apple user since my 1982 Europlus ll - lovely!

Posted on Feb 22, 2010 12:50 AM

Reply
40 replies

Feb 24, 2010 2:14 AM in response to Old Toad

Thanks guys, I did get Wyodor's code to work, I just didn't realise it needed to go into a page header, which I'd removed from my layout.

My floating menu quest is to get a red box about 13px x 60px with the word "top" in it so that it is always there to guide people back to the top of the page - not crucial, just nice.

I have to say I'm pretty pleased with how my site looks, I found some very simple code for a drop-down button and some very tasteful menu anims.

My only problem now is that when the left menu items are clicked before the page A fully loaded, the menu on page B appears collapsed. Any ideas?

My website is www.poulson.info and the code for the menu is:

<style type="text/css"><!--
#roll a {
width: 143px; /* sets the width of your buttons, remove this line if you want variable width */
display: inline-block;
text-decoration: none;
}
#roll ul {
margin: 0;
padding: 0;
list-style: none;
}
#roll ul li {
list-style-type: none;
background: none;
}
#roll ul li a, #roll ul li a:visited { /* styles for the default button state */
margin: 0 0 5px 0;
padding: 0 8px 0 8px;
line-height: 21px; /* this value must be at least twice the border-radius value */
color: #666666;
background: #FFFFFF;
font-family: Verdana, Tahoma, Arial, sans-serif;
font-size: 13px;
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
#roll ul li a:hover { /* styles for the rollover button state */
color: #FFFFFF;
background: #CCCCCC;
}
--></style>

Feb 24, 2010 3:02 AM in response to Jagmurcredrea

To post code you can use {code} before and after it.

Or type > at the beginning of every paragraphh of the code.

Then do a preview.

To display < and > use &amplt; and &ampgt;

I currently have a little mishap with my Home directory on my Alu iMac. Hence no access to 400GB of data. Who cares 🙂

I'm typing this text on my 10 year old iMac G3.

I'll be back when the difficulty is solved.

Feb 24, 2010 3:30 AM in response to Wyodor

Hey, first off good luck with your directory!

Thanks for the tips, I'll now post the menu code again.

As a reminder, if a menu item is clicked before the entire page is loaded, the menu collapses... any thoughts?


<style type="text/css"><!--
#roll a {
width: 143px; /* sets the width of your buttons, remove this line if you want variable width */
display: inline-block;
text-decoration: none;
}
#roll ul {
margin: 0;
padding: 0;
list-style: none;
}
#roll ul li {
list-style-type: none;
background: none;
}
#roll ul li a, #roll ul li a:visited { /* styles for the default button state */
margin: 0 0 5px 0;
padding: 0 8px 0 8px;
line-height: 21px; /* this value must be at least twice the border-radius value */
color: #666666;
background: #FFFFFF;
font-family: Verdana, Tahoma, Arial, sans-serif;
font-size: 13px;
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
#roll ul li a:hover { /* styles for the rollover button state */
color: #FFFFFF;
background: #CCCCCC;
}
--></style>

Feb 24, 2010 3:59 AM in response to Jagmurcredrea

I see the collapse you mention, but I can't see the menu float or having a static screen position. Have you dropped that idea?
I would like to fiddle around with the possibilities of a static/floating menu (navigation bar), but I can't figure out what to do from the often all too brief snippets of info (for people with very limited knowledge of coding, as I).
Could someone please elaborate on how to create static/floating menus? Thanks in advance!

Feb 24, 2010 5:30 PM in response to Jagmurcredrea

My only problem now is that when the left menu items are clicked before the page A fully loaded, the menu on page B appears collapsed. Any ideas?


what you experience is a race condition.
your nav column is displayed in an iframe on the main page, the iframe is a child node of the main page (the parent document/window) according to DOM.
when you click on a nav column link while the parent DOM is not ready (google DOM Ready), it has no place to go so it defaults to the iframe view.

try to set target attribute for your nav column links/anchors: target="_top" or target="_parent"

Feb 25, 2010 1:02 AM in response to Cyclosaurus

Thanks for that Cyclosaurus, I'll have a play with it but may come back with a supplemental - I'm really not technical at all.

Whilst I've got your attention 😉 I'm developing a mobile version of my website and had a lucky thing happen when I looked at it on my iPhone - a drop-down menu triggered a spin-wheel - I was knocked out, it looks like great!

But...

The drop-down menu doesn't drop down, it just triggers the spin-wheel, so my question to you (or anybody else) is, what can I replace the drop-down menu with that is more appropriate for triggering the spin-wheel? A button maybe that just says "Take me to...". Some code for a snippet would be cool!

You can see the drop-down menu on the mobile version at http://www.poulson.info/mobile/m.home.html

Thanks again!

Feb 25, 2010 2:39 AM in response to Wyodor

Yeah, that's what I see too.

My point was, the drop-down itself as a graphic device is redundant on an iPhone, as it doesn't actually drop down.

So, I want to replace the non-dropping drop-down menu with a simple button - a gif, whatever - which has the same effect, in other words it opens the same spin-wheel as in your screen-grab. Preferably in the form of HTML code that can be pasted into a snippet.

Being utterly non-technical it's a puzzle I'm unable to solve by myself!

I'm guessing/hoping that a modification of the drop-down snippet should do the trick?

(I can't even make out how the drop-down menu manages to appear from the code!)


<html>
<head>
<script type="text/javascript">
function go()
{window.location=document.getElementById("menu").value;}
</script>
</head>
<body>
<form>
<select id="menu" onchange="parent.window.location=this.value">
<option>Take me to...</option>
<option value="http://www.poulson.info/mobile/m.home.html">Home</option>
<option value="http://www.poulson.info/mobile/m.about_me.html">About me</option>
<option value="http://www.poulson.info/mobile/m.videos.html">Videos</option>
<option value="http://www.poulson.info/mobile/m.video_stills.html">Video stills</option>
<option value="http://www.poulson.info/mobile/m.video_clips.html">Video clips</option>
<option value="http://www.poulson.info/mobile/m.video_kit.html">Video kit</option>
<option value="http://www.poulson.info/mobile/m.events.html">Live events</option>
<option value="http://www.poulson.info/mobile/m.photography.html">Photography</option>
<option value="http://www.poulson.info/mobile/m.powerpoint.html">Powerpoint</option>
<option value="http://www.poulson.info/mobile/m.design.html">Design</option>
<option value="http://www.poulson.info/mobile/m.worldwide.html">Worldwide</option>
<option value="http://www.poulson.info/mobile/m.clients.html">Clients</option>
<option value="http://www.poulson.info/mobile/m.testimonials.html">Testimonials</option>
<option value="http://www.poulson.info/mobile/m.contact.html">Contact</option>
<option value="http://www.poulson.info/mobile/m.news.html">News</option>
<option value="http://www.poulson.info/mobile/m.links.html">Links</option>
</select>
</form>
</body>
</html>

Feb 25, 2010 3:42 AM in response to Wyodor

And here's the second menu :

[Dynamically Floating menu|http://www.wyodor.net/_Demo/FloatingMenu/DynamicFloat.html]

Here's the widget-markup page with the code (look at the source) :

http://www.wyodor.net/Demo/FloatingMenu//DynamicFloat_files/widget1markup.html

Took me a while to figure out how to dynamically add JavaScript to an (iWeb) page. Found it here :

[Howto Dynamically Insert Javascript And CSS|http://www.hunlock.com/blogs/Howto Dynamically_Insert_Javascript_AndCSS]

Feb 25, 2010 3:43 AM in response to Jagmurcredrea

Why not create webpages as before and make the show correctly on a iPhone.

I checked my pages in the simulator, and was able to finetune some pages to show correctly.

But the way your mobile pages show in the iPhone simulator are appealing to me.

Why not leave it that way for a while and see how visitors respond. And wait for your next creative outburst.

I did. See my [other post|http://discussions.apple.com/message.jspa?messageID=11137608&tstart=0] about the dynamically floating menu.

Floating/static menus

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.