Search code examples
jquerycssmaterialize

how to set materilize modal top?


I'm trying to set top of modal when I set top in #singlePost modal is showing even without trigger. I've tried $('#singlePost').css("top", "1%"); but it's not working also tried this in github github any solution?

<div id="singlePost" class="modal" >
<div class="modal-content">

    <div class="row">
        <div class="col m9 s12">
            <img class="input-field" ng-src="img/cover.jpeg" alt="" >
        </div>

    </div>
</div>

css

#singlePost
{
    background-color: #f7f8fa;
    width:90%;
    height:90% !important;
    display: table !important;

}

scripts

   $('#singlePost').modal('open', {
        dismissible: true,
        inDuration: 200,
        outDuration: 100
    });

Solution

  • despite this issue github startingTop not worked for me I changed endingTop and removed startingTopand it's working!