logo
down
shadow

How can I stop my parallax div having a blurred background?


How can I stop my parallax div having a blurred background?

Content Index :

How can I stop my parallax div having a blurred background?
Tag : html , By : Jojo
Date : January 11 2021, 03:32 PM

may help you . As per MDN, background-attachment: fixed fixes the background relative to the viewport rather than the container - the function becomes a little more apparent from the little demo that you can see on the top of the page (see how the background remains fixed regardless of both scrollbar positions).
Depending on your exact use case, you could either pick an image that accounts for this, or use background-size + background-position relative to viewport sizes.
.container {
  width: 100%;
}

.column1,
.column2 {
  width: 50%;
  float: left;
  height: 1200px;
}

.parallax {
  position: relative;
  height: 450px;
  background-attachment: fixed;
  background-size: 50%;
  background-position: right center;
  background-image: url('https://i.ibb.co/mXPXj7Y/gridimage6.jpg');
}
<div class="container">
  <div class="column1">
    text
  </div>
  <div class="column2">
    <div class="parallax">
    </div>
  </div>
</div>
/* important: otherwise you'll have a "border" around the page */
body { margin: 0; }

/* important: must encompass the page; scrolls instead of original body element and applies parallax */
.container {
  width:100%;
  perspective: 1px;
  transform-style: preserve-3d;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: scro
  ll;
}

/* not important: columns from the original example */
.column1, .column2 {
  width:50%;
  height:1200px;
  float:left;
}

/* makes sure that you can only see the parallax element through its "window" */
.clipper {
  width: 450px;
  height: 425px;
  overflow: hidden;
}

.parallax {
  /* important; figure out a good scale yourself */
  transform: translateZ(-1px) scale(3);
  /* not important: whatever we were going to show here */
  height: 450px;
  width:425px;
  background-image: url('https://i.ibb.co/mXPXj7Y/gridimage6.jpg');
}
<div class="container">
  <div class="column1">
    (irrelevant text in left column)
  </div>
  <div class="column2">
    (...some text before the parallax element so that you can see the effect better)
    <br><br><br><br><br><br><br><br>
    (...more text and a few linebreaks)
    <div class="clipper">
      <div class="parallax">
      </div>
    </div>
    (some text after)
  </div>
</div>

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

BLUR a div background with opacity (page background seems blurred through div)


Tag : javascript , By : tayles
Date : March 29 2020, 07:55 AM
I wish this helpful for you You'd have a much easier job doing the Windows 7 UI without Aero :)
That being said, I recommend using the Pixastic Library.

Parallax stop background image pos change if scroll exceeds bg image size


Tag : javascript , By : barefootChild
Date : March 29 2020, 07:55 AM
this one helps. orgH and orgW will be 0 on execution, since you are creating a new Image asynchronously, while executing your code synchronously:
var tmpImg = new Image();
tmpImg.src = bg;
//...
tmpImg.onload = function(ev) {
    var orgW = tmpImg.width;
    var orgH = tmpImg.height; 
    //and the rest of your code...
}

Parallax background image scroll without using css background property


Tag : html , By : Pat
Date : March 29 2020, 07:55 AM
wish of those help Some time ago, I built these two examples with a parralax effect very similar to what you are looking for:
this example using simple jQuery to update the position of the image and title on scroll this example using only CSS with 3D positioning to simulate the parralax effect on the image
$( document ).ready(function() {
var $window = $(window);
function scroll_elements(){
  var scroll = $window.scrollTop();
  var scrollLayer = scroll/1.4;
  
  $(".project-image").css(
    "-webkit-transform","translate3d(0," +  scrollLayer  + "px,0)",
            "transform","translate3d(0," +  scrollLayer  + "px,0)"
  );
}

$window.scroll(scroll_elements);
});
.project-image {
  position:relative;
  z-index:1;
}
.img-responsive {
  display:block;
  max-width:100%; 
  height:auto;
  margin:0 auto;
}
h1, .project-description {
  position:relative;
  max-width:500px;
  z-index:2;
  background:rgba(255,255,255,.7);
  margin:0 auto;
  padding:10px 20px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="project-details">
  <div class="project-image">
   <img src="http://placehold.it/350X225" class="img-responsive">
  </div>  
  <h1>
  Project Title
  </h1>
  <p class="project-description">
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  <br/>
  <br/>
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  <br/>
  <br/>
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  </p>
</div>

Stop blurred header image from being slightly see-through


Tag : css , By : user170635
Date : March 29 2020, 07:55 AM
it helps some times I'm working on a header that shrinks down to 40px + blurs the background-image when you scroll which works fine, however when i do scroll, because of the blur, you can kind of see content peaking through the blurred header as you go down the page. I'm still learning all of the css transitions and filters, so I was wondering if there's a way to prevent this? , You need to lessen the amount of blur from 10px to around 3-5px;
.blur-header{
   height:40px;
   -webkit-filter: blur(3px) brightness(1);
   -moz-filter: blur(3px) brightness(1);
   -o-filter: blur(3px) brightness(1);
   -ms-filter: blur(3px) brightness(1);
   transition: all 0.3s ease-in-out;
}

Background application UI has to become blurred when the user sends the foreground app to background by pressing the dev


Tag : android , By : John R
Date : March 29 2020, 07:55 AM
this one helps. Set this in onCreate method between super.onCreate(savedInstanceState) and setContentView:
 // White image on recent apps overview and disable screenshot functionality
 window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
Related Posts Related QUESTIONS :
  • How to make an icon/span selectable by pressing Tab key?
  • Add dynamic margins using UI Kit
  • Add margin-top to textbox
  • What is the correct semantic HTML markup for a title (book, movie, etc.), according to the spec? Is it an <em> tag
  • How to make an animation in Geoserver or in Leaflet
  • Buttons overlapping when shrinking window
  • Stretch an element to the end of the automatically calculated grid, not just the explicit grid
  • What relation is there between Angular's <ng-content> and ShadowDOM
  • CSS background for div element is not working
  • CSS Marquee: multiple paragraphs overlaps
  • I want to align search bar to extreme right
  • Getting blank white space to the left of content inside pre tags
  • My viewer.html won't load any css and jss files
  • How to apply multiple styles to HTML to only part of a title?
  • Want to make text div transparent on a parallax area
  • Is there a way to make this ID plus descendants CSS rule less specific?
  • Is there a way to drop in a stylesheet to get a Material theme or similar for all form elements on the page?
  • How do I make a sideways L look in html/css?
  • Why won't the color #e67d22e1 display in Safari?
  • How to select specific tag's attribute value with xPath?
  • How to make div rows fill available height
  • How to fix text inside a block that grows
  • svg hexagon halftone pattern
  • How to edit a website's element's background colors using a chromium extention
  • What is the main tag in HTML5 ? How does it differ from body tag?
  • My image is flowing out from my div column. How I can fix it and made the image full-size into div
  • How to draw line in react
  • Why Transition css is not working in child selector css
  • How to modify materialize css select option?
  • How to center some text in a rectangle in CSS?
  • How do I equally space out css grid columns?
  • How to make sure all the parts of a macro are running correctly?
  • How to adjust the zoom of website at different browser at different screen size?
  • Can't set max height on child div properly
  • Why background color is not applying to DIV container?
  • Need to select the first-child
  • No space between attributes in buttons
  • How can I block google from crawling my page, but still let Baidu do it?
  • Rendering html content in matToolTip (Angular)
  • Embedding an iframe when iframe height is variable
  • How to use 'word-break: break-word' with link inside of text?
  • How I can animate circular progress bar from left to right?
  • Angular 6 - How can I hide a div onclick of outside of that div
  • How to fill an inline-block div with a solid color?
  • Form file doesn't align with rest of form
  • How to trim off left and right sides of image evenly as I reduce my screen size? (@media query)
  • How can I password protect a section of a static website?
  • Move a div up when I hover over it
  • Why is "align" not a valid attribute of div but still works?
  • Behavior with height/minHeight and display:flex
  • How can i change my h2 title to <p> text while keeping size and alignment?
  • Hover on the text to change size using CSS
  • How to keep a grid of cols without breaking on a new row?
  • Why is bottom: 0 not enough to move ::after content directly below main content?
  • Why does a React build need to be served? Why can't I just open it in the browser?
  • What is the proper way to target the tab key 'highlight' events on an html element?
  • How to Implement dot and line below the text in CSS?
  • DIVs not properly aligned
  • HTML 'for' tag not working for <p> but works on <label>
  • <p> element does not appear to be within parent <footer> element
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com