logo
down
shadow

Getting divs in the right postion


Getting divs in the right postion

By : slvolz
Date : November 22 2020, 10:38 AM
hope this fix your issue Remove the position: absolute; setting from the .card-container .card>div style and add
code :
.card-container .card .back {
    top: 0;
    left: 0;
    position: absolute;
}


Share : facebook icon twitter icon
How to make two divs overlap without knowing the absolution postion

How to make two divs overlap without knowing the absolution postion


By : sshNoooooob
Date : March 29 2020, 07:55 AM
will help you If you position div I relatively within div II, you can draw it "outside" div II by using negative margin. For example:
code :
.divi {
    width: 200px;
    height: 70px;
    margin-top: -40px;
    margin-left: 30px;
}
How to postion two centered DIVs overlapping each other and be responsive?

How to postion two centered DIVs overlapping each other and be responsive?


By : allenblue
Date : March 29 2020, 07:55 AM
help you fix your problem Here we go,
Live Example
code :
.images {
    width: 100%;
    position: relative;
    max-width: 354px;
    margin: 0 auto;
}

.images img {
    position: absolute;
    top: 0;
    width: 100%;
    max-width: 354px;
}
 $(document).ready(function() {    
      $('.images').on('mouseenter', function(){
          $('.images .old').fadeOut(1000);
      }).on('mouseleave', function(){
          $('.images .old').fadeIn(1000);
      });
 });
<div class="images">
    <img class="new" src="http://quaystreet.chrisloughnane.net/images/quay-street-new.jpg">
    <img class="old" src="http://quaystreet.chrisloughnane.net/images/quay-street-old.jpg">    
</div>
.insertBefore() Switch postion (HTML) between 2 divs

.insertBefore() Switch postion (HTML) between 2 divs


By : Mehdi
Date : March 29 2020, 07:55 AM
this one helps. Starting from this good solution https://stackoverflow.com/a/698386/975520 you can made up your own jQuery function to handle the switch capabilities.
Here is the code:
code :
jQuery.fn.swapWith = function(to) {
    return this.each(function() {
        var copy_to = $(to).clone(true);
        var copy_from = $(this).clone(true);
        $(to).replaceWith(copy_from);
        $(this).replaceWith(copy_to);
    });
};
$(document).ready(function () {
    $('.x5').swapWith('.x2');
});
Postion Divs inside a container using bootstrap

Postion Divs inside a container using bootstrap


By : Scott
Date : March 29 2020, 07:55 AM
I wish this helpful for you I was designing a website. I am having some issue on the Faculties Page. The Issue is as Follows. , Not possible with your current markup which is like below...
code :
.item {
  margin-bottom: 10px;
  border: 5px solid #fff;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="row d-flex justify-content-center align-items-start">
  <div class="item text-light wow fadeInUp bg-dark col-5" style="height:150px;"></div>
  <div class="item text-light wow fadeInUp bg-dark col-5" style="height:100px;"></div>
  <div class="item text-light wow fadeInUp bg-dark col-5" style="height:100px;"></div>
  <div class="item text-light wow fadeInUp bg-dark col-5" style="height:100px;"></div>
</div>
.item {
  margin-bottom: 10px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="row d-flex justify-content-center align-items-start">
  <div class="col-5">
    <div class="item text-light wow fadeInUp bg-dark" style="height:200px;"></div>
    <div class="item text-light wow fadeInUp bg-dark" style="height:100px;"></div>
  </div>
  <div class="col-5">
    <div class="item text-light wow fadeInUp bg-dark" style="height:100px;"></div>
    <div class="item text-light wow fadeInUp bg-dark" style="height:100px;"></div>
  </div>
</div>
OnClick on 0th index postion of recyclerview adapter item it also select the 7th index postion then 14th like this. Belo

OnClick on 0th index postion of recyclerview adapter item it also select the 7th index postion then 14th like this. Belo


By : user3085654
Date : March 29 2020, 07:55 AM
hop of those help? Ok so the issue happens due to the fact that the RecyclerView recycles the viewholders.
Now your onClickListener will set the stuff on your viewholder but what happens is that when it is recycled, it is not going to be called again so the old layout still gets shown is for your case position 7 etc.
code :
private int answerClicked;
    holder.answerOneLL.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            Log.d(TAG, "position in question one -->> " + String.valueOf(position));

                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                    startTestDetailsModel.getResult().get(position).setAnswerClicked(1);
                    holder.answerOneRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle_solid));
                    holder.answerTwoRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                    holder.answerThreeRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                    holder.answerFourRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));

                    notifyDataSetChanged();  //facepalm for me forgetting this
                }


        }
    });




    holder.answerTwoLL.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                startTestDetailsModel.getResult().get(position).setAnswerClicked(2);
                holder.answerOneRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerTwoRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle_solid));
                holder.answerThreeRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerFourRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));

              notifyDataSetChanged();
            }
        }
    });


    holder.answerThreeLL.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                startTestDetailsModel.getResult().get(position).setAnswerClicked(3);
                holder.answerOneRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerTwoRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerThreeRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle_solid));
                holder.answerFourRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));

              notifyDataSetChanged();
            }
        }
    });


    holder.answerFourLL.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                startTestDetailsModel.getResult().get(position).setAnswerClicked(4);
                holder.answerOneRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerTwoRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerThreeRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerFourRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle_solid));

             notifyDataSetChanged();
            }
        }
    });
  if(startTestDetailsModel.getResult().get(position).getType().equals("question") && startTestDetailsModel.getResult().get(position).getAnswerClicked()==1){
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                    holder.answerOneRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle_solid));
                    holder.answerTwoRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                    holder.answerThreeRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                    holder.answerFourRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                }
  }else if(startTestDetailsModel.getResult().get(position).getType().equals("question") && startTestDetailsModel.getResult().get(position).getAnswerClicked()==2){
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                holder.answerOneRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerTwoRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle_solid));
                holder.answerThreeRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerFourRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
            }
  }else if(startTestDetailsModel.getResult().get(position).getType().equals("question") && startTestDetailsModel.getResult().get(position).getAnswerClicked()==3){
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                holder.answerOneRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerTwoRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerThreeRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle_solid));
                holder.answerFourRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
            }
  }else if(startTestDetailsModel.getResult().get(position).getType().equals("question") && startTestDetailsModel.getResult().get(position).getAnswerClicked()==4){
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                holder.answerOneRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerTwoRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerThreeRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle));
                holder.answerFourRB.setBackground(context.getDrawable(R.drawable.round_answer_cricle_solid));
            }
  }
Related Posts Related Posts :
  • IE7, IE8 support for css3 media query
  • Gradient ends are blurry when using pixel measurements
  • display bootstrap popovers outside divs with overflow:hidden
  • How to make a non responsive site by using Bootstrap?
  • Selecting an element that doesn't have a child with a certain class
  • Embedded Twitter Widget Height issue
  • Twitter Bootstrap - How to get buttons to be block level only on extra small and small devices
  • How can I add a vertical scrollbar to my div automatically?
  • Trouble changing the link font color using typography.js in gatsby
  • Nesting up scss with main.scss and subcomponent scss files
  • Why does my FontSquirrel font not work?
  • Div positioning (overlays when not wanted)
  • Align button vertically in alert field
  • CSS: display: flex and text ellipsis on the same element
  • Fixed position buttons appearing in incorrect area depending on browser
  • CSS-menu issue in angular project
  • Responsive Website - general enquiries
  • Webkit Scrollbar Buttons only showing horizontal
  • explicitly set a field's width in css to "no-auto"
  • Jekyll accessing page variables from CSS
  • Why did my #wrapDesktopNavBar disappear on desktop view?
  • CSS Menu Multiple Hover Colo(u)rs
  • Line-height works differently on Mac and Windows
  • Resizing an image at will with CSS?
  • CSS Naming Best Practice in MVC Layouts
  • FireFox & Chrome CSS Differs
  • Gradient Border Causing the Border to Disappear
  • How to hide column label on google chart
  • How to change H3 color in bootstrap using CSS file
  • CSS How to align checkbox image
  • css3 jagged edge on left isntead of right
  • display text in a horizontal line , using ng-repeat and bootstrap
  • Css right top corner
  • Bootstrap keep button other border gradient when removing border-left
  • Rails 4: Sass raises SyntaxError when precompiling assets on server but not on development computer
  • Boostrap css file overrode my css file
  • Why are placeholder selectors inside @keyframes valid .scss?
  • Create a 4x4 responsive grid of squares with a margin of 20px on each side of the container?
  • CSS Not Selector: Select All Except Inside of Element
  • CSS Intellisense for files not in solution
  • Overlapping Anchor Tags When Hovering Over One
  • Any way to keep Susy from changing font-size automatically?
  • In Chrome’s user agent stylesheet, why use "-webkit-margin-before" et al instead of just "margin-top"
  • Responsive slanted border
  • SCSS variables - same name, different value in different media breakpoints
  • How to create overlay over div without defining it in HTML
  • Using negative values fails the execution in SASS
  • up/down arrow key issue with typeahead control (angular bootstrap UI)
  • increase size of search terms in a magento site by applying css class-name
  • Inline elements not collapsing whitespace before the end of the tag, in modern browsers?
  • Avoid outline of button when clicked
  • How to add a repeating png image in the background of a webpage using CSS?
  • Heading text displaying at the center instead of displaying in the statring line in asp.net application
  • Div fixation with his mother
  • Sentence is not taking /n
  • Wordpress mobile devices logo resize
  • Why a div with higher z-index is not visible (covered)?
  • HTML5 How to align a table to center inside a form?
  • Why is my clip-path not working when it's source is an svg?
  • Flex-box sticky footer with inner flex-box container with y axis scrolling
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org