Can I make this script work "responsivly" without refresing the page?


I am using this script to make the <li> of my flexslider 100% height of .flexslider , which in turn is 90% viewport height.

$().ready(function() {
var height = $(‘.flexslider’).height();
var width = $(‘.flexslider’).width();
$(‘.flexslider .slides li’).css(‘height’, height).css(‘width’,width);

The script works as intendent but if i resize the window I have to refresh the page for the <li> to get the right height again. Sure it is no biggy except if you look at an Ipad and switch between landscape and porttrait for example.

Is it possible to make the script fel more “responsive”?

You are running the code when the page loads.
Try running the code when the resize event fires, as well.