Putting permanent message in a website

时间:2015-10-06 08:51:25

标签: javascript html

I want to make an tool that renders a permanent message at top of website.

eg : like a website putting a message "The web services will be down for maintenance from 0000 UTC to 0100 UTC."

The message should be fixed well on top means it should be shown even if user scrolls down the page (doable with position:fixed and top : 0).

the main problem come to me is

the message should actually consume some height and ALSO the maxHeight available to main application window should be (windowHeightWithoutMessage - messageHeight).

Of course, window.innerHeight comes full window height.

I have libraries that uses this property.

window.innerHeight = window.innerHeight - getHeight(messageHtml);

Will it be doable/good to forcefully decrease height this way?

How to tackle the issue of height?

If there exists an alternative tool(in pure js or in form of angular directive), because i could not find one.

0 个答案:

没有答案