Menu Close

The real way to always see scrollbars in any browser environment (even in IOS Safari)

First of all, the reason that scrollbars are not always visible in any browser environment is safari on iOS, or Safari, which is an iphone-only browser. In the past, it would have been a problem for cross-browsing, and anyone would have left IE, except for the issue that the past version is still in use, and is now rather compliant with the upgrade.

The emerging next-generation dark Horse is the Safari browser. It's old fashioned and I think that's why it's the main browser of iOS, it's crap, but the update also seems to be the direction of their own, but it is increasingly a feeling of falling. All other browsers are applied, and even cross-browsing does not work even with features that work in the old version of Internet Explorer that was first thought. And the worst of all is that, as I said, this crap browser is the main browser of the iphone iOS, which is the next most popular Android on the planet (it's a real hit, but I don't know if this is a bad one.)

    Create code that always scrolls in all environments

Gkkmon, the page item menu that scrolls horizontally, such as those found on the Home screen or page of a site, is a cross-browsing object that has been tested in all browser environments. I didn't even imagine it would be so hard to make the scroll bar always visible in every browser. The reason for this is that safari, as I said earlier, the main browser safari for iphone iOS was not able to always look at all of the information, and I looked up and applied the wiki, and I tried to change the application, but it was impossible to keep the scroll in full function.

But I can't give up this little bit of gkkmon in the nature of the dog, but we've developed a countermeasure that allows users to recognize that there is a scroll in the iphone using the code available on iOS. It is only shown in different ways on the iphone (but you can be aware that there is a scrollbar), and other ways to make the scrollbar look normal.

First, overflow: Scroll shows scrolling in any situation, overflow: Hidden is a property that hides scrolling in any situation. You can also specify horizontal and vertical scrolling with overflow-x or overflow-y.

Item
Overflow-x:scroll;
Overflow-Y:hidden
}

This means that horizontal scrolling is always visible, and vertical scrolling always hides. Usually, you can always display the scroll bar in any browser (Chrome, IE, Firefox, Opera, etc.) that you see on your desktop.

The problem is that on the desktop, the screen will only be reduced to the mobile size, and in fact, when viewed on mobile, the overflow: hidden attribute, whether or not, and always hide the scroll bar. Because you can use the::-webkit-scrollbar {-webkit-appearance: none;} property to put a style that hides the default scrollbar, you must create and apply a new scroll bar to always see the scrollbar on your mobile screen.

In the example, we'll create an HTM file that hides the vertical scrollbar and always looks like a horizontal scrollbar, and then it loads to the desired location through IFRAMEs.

<div class="item"></div>
Content


<style type="text/css"></style>
::-Webkit-scrollbar {-webkit-appearance: none;}
  /* Disable default ScrollBar */
::-webkit-scrollbar-track-piece {background-color: #e7e7e7}
  /* path except both end arrow and torso bar */
::-Webkit-scrollbar: Horizontal {height: 18px;}
  /* Change the size of the horizontal scrollbar, the width of the horizontal to vertical */
::-webkit-scrollbar-thumb {background-color: #a8a8a8; Border-radius: 10px; border: 2px solid #eeeeee;} 
  /* Actually moving torso bar */
::-Webkit-scrollbar-button {width: 16px; Background-color: #a8a8a8;}
  /* Both end arrow Parts */
::-Webkit-scrollbar-button: Start: Decrement: Horizontal {
  /* LEFT arrow portion of horizontal scroll */
  Width: 16px; height: 16px; background: #cacaca;
  Background-image: URL (/wp-content/custom/m);
  /* arrow should be to correct image */
  Background-repeat: no-repeat; background-position: center Center;}
::-Webkit-scrollbar-button: End: Increment: horizontal {
  /* Right ARROW part of horizontal scroll */
  Width: 16px; height: 16px; background: #cacaca;
  Background-image: URL (/wp-content/customm/img/img. png);
  Background-repeat: no-repeat; background-position: Center Center;}}

When you create an HTM document and import it into an IFRAME, scrolling is always visible in all browsers except the iphone, such as Samsung Internet or chrome. The reason for loading it into an IFRAME is because it determines the media rather than the object when it is loaded into the embed, so it will display this embed after blocking it from a browser such as Firefox to make it accessible to users.

To make it look even on the iphone, you need to wrap the IFRAME. When you create a scrollbar with an IFRAME, such as a safari, as well as the natural touch drag to move it stiff, and I changed the screen coordinates said the drop-down menu, and when I write the function comes back, there is a bug that is jammed, overflow the outer element of the IFRAME to prevent this bug: auto;-webkit-overflow-scrolling: Touch; .

The IFRAME should be loaded in this way.

<div style="height:100px; width:100%; overflow:auto; -webkit-overflow-scrolling:touch;"></div>

<iframe src="item.htm" class="item-iframe" src="item.htm" class="item-iframe"></iframe src="item.htm" class="item-iframe"> 
style = "width: 100%; height: 90px;"
width = "100%" height = "90px"
frameborder = "0" scrolling = "yes" >

  

The other part is to remove the minor bugs and make sure that the cross-browsing is small, and the important thing is to give the iframe a different element and wrap it with overflow: auto and-webkit-overflow-scrolling: Touch.

Does it seem to end up here? Don't look at the iphone safari. There was a drag bug that I had to modify, this time-webkit-overflow-scrolling: Touch is the problem of forcing the scroll that you created above to disappear. So, I found a few things to eat on safari like this one through the Gkkmon and the manual furnace.

<style type="text/css"></style>
  @media only Screen and (max-device-width: 22.1 e m) {
  /* To make it visible only on mobile */
. Item::-webkit-scrollbar {-webkit-appearance: none;}
  /* Remove back to Safari version */
. Item::-Webkit-scrollbar: Horizontal {height: 16px;}
  /* Size with Safari version and */
. Item::-webkit-scrollbar-track {-Webkit-box-shadow: inset 0 0 9px rgba (0, 0, 0, 0.3);} 
  /* This decoration gives a shadow to the body bar */
. Item::-Webkit-scrollbar: Horizontal {padding-left: 50px; width: 100%; Background-color: #e7e7e7;
Background-image: The URL (/wp-content/customm/img/or rarrow50png); 
  /* You need to create an arrow image with as many spaces as you want for Safari, Gkkmon-Mon has an image with an arrow at the end of the 50 pixels horizontal */
Background-repeat: repeat-x;
  /* Repeat background arrows horizontally */
Background-position: Center;}}
  /* Background arrow positioned vertically in the center */

So on an IOS safari, a background similar to a scroll bar, you can mark the right arrow at 50-pixel intervals, so that this object can be scrolled.

    The finished code

It's completely neat and not 100% satisfactory, but it's a way to intuitively express the fact that it's a scrollable object for all users. The finished code

<div class="item"></div>
Content


<style type="text/css"></style>
::-Webkit-scrollbar {-webkit-appearance: none;}
  /* Disable default ScrollBar */
::-webkit-scrollbar-track-piece {background-color: #e7e7e7}
  /* path except both end arrow and torso bar */
::-Webkit-scrollbar: Horizontal {height: 18px;}
  /* Change the size of the horizontal scrollbar, the width of the horizontal to vertical */
::-webkit-scrollbar-thumb {background-color: #a8a8a8; Border-radius: 10px; border: 2px solid #eeeeee;} 
  /* Actually moving torso bar */
::-Webkit-scrollbar-button {width: 16px; Background-color: #a8a8a8;}
  /* Both end arrow Parts */
::-Webkit-scrollbar-button: Start: Decrement: Horizontal {
  /* LEFT arrow portion of horizontal scroll */
  Width: 16px; height: 16px; background: #cacaca;
  Background-image: URL (/wp-content/custom/m);
  /* arrow should be to correct image */
  Background-repeat: no-repeat; background-position: center Center;}
::-Webkit-scrollbar-button: End: Increment: horizontal {
  /* Right ARROW part of horizontal scroll */
  Width: 16px; height: 16px; background: #cacaca;
  Background-image: URL (/wp-content/customm/img/img. png);
  Background-repeat: no-repeat; background-position: Center Center;}}


<style type="text/css"></style>
  @media only Screen and (max-device-width: 22.1 e m) {
  /* To make it visible only on mobile */
. Item::-webkit-scrollbar {-webkit-appearance: none;}
  /* Remove back to Safari version */
. Item::-Webkit-scrollbar: Horizontal {height: 16px;}
  /* Size with Safari version and */
. Item::-webkit-scrollbar-track {-Webkit-box-shadow: inset 0 0 9px rgba (0, 0, 0, 0.3);} 
  /* This decoration gives a shadow to the body bar */
. Item::-Webkit-scrollbar: Horizontal {padding-left: 50px; width: 100%; Background-color: #e7e7e7;
Background-image: The URL (/wp-content/customm/img/or rarrow50png); 
  /* You need to create an arrow image with as many spaces as you want for Safari, Gkkmon-Mon has an image with an arrow at the end of the 50 pixels horizontal */
Background-repeat: repeat-x;
  /* Repeat background arrows horizontally */
Background-position: Center;}}
  /* Background arrow positioned vertically in the center */

Save this as an HTM file, then upload it to the web.

<div style="height:100px; width:100%; overflow:auto; -webkit-overflow-scrolling:touch;"></div>

<iframe src="올린 htm 파일의 URL" class="item-iframe" src="올린 htm 파일의 URL" class="item-iframe"></iframe src="올린 htm 파일의 URL" class="item-iframe"> 
style = "width: 100%; height: 90px;"
width = "100%" height = "90px"
frameborder = "0" scrolling = "yes" >

  

Simply replace the URL and insert it where you want it.

Leave a Reply

Your email address will not be published.

Posted in All, Wordpress

이메일 구독 - Email Subs

최선을 다해 직접 만든 콘텐츠만 공유합니다.
We share the best content we have created.