Slidedown animation broken - javascript

I've a problem with my Slidedown effect, because his animation is quite broke when i try to open the menu. This is the animation broken that it gives: https://gyazo.com/450138f37f6b8e99c1e9fc452a3108e4 As you can see, the rows appear on the left and then they move quickly to the right, and that isn't what i want. I need it to work normally like a common slidedown
Here is my code, i hope that someone will be able to help me!
$("#crystal").click(function(){
$("#crystal1").slideDown(300);
$("#eventi1").slideUp(300);
$("#stanze1").slideUp(100);
});
$("#stanze").click(function(){
$("#crystal1").slideUp(100);
$("#eventi1").slideUp(300);
$("#stanze1").slideDown(300);
});
$("#eventi").click(function(){
$("#crystal1").slideUp(100);
$("#stanze1").slideUp(100);
$("#eventi1").slideDown(300);
});
.promo2{
background: none repeat scroll 0 0 #133c54;
border: 3px solid #095a87;
border-radius: 10px;
font-size: 20px;
margin-bottom: 10px;
max-height: 320px;
max-width: 520px;
padding: 10px;
text-align: center;
width: 520px;
font-family: Ubuntu Condensed;
color: #FFF;
float: left;
}
.crystals{
background: none repeat scroll 0 0 #133c54;
border: 3px solid #095a87;
border-radius: 10px;
font-size: 20px;
height: 20px;
margin-bottom: 10px;
max-height: 320px;
max-width: 520px;
padding: 10px;
text-align: center;
width: 520px;
font-family: Ubuntu Condensed;
color: #FFF;
float: left;
position: relative;
left: -10px;
top: 0px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="promo2" id="crystal">
<div style="height:auto; width:96px; height:96px; background-image:url(image/crystal2.png); float:left;"></div>
<div style="font-size: 41px;">
Ricarica Crystal + <span style="color:#f7cc02;">Promotion Point</span>
<img style="position: relative;left: 55px;top: -28px;" src="image/frecciadown.png">
</div>
<div style="display:none" id="crystal1">
<div class="crystals" id="first" style="z-index:12; top:14px;">
<span style="color:#47c5ff;"> 50 Crystal</span> + <span style="color:#f7cc02;">2 Promotion Points</span>
<img src="image/frecciaright.png" style="left: 140px; position: relative;">
</div>
<div class="crystals" style="z-index:11; top:-7px;">
<span style="color:#47c5ff;"> 150 Crystal</span> + <span style="color:#f7cc02;">5 Promotion Points</span>
<img src="image/frecciaright.png" style="left: 136px;position: relative;">
</div>
<div class="crystals" style="z-index:10; top:-27px;">
<span style="color:#47c5ff;"> 400 Crystal</span> + <span style="color:#f7cc02;">10 Promotion Points</span>
<img src="image/frecciaright.png" style="left: 132px;position: relative;">
</div>
<div class="crystals" style="z-index:9; top:-47px;">
<span style="color:#47c5ff;"> 850 Crystal</span> + <span style="color:#f7cc02;">14 Promotion Points</span>
<img src="image/frecciaright.png" style="left: 132px;position: relative;">
</div>
<div class="crystals" style="z-index:8; top:-67px">
<span style="color:#47c5ff;"> 1800 Crystal</span> + <span style="color:#f7cc02;">20 Promotion Points</span>
<img src="image/frecciaright.png" style="left: 128px;position: relative;">
</div>
<div class="crystals" style="z-index:7; top:-90px">
<span style="color:#47c5ff;"> 4000 Crystal</span> + <span style="color:#f7cc02;">30 Promotion Points</span>
<img src="image/frecciaright.png" style="left: 128px;position: relative;">
</div>
</div>
</div>

After much trial and error, I managed to fix your slidedown issue with the following changes:
Turned the div beginning with 'Ricarica' into a paragraph
Changed the crystal1 id and its contents to use an unordered list instead of a div structure
Changed border properties of the .crystals class to enhance item structure
Other minor edits
In the long run, parts of your HTML and CSS needed to be rewritten in order to have a working, smooth slidedown.
Fixed code is at http://jsfiddle.net/jkantner/grkmwyav/.

Related

How can I center align the carousel images and text correctly? [duplicate]

This question already has answers here:
Center image using text-align center?
(28 answers)
How can I center text (horizontally and vertically) inside a div block?
(27 answers)
Closed 2 years ago.
I have a carousel that is working perfectly fine as I want but I'm having trouble center aligning the image and text properly. It looks fine in small screen but is not aligned in bigger screens or smaller screens.
Also the previous and next button arrows are not aligned in the center of the background circle aswell.
HTML
<div>
<h3 style="text-align:center; padding:30px; padding-bottom:10px;">Trending now</h3>
<!-- Multi Carousel -->
<div class="prod-slider-container">
<div class="inner-container">
<div class="owl-carousel">
<div class="item">
<img src="https://www2.hm.com/content/dam/hm-magazine-2020/featured-fashion/20_13_A_trend_bildspel_1.jpg">
<p class="carosueltitletxt">
Women<br>
<span class="carosueltxt">Jackets & Coats</span>
</p>
</div>
<div class="item">
<img src="https://lp2.hm.com/hmgoepprod?set=quality%5B79%5D%2Csource%5B%2F33%2F9e%2F339e3549ec41eef34883a4fbe73e8501c36764fb.jpg%5D%2Corigin%5Bdam%5D%2Ccategory%5Bladies_cardigansjumpers_cardigans%5D%2Ctype%5BLOOKBOOK%5D%2Cres%5Bm%5D%2Chmver%5B1%5D&call=url[file:/product/main]">
<p class="carosueltitletxt">
Women<br>
<span class="carosueltxt">Cardigans &<br> Sweaters</span>
</p>
</div>
<div class="item">
<img src="https://cdna.lystit.com/photos/56a1-2014/11/06/hm-blue-jumper-in-a-mohair-blend-product-1-25065199-0-150443488-normal.jpeg">
<p class="carosueltitletxt">
Women<br>
<span class="carosueltxt">Clothes</span></p>
</div>
<div class="item">
<img src="https://i.pinimg.com/736x/32/00/a8/3200a8617dfbc6139b8251a36d5118de.jpg">
<p class="carosueltitletxt">
Kids<br>
<span class="carosueltxt">Boys 11/2-10<br> years</span></p>
</div>
<div class="item">
<img src="https://lp2.hm.com/hmprod?hmver=0&set=quality[79],source[/environment/2016/8EZ_0117_008R.jpg],width[4054],height[4740],x[549],y[438],type[FASHION_FRONT]&call=url[file:/product/main]">
<p class="carosueltitletxt">
Kids<br>
<span class="carosueltxt">Girls 11/2-10<br> years</span></p>
</div>
<div class="item">
<img src="https://i.pinimg.com/736x/b3/21/bd/b321bd9d618ee5439cd7218f9a543704.jpg">
<p class="carosueltitletxt">
Men<br>
<span class="carosueltxt">Hoodies &<br> Sweatshirts</span></p>
</div>
<div class="item">
<img src="https://media1.popsugar-assets.com/files/thumbor/Ol-YWVWUQnVmpEjhoKL6eZK0Kfo/fit-in/2048xorig/filters:format_auto-!!-:strip_icc-!!-/2014/09/11/879/n/24155406/6877ea140db7a0db_thumb_temp_image22153611410465627/i/HM-Newborn-Clothes.jpg">
<p class="carosueltitletxt">
Kids<br>
<span class="carosueltxt">Newborn 0-9<br>months</span></p>
</div>
<div class="item">
<img src="https://mk0stylisheve1cal1r6.kinstacdn.com/wp-content/uploads/2011/12/HM-Jumpers-and-Cardigans-for-Men_01.jpg">
<p class="carosueltitletxt">
Men<br>
<span class="carosueltxt">Cardigans &<br> Sweaters</span></p>
</div>
<div class="item">
<img src="https://lp2.hm.com/hmgoepprod?set=quality%5B79%5D%2Csource%5B%2F0e%2F50%2F0e50030ec7575845e95ead7a4046c4522544852d.jpg%5D%2Corigin%5Bdam%5D%2Ccategory%5Bmen_trousers_dressed%5D%2Ctype%5BLOOKBOOK%5D%2Cres%5Bm%5D%2Chmver%5B1%5D&call=url[file:/product/main]">
<p class="carosueltitletxt">
Men<br>
<span class="carosueltxt">Pants</span></p>
</div>
<div class="item">
<img src="https://i.pinimg.com/originals/b7/2a/50/b72a5020325b27dd6c053223703ee04b.jpg">
<p class="carosueltitletxt">
Kids<br>
<span class="carosueltxt">Baby Exclusive <br> 0m-4 years</span></p>
</div>
<div class="item">
<img src="https://lp2.hm.com/hmgoepprod?set=quality%5B79%5D%2Csource%5B%2Fe3%2F6c%2Fe36c9e916fdfa4b3896bfe9992889b7fa4a827ca.jpg%5D%2Corigin%5Bdam%5D%2Ccategory%5Bladies_cardigansjumpers_hoodiessweatshirts%5D%2Ctype%5BLOOKBOOK%5D%2Cres%5Bm%5D%2Chmver%5B1%5D&call=url[file:/product/main]">
<p class="carosueltitletxt">
Women<br>
<span class="carosueltxt">Hoodies & <br> Sweatshirts</span></p>
</div>
<div class="item">
<img src="https://media1.popsugar-assets.com/files/thumbor/18fWRKJF__pohskeGtu_P3dCSRE/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2020/01/08/883/n/1922564/28a69c26b18fd4bf_netimgaMezvq/i/HM-Paper-bag-Pants.jpg">
<p class="carosueltitletxt">
Women<br>
<span class="carosueltxt">Pants</span></p>
</div>
<div class="item">
<img src="https://i.pinimg.com/originals/14/ff/b0/14ffb09b1bcef167ed28a9624748e032.jpg">
<p class="carosueltitletxt">
Women<br>
<span class="carosueltxt">Accessories</span></p>
</div>
<div class="item">
<img src="https://lp2.hm.com/hmgoepprod?set=width[800],quality[80],options[limit]&source=url[https://www2.hm.com/content/dam/men_s02/september_2020/3132b/3132B-1x1-v41-the-casual-edit.jpg]&scale=width[global.width],height[15000],options[global.options]&sink=format[jpg],quality[global.quality]">
<p class="carosueltitletxt">
Men<br>
<span class="carosueltxt">Jackets & <br>Coats</span></p>
</div>
<div class="item">
<img src="https://media1.popsugar-assets.com/files/thumbor/ornsuB5wU0zsOvtIq06LKYZaN0o/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2019/06/05/932/n/1922564/201a10c4095b52d1_netimgVaH6Nm/i/HM-Linen-Shirt.jpg">
<p class="carosueltitletxt">
Women<br>
<span class="carosueltxt">Shirts &<br> blouses</span></p>
</div>
<div class="item">
<img src="https://decoholic.org/wp-content/uploads/2020/09/HM-Home-fall-2020-2.jpg">
<p class="carosueltitletxt">
H&M Home<br>
<span class="carosueltxt">New Home &<br> Interior</span></p>
</div>
</div>
</div>
</div>
CSS
/*carousel*/
.prod-slider-container {
position: relative;
font-family: font-awesome;
margin-left: 10%;
margin-right: 10%;
}
.owl-buttons {
background-color: transparent;
border: 0px none transparent;
width: 9%;
}
.owl-prev,
.owl-next {
position: absolute;
top: 37px;
}
i.fa {
cursor: pointer;
font-size: 10px;
padding-top: 0;
height: 0;
width: 0px;
color: rgba(0, 0, 4, 0.5);
}
.owl-perv {
left: -2%;
}
.owl-next {
right: 5.1%;
}
.item img {
margin-left: 10px;
margin-right: 10px;
width: 100px;
height: 100px;
border-radius: 50px;
background: #222222;
object-fit: cover;
}
.carosueltitletxt{
font-family:helvetica;
text-align:center;
color:#555555;
font-size:11px;
font-weight:bold;
}
.carosueltxt{
font-family:helvetica;
text-align:center;
color:#222222;
}
.d4-container img {
position: relative;
margin-left: 10%;
margin-right: 10%;
margin-top: 20px;
display: block;
width: 80%;
height: 400px;
object-fit: cover;
background: gray;
}
JQuery
$(document).ready(function() {
$('.owl-carousel').owlCarousel({
items: 8,
pagination:false,
itemsDesktop: [1199, 5],
itemsDesktopSmall: [979, 5],
navigation: true,
navigationText: [
"<i class='fa fa-chevron-left'></i>",
"<i class='fa fa-chevron-right'></i>"
]
});
});
Hi can you please try with this and let me know thank you.
.prod-slider-container .item a {
display: block;
margin: 0 auto;
float: none;
text-align: center;
}
To center the texts and the images, add text-align: center; to the wrapper element which is .item in this case.
You can add this text-align: center; to the second parent .owl-carousel or the third .inner-container also, that would make all the texts and images inside centered.
And for .owl-next & .owl-prev honestly, if you can't provide the live example of this carousel, I can't be specific about the solution, this is a simple try based on your provided code, hope this would help you find the solution-
.inner-container {
position: relative;
}
.inner-container .owl-prev,
.inner-container .owl-next {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.owl-prev {left: 15px}
.owl-next {right: 15px}
just use display: flex on .item class and change the value of justify-content and align items to fit your need.
like this:
.item{
display: flex;
justify-content: center;
align-items: space-around;
}

How to input value in code mirror using selenium web driver?

I'm currently facing an issue related to input values in code mirror (FYI: input is html code)
Any help much appreciated!!
This is what i was doing so far (but i need to insert values in each line of code mirror)
JavascriptExecutor js = (JavascriptExecutor)driver;
Js.executeScript("arguments[0].CodeMirror.setValue(\"" + value + "\");", driver.findElementBy(By.id("id")));
Page source code is:
<div class="CodeMirror cm-s-default">
<div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;">
<textarea wrap="off" style="position: absolute; padding: 0px; width: 1px; height: 1em; outline: medium none;" autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0"></textarea>
</div>
<div class="CodeMirror-vscrollbar" cm-not-content="true" style="min-width: 18px;">
<div style="min-width: 1px; height: 0px;"></div>
</div>
<div class="CodeMirror-hscrollbar" cm-not-content="true" style="min-height: 18px;">
<div style="height: 100%; min-height: 1px; width: 0px;"></div>
</div>
<div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div>
<div class="CodeMirror-gutter-filler" cm-not-content="true"></div>
<div class="CodeMirror-scroll" tabindex="-1" draggable="true">
<div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: 0px; border-right-width: 30px; min-height: 31px; min-width: 7px; padding-right: 0px; padding-bottom: 0px;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines">
<div style="position: relative; outline: medium none;">
<div class="CodeMirror-measure">
<span>
<span>​</span>
x
</span>
</div>
<div class="CodeMirror-measure"></div>
<div style="position: relative; z-index: 1;"></div>
<div class="CodeMirror-cursors">
<div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 22.85px;"> </div>
</div>
<div class="CodeMirror-code">
<div style="position: relative;">
<div class="CodeMirror-gutter-wrapper" style="left: -30px;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div>
</div>
<pre class=" CodeMirror-line ">
<span>
<span cm-text="">​</span>
</span>
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
So the problem is how to input value in different lines in code mirror..
Your question is not very clear but I think what you are looking for is to insert text into different lines instead of all on one line. If that's the case, you need to insert \n in your string where you want carriage returns.
An example string would be string sample = "<html>\n <test>\n</html>" which should produce
<html>
<test>
</html>
I'm able to input code mirror with line breaks, by changing the input value to this..
<html>\\r<test>\\r</html>

How to make a div content hidden when it's overflow to the right

I have this above image, I need to achieve an effect with CSS and JavaScript; on my page I allow users to add up to 12 images to their account, and all the images will be displayed in the div below.
If a user has less than 5 photos the div with red border will be hidden, and when a user has more than 5 photos the div with red border will display with the 2 arrows – one on the left and the other on the right side – and clicking the right arrow the photos will move left until it get to the last photo.
How can I achieve this with CSS and JavaScript? I tried to use overflow hidden for the div, but what I got wasn't what I needed.
Any help on this from any one?
My HTML and CSS is below:
.mycarousel-container {
border: 1px solid red;
width: 650px;
min-height: 140px;
max-height: auto;
overflow-x: hidden;
position: relative;
left: 0px;
z-index: 0;
}
#carousel_control_left {
float: left;
margin-top: 60px;
color: #b0b0b0;
font-size: 18px;
}
#carousel_control_right {
float: right;
margin-top: 60px;
color: #b0b0b0;
font-size: 18px;
}
.mycarousel {
border: 1px solid #ccc;
width: 102px;
height: 102px;
margin: 15px 15px 15px 4px;
float: left;
border-radius: 2px;
}
<div class="row">
<div class="col-md-12">
<div><small class="text-muted">This listing has 6 photos. Add up to 6 more for free.</small>
</div>
<div class="mycarousel-container" style="padding-left:0;padding-right:0;">
<span id="carousel_control_left"><i class="glyphicon glyphicon-chevron-left"></i></span>
<span id="carousel_control_right"><i class="glyphicon glyphicon-chevron-right"></i></span>
<div class="mycarousel">
<img src="1465929515_Money.png" class="img img-thumbnail">
</div>
<div class="mycarousel">
<img src="1465929515_Money.png" class="img img-thumbnail">
</div>
<div class="mycarousel">
<img src="1465929515_Money.png" class="img img-thumbnail">
</div>
<div class="mycarousel">
<img src="1465929515_Money.png" class="img img-thumbnail">
</div>
<div class="mycarousel">
<img src="1465929515_Money.png" class="img img-thumbnail">
</div>
</div>
</div>
</div>
The link to jsFiddle
Might I suggest not adding those two arrows and letting the browser do the work for you?
Just set overflow-x: auto on the containing div. This will enable scrolling, so all the native capability (such as two-finger swiping) will work in the way that the user expects it for the platform they're on. This is a much better solution than reinventing UI components in ways that users don't expect.

sticky div switches sides when fixed position added via JavaScript

I'm trying to implement a sticky div that is always present in the view when scrolling. My javascript code works fine, and the div is indeed scrolling with the page. The problem is when I apply position: fixed; to the my sticky div of class scrolling-panel, it switches position from the right of the page (the original position) to the left.
Here is my HTML (most relevant part, still a lot of markup though)
<div class="container">
<div class="main-container">
<div class="row">
<div class="col-md-12">
<img id="brand-logo" src="images/logo.png">
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="container">
<img id='slider-img' src='images/img1.png'>
<div id='left_holder'><img onclick="slider(-1)" class='left' src="images/arrow_left.png"></div>
<div id='right_holder'><img onclick="slider(1)" class='right' src="images/arrow_right.png"></div>
</div>
</div>
</div>
<div class="scrolling-panel">
<h3>Get Started</h3>
<h3>$45</h3>
<p>Join the Club for exclusive pric- ing. See a new box each month and skip if it’s not for you.</p>
<button class="btn btn-success"><small>Join the club + get refresh</small></button>
<p>Want Refresh without joining?
Quick Buy for $55.</p>
</div>
<div class="row">
<div class="col-md-8">
<div class="para-intro">
<h1>REFRESH</h1>
<p>Time to toss the cheap plastic bags -- your dopp kit should be
as composed as the rest of your travel getup. Our friends at
Men’s Journal helped us bring back this classic. Get ready to
breathe new life into your bathroom cabinet and carry-on.</p>
</div>
</div>
<div class="col-md-8">
<div class="sm-content-list">
<ul class="ul-content-list">
<li>DOPP KIT<br>
<span class='doppkit-value'>10"X6"X4"</span></li>
<li>DOUBLE HITTER<br>
2-IN-1 SHAMPOO &<br>
CONDITIONER<br>
<span class='doppkit-value'>8.5oz</span></li>
<li>CLEAN CUT<br>
SEMI-MATTE<br>
STYLING CREAM<br>
<span class='doppkit-value'>3.0oz</span></li>
<li>HANDMADE GOLD<br>
MOSS SOAP<br>
<span class='doppkit-value'>5.0oz</span></li>
<li>FACE WASH<br>
<span class='doppkit-value'>4.4oz</span></li>
<li>LOTION<br>
0.75oz</li>
<li>BODY POWDER<br>
<span class='doppkit-value'>1.0oz</span></li>
</ul>
</div>
<!-- <div class="col-md-5"> -->
<div class="dopp-kit">
<h5>DOPP KIT, <span class='company-color'>BLUE CLAW CO.</span></h5>
<p>Blue Claw's Dopp bag is as resistant to blending in as it is to
wearing down. Designed exclusively for Bespoke, each bag
was painstakingly handcrafted in the good old US of A. The
waterproof exterior is crafted from heavy, 15oz waxed
canvas sourced from family mills in the heartland, while
the full-grain leather handle and pull tab, bronze rivets and
zipper, and signature blue ballistic nylon lining boast a
rugged simplicity. Americana at its best.</p>
<h5>DOPP KIT, <span class='company-color'>BLUE CLAW CO.</span></h5>
<p>Blue Claw's Dopp bag is as resistant to blending in as it is to
wearing down. Designed exclusively for Bespoke, each bag
was painstakingly handcrafted in the good old US of A. The
waterproof exterior is crafted from heavy, 15oz waxed
canvas sourced from family mills in the heartland, while
the full-grain leather handle and pull tab, bronze rivets and
zipper, and signature blue ballistic nylon lining boast a
rugged simplicity. Americana at its best.</p>
<h5>DOPP KIT, <span class='company-color'>BLUE CLAW CO.</span></h5>
<p>Blue Claw's Dopp bag is as resistant to blending in as it is to
wearing down. Designed exclusively for Bespoke, each bag
was painstakingly handcrafted in the good old US of A. The
waterproof exterior is crafted from heavy, 15oz waxed
canvas sourced from family mills in the heartland, while
the full-grain leather handle and pull tab, bronze rivets and
zipper, and signature blue ballistic nylon lining boast a
rugged simplicity. Americana at its best.</p>
</div>
</div>
<div class="col-md-8">
<div class="tabbed-interface">
<div class="appearing-content">
<p>Blue Claw's Dopp bag is as resistant to blending in as it is to wearing down. Designed exclusively for Bespoke, each bag was painstakingly handcrafted in the good old US of A.</p>
</div>
</div>
<div class="clickable-links">
<a class='links-toggle'>blabla</a>
<a class='links-toggle'>blabla</a>
<a class='links-toggle'>blabla</a>
</div>
<div class="changing-para">
<p>Blue Claw's Dopp bag is as resistant to blending in as it is to wearing down. De- signed exclusively for Bespoke, each bag was painstakingly handcrafted in the good old US of A. The waterproof exterior is crafted from heavy, 15oz waxed canvas sourced from family mills in the heartland, while the full-grain leather handle and pull tab, bronze rivets and zipper, and signature blue ballistic nylon lining boast a rugged simplicity. Americana at its best.</p>
</div>
</div>
</div>
<div class='media-objects'>
<h3> From The Post </h3>
<div class="row">
<div class="col-md-3">
<div class="media">
<div class="media-left">
<img class="media-object" src="images/smallimage.png" alt="...">
</div>
<div class="media-body">
<br>
<p>The Perfect Side Part for any Hair Type</p>
</div>
</div>
<div class="media">
<div class="media-left">
<img class="media-object" src="images/smallimage.png" alt="...">
</div>
<div class="media-body">
<br>
<p>Grooming Tips</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="media">
<div class="media-left">
<img class="media-object" src="images/smallimage.png" alt="...">
</div>
<div class="media-body">
<br>
<p>How Soap is Made</p>
</div>
</div>
<div class="media">
<div class="media-left">
<img class="media-object" src="images/smallimage.png" alt="...">
</div>
<div class="media-body">
<br>
<p>Behind the Scenes with Sasquatch Soap</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="media">
<div class="media-left">
<img class="media-object" src="images/smallimage.png" alt="...">
</div>
<div class="media-body">
<br>
<p>Blue Claw's Adam Blitzer Talks Design</p>
</div>
</div>
<div class="media">
<div class="media-left">
<img class="media-object" src="images/smallimage.png" alt="...">
</div>
<div class="media-body">
<br>
<p>How To Shine Your Shoes</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
CSS (also using bootstrap for its grid system):
p {
font-family: times;
font-size: 15px;
}
#container {
height: 400px;
width: 650px;
margin: 20px auto 35px auto;
position: relative;
}
.main-container {
margin: 40px 130px 40px 130px;
border: solid black 1px;
}
#slider-img {
height: 400px;
width: 650px;
position: absolute;
}
#left_holder {
height: 400px;
width: 100px;
position: absolute;
left: 0px;
top: 0px;
}
#right_holder {
height: 400px;
width: 100px;
position: absolute;
right: 0px;
top: 0px;
}
.left {
height: 50px;
width: 50px;
position: absolute;
top:40%;
left: 0px;
}
.right {
height: 50px;
width: 50px;
position: absolute;
top:40%;
right: 0px;
}
img#brand-logo {
margin-top: 25px;
margin-left: auto;
margin-right: auto;
display: block;
height: 12px;
width:120px;
}
.para-intro {
margin-left: 110px;
}
.para-intro h1 {
margin-top: 0px;
}
.sm-content-list {
background-color: rgb(240,240,234);
margin-left: 110px;
float: left;
margin-right: 10px;
margin-bottom: 10px;
}
ul.ul-content-list {
list-style-type: none;
margin: 0px;
padding: 5px 8px 5px 8px;
}
.ul-content-list li {
font-size: 8px;
font-weight: 600
}
.dopp-kit {
margin-left: 110px;
}
.dopp-kit h5 {
margin-bottom: 2px;
margin-top: 0px;
}
.tabbed-interface {
background-color: blue;
margin-top: 20px;
margin-left: 110px;
height: 250px;
width: 450px;
}
.clickable-links a {
text-align: center;
display: inline-block;
margin-left: 110px;
color: rgb(204,204,204);
hover: none;
}
.clickable-links {
text-align: center;
margin-top: 10px;
}
.changing-para {
margin-left: 110px;
margin-bottom: 20px;
margin-top: 30px;
}
.media-objects {
margin-left: 110px;
margin-bottom: 30px;
}
.media-objects h3 {
margin-bottom: 30px;
}
.media-objects p {
font-size: 12px;
}
.scrolling-panel {
background-color: rgb(240,240,234);
height: 270px;
width: 170px;
float: right;
margin-right: 115px;
text-align: center;
}
.scrolling-panel p {
font-size: 10px;
}
.company-color {
color: rgb(153,66,60);
}
.doppkit-value {
color: rgb(151,151,151);
}
.appearing-content {
color: white;
float: bottom;
}
.stick {
margin-right: 115px;
position:fixed;
top:0px;
}
Javascript for the sticky scrolling-panel div:
$(document).ready(function() {
var s = $(".scrolling-panel");
var pos = s.position();
$(window).scroll(function() {
var windowpos = $(window).scrollTop();
if (windowpos >= pos.top) {
s.addClass("stick");
} else {
s.removeClass("stick");
}
});
});
Let me know if I haven't been clear enough and/or if you need more information
Instead of margin-right on the element (in .stick class) use a right value.
Here's a fiddle example

CSS behaving abnormally

So I am trying this for one day but I am still not able to do it. I have created a new index page for my website. I have copied code from my previous homepage.
If you see the sliders on the left(first homepage) and on the right(new homepage). You could see that on the new homepage the sliders are behaving abnormally. I can't figure out in my CSS why is this happening.
I have tried this:
<div id="testimonial">
<div id="black_title">
<h1>Bead X Testimonials</h1>
</div>
<div class="bx-wrapper" style="max-width: 100%;">
<div class="bx-viewport" style="width: 100%; overflow: hidden; position: relative; height: 232px;">
<ul class="slide_left" style="width: 415%; position: relative; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-288px, 0px, 0px);">
<li style="float: left; list-style: none; position: relative; width: 248px;" class="bx-clone">
<iframe src="//player.vimeo.com/video/73331040" width="258" height="207" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe> The Bead X Difference
</li>
<li style="float: left; list-style: none; position: relative; width: 248px;">
<img src="images/test_img.png"> The Bead X Difference
</li>
<li style="float: left; list-style: none; position: relative; width: 248px;">
<iframe src="//player.vimeo.com/video/73331040" width="258" height="207" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe> The Bead X Difference
</li>
<li style="float: left; list-style: none; position: relative; width: 248px;" class="bx-clone">
<img src="images/test_img.png"> The Bead X Difference
</li>
</ul>
</div>
<div class="bx-controls bx-has-pager">
<div class="bx-pager bx-default-pager">
<div class="bx-pager-item">1
</div>
<div class="bx-pager-item">2
</div>
</div>
</div>
</div>
<div class="navigation">
<!-- <p><span id="left-prev"></span> <span id="left-next"></span></p> -->
<div id="left-prev">
<a class="bx-prev" href=""><img src="images/slider_prev.png" height="25" width="25"></a>
</div>
<div id="left-next">
<a class="bx-next" href=""><img src="images/slider_next.png" height="25" width="25"></a>
</div>
<div id="read_more"> View all
</div>
</div>
</div>
By abnormally I mean, that the text below the images in the slider is getting overflown and the controls of the slider are messed up.
But the result is still weird. How to resolve this?
Unfortunately there are quite a few issues going on here that you will have to deal with. First it looks like that "Wax Daddys Promise" pane is an image with at Width of 269px yet the column you are trying to align is 275px so it will not fill that area correctly to give you good lines.
The .testimonial class margins are all out of place.
#testimonial {
text-align: center;
width: 95%;
height: 310px;
background: white;
border: 4px solid rgb(209, 209, 209);
margin: 15px 2px 2px 17px;
}
You should use:
margin: 15px 0 0 0;
or better yet:
margin-top: 15px;
And that is just to give yourself a top buffer. If you give the same to each of the testimonial classes or just use class="testimonial" on all of those you'll get the top separation.
That should help a bit. In the future you may want to look into bootstrap, makes grid layout really easy without having to get deep with custom styling. Hope that helps.
You will still need to do a bit of formatting to clean up the layout, but this should help you resolve some of the issues:
Modified CSS:
#read_more { float: right; }
.bx-next, .bx-prev { padding: 0px; }
#left-next, #left-prev { float: left; }
.bx-pager { padding: 0px; position: relative; top: 0; }
Also, add a clear fix after your #read_more and after your .bx-controls DIVs:
<div style="clear: both;"></div>

Categories

Resources