I'd like to scroll to the bottom of the page and I recently found the scroll behavior style tag. Is there a way to change the speed of smooth scrolling using a CSS style?
Related question (using JQuery):
How to change speed of a smooth scroll?
No, the smooth scrolling speed cannot be changed using CSS. The only attribute tags available are behavior tags; smooth/auto.
Related
I'm sorry if the title is not very good, any suggestions are welcome.
The entire page is an iframe onto another website (in this case, jquery.com just for demo purposes). I have an overlay "Hello World", and if you click on the X it minimizes it (click again it will open it).
My issue in this case is that it covers the scrollbar on the right.
I assume the reason is I have a CSS positioning the sidebar at right:0, however since it's an iFrame it doesn't count the scrollbar.
What are my options for working around that?
I thought of giving it some extra space, but how do I know if the page really has a scrollbar, or how big the scrollbar is?
Is there a way to place the overlay at a position WITHIN the iframe instead?
There is no way to detect the remote page's height or even if a scrollbar is present or not. Your only option, besides moving the sidebar to the left, is detecting the browser's scrollbar width and permanently shifting the overlay off the right edge this amount.
yes. just set the right to 40 for example right: 40px;
There is an example here that shows you how to detect if an iframe has a scrollbar:
How can I detect a Scrollbar presence ( using Javascript ) in HTML iFrame?
And there is also an example here that measures the scrollbar width
http://4umi.com/web/javascript/scrollbar.php
Once you know these you can place your overlay however many pixels from the right
I was looking at this HTML5 website, http://www.danhigbie.com, and found the "background image's scrolling" fascinating. I looked through its Javascript but found no code changing the background image.
Save the webpage to disk and play around with the files better.js and better.cs. The background scrolling is being done in the better.js file by changing the css classes (which are defined in better.css)
I am using some jQuery to change the background positioning of multiplebgs based on the scroll position. Each background image element is positioned from the top with a percentage, this may be a bit hard to follow since there are so many background images per section. I take each background elements vertical position value and modify it based on the current scroll bar position. Hope this helps.
Turns out that the effect is done simply by declaring the background position of different "section" as fixed. Found a excellent article that explains how that effect work:
Icon that changes color when scrolling
Here is a javascript library that does this for you and seems to work really well:
http://stolksdorf.github.com/Parallaxjs/
site is www.onlinefilmbox.com
When it loads, you can see that for a second, horizontal and vertical bars appear on the carousel in the center.
They appear for a second and then gone.
But I wonder - can I remove this short appearance?
I tried "overflow: hidden" and "overflow-x: hidden" + "overflow-y: hidden"
and both don't change anything.
any idea?
As the above commenters I don't see the problem either, but I'm pretty sure the problem is that the page loads slower with your computer or internet. I would suggest to use javascript or php to display the page after it's fully loaded. You could also try this:
scrolling = "none"
in the frame in html.
Can we change a scroll bar styling, Instead of default scroll bar, I want to place a image on it.
No.
IE allow change color of some scrollbar elements. But other browsers - NO.
The only solution is use custom JS to implement this. But this is always more ugly and non-useful instead of native controls.
Take a look at: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html
See if this works for you - flexScroll
This does not place an image over the scrollbar, it creates a virtual scrollbar. I don't know if it is possible to gain control over scrollbar using html/js.
You can't use an image for the scroll-bars, but you can change the colour of them. See this page for information on how to do it.
Be aware that the scrollbar properties are not valid CSS, and not all browsers will obey the style of the scrollbars.
Just found a link for the similar effect,hope it helps..
[http://www.hiddenpixels.com/javascript/custom-javascript-scrollbar/][1]
I am a newbie to HTML and CSS and am trying to design a website, where the majority of text will be in boxes on the screen.
Each box will be coloured differently and will have more text than is visible directly
My question
Can I make the background colour of the scroll section, ie the bit between the two arrow heads match the existing background colour?
If I could even change the colour of the actual scroll bar, that would be even better
Finally, can I get rid of the horizontal scroll bar, as it is not required ? At present it makes my box have a white band along the bottom
There are several soutions to change the style of scrollbars on websites:
Via CSS:
This doesnt work reliable: For example it works only in IE, not in firefox. So I would avoid that.
Via JavaScript:
I suggest: Hide the browser-scrollbars and make your own scrollbar using javascript and some arrow-images, so you got full control over the style.
For example you could use JQuery and JScrollPane (demo). According to the documentation this works in all modern browsers (IE, Firefox ...). If the user would disable javascript support it would still work but the scrollbars appear unstyled.
Only Internet Explorer and Opera in quirks mode support colouring browser scrollbars, so you'll need to try a javascript solution.
Interestingly, CSS defines some system colors, so if you're (very) flexible with your design you could set the background of the scroll area to match one of those. An unlikely solution though.
For the horizontal scrollbar, you could try out overflow-x: hidden; overflow-y: scroll. That is intended to stop horizontal scrolling but allow vertical scrolling. I believe it is CSS3 so is unlikely to work in all browsers.
Update: Just saw this, which should meet your needs: http://www.leigeber.com/2009/09/javascript-scrollable-div/