why is the value of height() in chrome different with safari?
Asked Answered
R

0

0

My script like this :

$.ajax({ 
    url: _url,
    type: 'GET', 
    dataType: "json",
    contentType: "application/json; charset=utf-8",
    success: function (result) {
        ...
    }
}).done(function () {
    for(var i=0;i<7;i++) {
        this["td"+i] = $('#bodychel-' + coachId + clubId + ' table tbody td:eq(' + (i) + ')').height();
        $('#bodychel-' + coachId + clubId + ' table thead th:eq(' + (i) + ')').css({ height: this["td"+i] });
    }
});

If I console.log(this["td"+i]);, the result is different between chrome and safari. the result of chrome is true

How can I solve this problem?

Rollback answered 10/10, 2019 at 3:22 Comment(12)
the result of chrome is true? so, in safari it's false? Or did you mean correct? If so, what is the value in Chrome, what is it in Safari, and can you show enough HTML so that we can see this difference for ourselvesCheviot
@Cheviot Yes, the result of chrome is true. If I console.log(this["td"+i]); in the chrome, the result : 51.8182. But in the safari is 42.Rollback
add reset css to your css fileIke
so you're using the word "true" to mean "correct" - just to clarifyCheviot
@MNNTNK What do you mean?Rollback
@Cheviot Yes of courseRollback
@SuccessMan copy styles from this page to your main css file on top : meyerweb.com/eric/tools/css/resetIke
If you inspect the element, it's ancestors and descendants, in each of those browsers, can you see where the difference is coming from - it may well be a default font size making the differenceCheviot
@MNNTNK it seems strange. it is not a solutionRollback
@Cheviot I'm still confused. I need a spesific answerRollback
you need to show enough in your question to be able to get an answer - we can't debug for you since you've shown zero HTML and CSS ... have you even looked at the elements using inspect element as per my previous commentCheviot
@SuccessMan Can you provide a fiddle for this? Or at least HTML and CSS code for the sameReichert

© 2022 - 2024 — McMap. All rights reserved.