Jquery: window resize event is quite different in both FF and IE

<input type=”test” id=”searchInput” name=”searchInput” />

<script>

$(window).blind(‘resize’, fuction(){

var updatedOffset = $(‘#searchInput’).offset();

alert(updatedOffset .left);

});

</script>

In FF:

Originally, search input box’s offset: {top: 50, left: 800}

after window is resized, the updated offset which is {top: 50, left: 400}

In IE:

Originally, search input box’s offset: {top: 50, left: 800}

after window is resized, the updated offset which is {top: 50, left: 800}

The reason from what I test seems that:

In FF,  elements in this window immediately change the position after window fires the resize event. Therefore, elements offset is updated.

In IE, it sets the offset as original position then change element position after window fires the resize event.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s