Comments (6)
I have tried this myself with the container div being position:relative and it worked fine with a scrollable page, please provide a non-working example.
from itemslide.
Not sure why, but I found the issue. It took me a long while. I created a test page that didn't run through any of the rest of the includes or site. It worked, so then I had to figure out what was different by testing removal of one piece at a time, which finally resulted in the last thing I tried: The code completely breaks when I add <!DOCTYPE HTML>
I am not sure what is in the code that isn't being recognized correctly. That is a whole different debug another day.
from itemslide.
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<script src="jquery.mousewheel.js"></script>
<script src="js/ItemSlide.js"></script>
<style>
#scrolling{/*frame*/
position: relative;
top:0;
background:black;/*#FF8383 FF473D*/
height:40%;
width:100%;
overflow: hidden;
}
ul.slideul {
/*Add if you want to disable the option of selecting the text while sliding*/
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
margin: 0;
padding: 0;
position: relative;
/*top:10%;*/
margin-top:4vh;
height:80%;
list-style-type: none;
-webkit-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
}
li.slideli {
font-size:8vmin;/*cool*/
float: left;
width:25vw;
min-width: 250px;
height: 100%;
color: #000;
font-weight: 300;
text-align: center;
border-radius: 30px;
-webkit-border-radius: 30px;
-o-border-radius: 30px;
-moz-border-radius: 30px;
cursor: pointer;
background: #FFF;
-webkit-transform: scale(0.95);
-ms-transform: scale(0.95);
-moz-transform: scale(0.95);
transform: scale(0.95);
-moz-box-shadow: 25px 25px 25px black;
-webkit-box-shadow: 25px 25px 25px black;
box-shadow: 25px 25px 25px black;
}
.itemslide-active{/*applied to current active item*/
-webkit-transform: scale(1);
-ms-transform: scale(1);
-moz-transform: scale(1);
transform: scale(1);
}
</style>
<div id="scrolling">
<ul class="slideul">
<li style='background-color: white;' class='slideli'>
</li>
<li style='background-color: white;' class='slideli'>
</li>
<li style='background-color: white;' class='slideli'>
</li>
<li style='background-color: white;' class='slideli'>
</li>
</ul>
</div>
<div style='position: relative; background-color: green; height:40%;'>
test
</div>
<div style='position: relative; background-color: green; height:40%;'>
test 2
</div>
<div style='position: relative; background-color: green; height:40%;'>
test
</div>
<script>
var carousel;
$(document).ready(function () {
carousel = $("#scrolling ul");
carousel.itemslide({
swipe_out: false, //NOTE: REMOVE THIS OPTION IF YOU WANT TO DISABLE THE SWIPING SLIDES OUT FEATURE.
start:1
}); //initialize itemslide
$(window).resize(function () {
carousel.reload();
}); //Recalculate width and center positions and sizes when window is resized
});
</script>
from itemslide.
I have tried this myself with the container div being position:relative and it worked fine with a scrollable page, please provide a non-working example.
I apologize if you read this earlier. I edited my responses to be more readable. I was having trouble getting my code to show up. With the above code, if you add the doctype it doesn't work when relative. It works fine in other positions like fixed. I am not yet sure without more digging into the code.
Apparently I needed to just add a style reference to fix it. I didn't realize such a small piece of missing code could do so much chaos.
html,body{
height:100%; /* w00t */
}
from itemslide.
Ok, I see what you are talking about, interesting, looking into it :)
from itemslide.
This has to do with the browser going to "standards mode" when you have the DOCTYPE, while when you don't have the DOCTYPE your browser is in quirks mode. The precentage height/width works a bit differently between these modes see https://stackoverflow.com/questions/32214152/why-does-height-100-work-when-doctype-is-removed for more information
Closing because this is not related to ItemSlide
from itemslide.
Related Issues (20)
- Attaching events to dynamically added items HOT 1
- Disable? HOT 1
- Two carousels in the same page HOT 1
- Fade Transition, its possible? HOT 2
- Auto Sliding HOT 3
- Problem when using more than one itemslide per page HOT 3
- Rewind slides and performance issue with too many items
- While Sliding item a tag is clicked HOT 4
- After using addSlide, the swipe is not working properly HOT 2
- Avoid scroll page when slide is touched HOT 1
- Css problem HOT 2
- Multiple sliders: only one options array HOT 1
- left carousel and buttons next not work HOT 2
- I found click issues, please resolve them HOT 1
- I found scroll issue, please resolve them HOT 2
- Remove jQuery/Zepto dependency
- Replace browserify with webpack
- Add dynamic information footer that syncs with active slide HOT 4
- dos you have solution for RTL HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itemslide.