473,804 Members | 3,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

keeping a menubar on top of the site

Hi folks,

I was trying to "pin" a menubar to the top of a site.
It should allways stay on its absolute position.
Especially when the user scrolls the page...

I did like this:

<div id="object1" style="position :absolute; visibility:left :50px;
top:50px"> MENU </div>

called from a timer:

document.object 1.style.top=50;
OR
window.document .object1.style. top=50;
OR
document.object 1.top=50;
OR
window.document .object1.top=50 ;

none of them worked...
now what?
THX!
M. Hesselbach

PS: It's ok if it runs in firefox, no need for IE support...
Jul 23 '05 #1
4 1708
Martin Hesselbach wrote:
I was trying to "pin" a menubar to the top of a site.
It should allways stay on its absolute position.
Especially when the user scrolls the page...
Is is it that hard for the user to scroll back up?
<div id="object1" style="position :absolute; visibility:left :50px;
top:50px"> MENU </div>
visibility what?
called from a timer:

document.object 1.style.top=50;


That should be document.getEle mentById('objec t1') and "50px", but won't do
any good since you are just setting it to what it is anyway.

You probably want position: fixed, not absolute. There wouldn't be any need
for JavaScript at all, but IE doesn't support fixed. Google will reveal
JavaScript to fake position: fixed support in Internet Explorer.
--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2
David Dorward wrote:
Martin Hesselbach wrote:

I was trying to "pin" a menubar to the top of a site.
It should allways stay on its absolute position.
Especially when the user scrolls the page...

Is is it that hard for the user to scroll back up?

<div id="object1" style="position :absolute; visibility:left :50px;
top:50px"> MENU </div>

visibility what?

called from a timer:

document.obje ct1.style.top=5 0;

That should be document.getEle mentById('objec t1') and "50px", but won't do
any good since you are just setting it to what it is anyway.

You probably want position: fixed, not absolute. There wouldn't be any need
for JavaScript at all, but IE doesn't support fixed. Google will reveal
JavaScript to fake position: fixed support in Internet Explorer.


Still not working....

this is just for trying to move a DIV:
<html><body>
<div id="object1" style="position :absolute; left:50px; top:50px">
<a href="javascrip t:document.getE lementById('obj ect1').style.to p=60px">
Movable Menu</a>
</div></body></html>

is doing nothing in IE or Firefox...
won't work without the ".style" part neither...

this shouldnt be that hart, ey?

thx again

M. Hesselbach
Jul 23 '05 #3
Martin Hesselbach wrote:
<div id="object1" style="position :absolute; left:50px; top:50px">
So you're ignoring everything I said about not using absolute and JavaScript
for this then?
<a href="javascrip t:document.getE lementById('obj ect1').style.to p=60px">


1: http://jibbering.com/faq/#FAQ4_24

2: Strings, like 60px, must be surrounded by quote marks in JavaScript.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #4
David Dorward wrote:
Martin Hesselbach wrote:

<div id="object1" style="position :absolute; left:50px; top:50px">

So you're ignoring everything I said about not using absolute and JavaScript
for this then?

<a href="javascrip t:document.getE lementById('obj ect1').style.to p=60px">

1: http://jibbering.com/faq/#FAQ4_24

2: Strings, like 60px, must be surrounded by quote marks in JavaScript.

thx

works like this now:

function pinScroll() {
pindelay = setTimeout('pin Scroll()',50);
document.getEle mentById('chord sbar').style.to p=(window.pageY Offset+3)+'px';

}

<div id='chordsbar' style='position :absolute'>
its acctually for a lyrics and chords/tabs displaying page...
it scrolls trough the song and the displayed chords you have to play
stay...
M. Hesselbach
Jul 23 '05 #5

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

Similar topics

4
1437
by: Raphael Gluck | last post by:
Hi I am wondering if anyone can help me I am trying to build a menu bar navigation for my site, and would like the contents of the menu bar to be linked to a database. E.G If I have ten initial product Categories, in my main database table, I want to link it to a menubar to display the main categories on the front page of my site.
15
65779
by: Code Monkee | last post by:
How can the toolbar and menubar be hidden in IE? When opening the window via javascript I can specify 'toolbar=no,menubar=no', which works fine. However if the window already exists how can I remove them? If the browser is Netscape I can use javascript: window.toolbar.visible = false; window.menubar.visible = false; but IE produces the error: "'window.toolbar.visible' is null or not an object".
3
2269
by: NoSpammingToMePlease | last post by:
Assume that this page www.externalsite.com/anypage.html would contain the following javascript: window.open('www.mysite.com/mypage.html', null, 'location=no, menubar=no'); Then I would like to do the following: window.setMenubar(true); window.setLocation(true); from within my own page
6
19616
by: Biguana | last post by:
Hi, Just wondering if anyone can help here. We have a site where most of the site opens in a window with no toolbars or menubar: window.open('mypage.aspx','self','toolbar=0, menubar=0, etc, etc) This is because it's a data driven site where space is at a premium and we'd rather discourage use of back, stop and refresh. The problem arises because some "view data" pages are designed to be printed and have an onclick="window.print();"...
1
1566
by: Richard Hollenbeck | last post by:
I'm building custom menubars for my application--a different one for each form. When I right-click on a menubar and select Customize and click on the toolbars tab, the menubar called "Menu Bar" can sometimes be unchecked and other times it can't. I'm wondering what determines when and why it sometimes prevents me from unchecking it. In my main form, the "Menu Bar" is unchecked but my custom menubar is checked. I also have my main form's...
8
2875
by: Jho | last post by:
Is it wise to do the following to hide html source and other info. I plan to do a popup window which would close my existing web page and popup a window in its place without toolbar and menubar. are there any disadvantages of hiding browser toolbar and menubar ?
0
1068
by: Mohit Vora via .NET 247 | last post by:
When I load a child form inside an MDI parent, the menubar of the parent covers the child somehow. The MDI parent is set to FormWindowState.Normal and has MaximizeBox, MinimizeBox and ControlBox set to True. The child has the Startup state set to FormWindowState.Maximized and has the MaximizeBox, MinimizeBox and ControlBox set to False. Also the Text property of the child is blank. So ideally, when the child form is maximized inside the...
2
1473
by: A.J. Pool | last post by:
I have a form with a main menubar containing a number of menu options. In the empty right half of the menubar I want to place a combobox where users can make some sort of selection. However, when I place a combobox on the form and move it to the menu area it disappaears behind the menubar, instead of appearing in front of it. How can I place the combobox on top of (or in front of) the menubar? I use VB.NET 2003 standard edition. --...
4
1939
by: dreamamit2001 | last post by:
Hi, I would like to know the ASP.NET2.0's(Controls, Menubar, Validations, Object Data Souce Controls, Treeview Control) compatibility with IE5.0 browser on Mac OS. If I don't use Client side Vbscript and Activex control, will the site developed in Asp.net2.0 work fine on IE5.0 Mac Os? Any body who has viewed the working of ASP.NET2.0 with rich controls
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.