• 01-05-2023, 12:12:51
    #1
    Merhaba,

    bir divim var bu div fixed ike top:0 ayarlı ama bu din scrool en alta geldiğinde top10px; olmasını istiyorum bunu nasıl yapabilirim acaba?
  • 01-05-2023, 12:14:29
    #2
    div {
      position: fixed;
      top: calc(100% - 50px);
      margin-top: 10px;
    }
    bunu deneyebilirsiniz.
  • 01-05-2023, 12:15:13
    #3
    .sabitlenmis-div {
    position: fixed;
    top: 10px;
    bottom: 0;
    /* diğer stil özellikleri */
    }
  • 01-05-2023, 12:20:33
    #4
    Hocam bunu Js ile yapmalıyız. Sadece scrool en alta geldiğinde top:10px olacak. Diğer durumlarda top:0px olacak.

    hobuz adlı üyeden alıntı: mesajı görüntüle
    .sabitlenmis-div {
    position: fixed;
    top: 10px;
    bottom: 0;
    /* diğer stil özellikleri */
    }
  • 21-05-2023, 21:46:43
    #5
    var divElement = document.querySelector('div'); 
    divElement.style.position = 'fixed';
    divElement.style.top = 'calc(100% - 50px)';
    divElement.style.marginTop = '10px';