I am trying to get an HTML element on my page to expand and become the width of the page and float fixed?
-
I am trying to get an HTML element to expand to become the width of the page of the page and become fixed on top. So like when a user scrolls down and the search bar hits the element on the page it will expand and then become floating fixed at the top of the page. How would I do this? I was thinking CSS and Jqury but not sure. I have no idea what to type into Google to find it so if you can help thanks this is my HTML for the original that shows where it's suppose to, Select Any Page # Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 Page 8 Page 9 Page 10 Page 11 Page 12 Page 13 Page 14 Page 15 Page 16 Page 17 Page 18 Page 19 Page 20 Page 21 Page 22 Page 23 Page 24 Page 25
-
Answer:
Try this example: <html> <head> <script type="text/javascript"> function loader() { document.getElementById("box").style.wid… = screen.width } </script> <style type="text/css"> #box { position: fixed; top: 0px; left: 0px; height: 300px; background-color: #F00; } </style> </head> <body> <div id="box"></div> </body> </html> ----------------------------- Earn money online with AlertPay https://www.alertpay.com/?o%2b%2bInYhLlL31t%2bYS0Js83Q%3d%3d
Juan Colt at Yahoo! Answers Visit the source
Other answers
Try this example: <html> <head> <script type="text/javascript"> function loader() { document.getElementById("box").style.wid... = screen.width } </script> <style type="text/css"> #box { position: fixed; top: 0px; left: 0px; height: 300px; background-color: #F00; } </style> </head> <body> <div id="box"></div> </body> </html> ----------------------------- Earn money online with AlertPay https://www.alertpay.com/?o%2b%2bInYhLlL31t%2bYS0Js83Q%3d%3d
Introvert-ish
Related Q & A:
- How do i get the new yahoo beta front page?Best solution by Yahoo! Answers
- How do I get back my Yahoo 360 home page?Best solution by Yahoo! Answers
- Why do I get an error message when I am trying to close Internet explorer page?Best solution by Yahoo! Answers
- I'm trying to get a meeting with a diplomat to counsel me on a career in international affairs?Best solution by Yahoo! Answers
- I cannot get to my addresses when I am trying to forward my e-mails.Best solution by answers.microsoft.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.