Code Monkey home page Code Monkey logo

Comments (6)

nir9 avatar nir9 commented on June 10, 2024

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.

jwigton avatar jwigton commented on June 10, 2024

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.

jwigton avatar jwigton commented on June 10, 2024
 <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.

jwigton avatar jwigton commented on June 10, 2024

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.

nir9 avatar nir9 commented on June 10, 2024

Ok, I see what you are talking about, interesting, looking into it :)

from itemslide.

nir9 avatar nir9 commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.