PageSourceSearch

https://asianbeat.com/resource/script/ie6.js

js asianbeat.com collected 2026-10-02 06:44:36 UTC 1,432 bytes, 48 lines download raw bytes

1// IE max-width fix
2// IE 6,7,8 does not work the css style 'max-width' correctly.
3// required jQuery
4$(document).ready(function() {
5  if (typeof $.browser.msie != 'undefined') {
6    //alert($.browser.version);
7    var ends_with = function(str, val) {
8      return val == str.substring(str.length - val.length);
9    }
10    var remove_px = function(str) {
11      if (typeof str == 'string' && ends_with(str, 'px')) {
12        str = str.substr(0, str.indexOf('px'));
13      }
14      return str;
15    }
16    var set_max_width = function(elem) {
17      var max_width = elem.css('max-width');
18      if (max_width && max_width != 'none') {
19        var resize_img = function() {
20          max_width = remove_px(max_width);
21          var width = elem.width();
22          width = remove_px(width);
23          elem.css('max-width','none');
24          if (width >= max_width) {
25            elem.width(max_width+'px');
26          }
27        };
28        elem.one('load', resize_img).each(function() {
29          //IE caching tweaks http://api.jquery.com/load-event/
30          if (this.complete) {
31              $(this).trigger('load');
32          }
33        });
34      }
35    }
36    //select target element
37    $("img").each(function() {
38      var img = $(this);
39      set_max_width(img);
40    });
41    $('.news_list').bind('ajaxComplete', function() {
42      $("img").each(function() {
43        var img = $(this);
44        set_max_width(img);
45      });
46    });
47  }
48});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.