I want to change my div height dynamically when page ready. (document.ready). So what is the correct page event in Jquery Mobile should I use?
Tried with pagebeforeshow and pageshow events.
Pagebeforeshow events
$(document).on 'pagebeforeshow', ->
page_id = $.mobile.activePage[0].id
if page_id == "brands"
maxHeight = Math.max.apply(null, $(".product_descriptions").map(->
$(this).height()
).get())
$(".product-image").css("height", maxHeight)
$(".circle-container").css("height", maxHeight)
maxHeight return 0
Pageshow events
$(document).on 'pageshow', ->
page_id = $.mobile.activePage[0].id
if page_id == "brands"
maxHeight = Math.max.apply(null, $(".product_descriptions").map(->
$(this).height()
).get())
$(".product-image").css("height", maxHeight)
$(".circle-container").css("height", maxHeight)
maxHeight will return the correct value.
Although pageshow event return the correct value, all elements will show first then only .css function fired. I can see the .css event fired and look weird on mobile (screen bouncing).
Is there workaround for this?