Infinitive scrolling of child elements [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Is there a way i can make the scrolling continue from the first box instead of ending at the 8th box?
Or making overflow hidden and adding one button each at the left and right which will make the slide continue from the first box after reaching the 8th box?
.slide-container{
display: flex;
width: max-content;
}
.box{
width: 300px;
height: 100px;
background-color: green;
margin-right: 5px;
}
<div class="slide-container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
<div class="box">4</div>
<div class="box">5</div>
<div class="box">6</div>
<div class="box">7</div>
<div class="box">8</div>
</div>

Related

cant remove underline from <p> [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 9 months ago.
Improve this question
I tried many solutions to remove the text-decoration from p but without any progress.
The HTML looks like this
<div class="container-fluid my-container align-items-center">
<div class="row my-row">
<div class="col-md-3 ">
</div>
<div class="col-md-9 ">
<div class="thumbnail d-flex justify-content-center imagePreview">
<a href="#############" target="_blank">
<img src="../assets/img/thumbnails/Apelles_230x177cm_2020__.jpg" alt="" style="width:400px;">
<div class="caption">
<!--########### Here is the p-->
<p id="captionStyle">Apelles<br>2020</p>
</div>
</a>
</div>
Browsers automatically add underscores to links for accessibility. To clear it, you can use reset.css or write this snippet:
a { text-decoration: none }
P.S. You can search CSS Reset, Normalize, and browser styles for more information.

How to get JSON text to HTML? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
How Can I add these JSON values to text field in HTML.
JSON:
"data": [
{
"zamestnanci": "3",
"konvoje": "0",
"pozice": "1533",
"kilometry": "5445"
}]}
I need add these 4 values to these 4 text fields:
<div class="counter-item">
<h2>here value 1</h2>
<h6>Odjeté konvoje</h6>
</div>
<div class="counter-item">
<h2>here value 2</h2>
<h6>Odjeté konvoje</h6>
</div>
<div class="counter-item">
<h2>here value 3</h2>
<h6>Pozice</h6>
</div>
<div class="counter-item">
<h2>here value 4</h2>
<h6>Najeté kilometry</h6>
</div>
You can use jQuery to select h2 child in class counter-item, and assign value to it.
Please refer below CodingGround URL:
http://tpcg.io/MFiJda

Javascript: How to randomize images on page load [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm creating a one page website right now and I want to add an randomize image every time that the page was load. Before I'm using PHP to randomized my carousel by using ORDER BY rand() while selecting data. Right now I am looking for a javascript code to randomized images NOT USING ANY DATABASE. I accept any suggestion, my code are the following below:
<!-- start home -->
<section id="home">
<div class="container">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<h1 class="wow fadeIn" data-wow-offset="50" data-wow-delay="0.9s">We make paper products that are <span>awesome</span></h1>
<div class="element">
<div class="sub-element">Hello, this is WhatWeAre</div>
<div class="sub-element">Paper for everyone</div>
<div class="sub-element">Contact us and we make your products while conserving environment </div>
</div>
<a data-scroll href="#about" class="btn btn-default wow fadeInUp" data-wow-offset="50" data-wow-delay="0.6s">GET STARTED</a>
</div>
</div>
</div>
</section>
<!-- end home -->
<style type="text/css">
#home{
background: url('../images/home_1.jpg') no-repeat;
background-size: cover;
padding-top: 160px;
padding-bottom: 100px;
min-height: 650px;
}
</style>
Okay, I got an answer with some sites. Not making any changes with my CSS stylesheet and NOT even using database. Here the following codes:
<script type="text/javascript">
if (document.getElementById) {
window.onload = swap
};
function swap() {
var numimages=7;
rndimg = new Array("images/home.jpeg","images/home-bg.jpg","images/home_1.jpg");
x=(Math.floor(Math.random()*numimages));
randomimage=(rndimg[x]);
document.getElementById("home").style.backgroundImage = "url("+ randomimage +")";
}
</script>

Sidebar with pictures and a scroll bar [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I was wondering if there was a way of making a side bar with js, html or bootstrap that has a single row of images under drop down tabs with its own scroll bar. I hope i'm specific enough and you get a rough idea of what i would like to achieve
I'm not asking for you to write code just to be pointed in the right direction
Bootstrap makes this all possible, all of the info you need to build the tabs is available here. Obviously you need to call in the Bootstrap JS and CSS file into your HTML page.
To make a .tab-pane area scrollable add overflow:auto;. Add white-space: nowrap; to make your images inside that tab run horizontally.
Demo on Codepen.
Hope that points you in the right direction.
aside {
width: 300px;
}
#one {
overflow: auto;
white-space: nowrap;
}
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<aside>
<ul class="nav nav-tabs">
<li>One</li>
<li>Two</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="one">
<img src="http://placehold.it/200x50">
<img src="http://placehold.it/300x50">
<img src="http://placehold.it/400x50">
<img src="http://placehold.it/100x50">
<img src="http://placehold.it/50">
</div>
<div role="tabpanel" class="tab-pane" id="two">
I am another Tab!</div>
</div>
</aside>

.index() only for one instance of class [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I've got a problem with .index() function in jQuery.
Outline of DOM:
<div class="one">
<div class="two">
<div class="three"></div>
<div class="three"></div>
<div class="three"></div>
</div>
<div class="threeB"></div>
<div class="threeB"></div>
<div class="threeB"></div>
</div>
<div class="one">
<div class="two">
<div class="three"></div>
<div class="three"></div>
</div>
<div class="threeB"></div>
<div class="threeB"></div>
</div>
<div class="one">
<div class="two">
<div class="three"></div>
<div class="three"></div>
<div class="three"></div>
</div>
<div class="threeB"></div>
<div class="threeB"></div>
<div class="threeB"></div>
</div>
According to which of threes in two a user clicks, one of the threeBs are displayed. I wanted to do this with .index() function, but it fails for all but the first ones. In the second one class, the two threes have indexes 3 and 4 (instead of desired 0 and 1). On the other hand, .eq() for threeBs seems to work as desired.
Any neat way to solve this without having to count how many threes were there before the div in question?
It is working like this:
$('.three').click(function(){
$(this).parent().parent().find('.threeB').eq($(this).index())
.css('background','green');
});
Check here: jsFiddle

Categories