Skip to content

Instantly share code, notes, and snippets.

@kanghyojun
Created July 4, 2013 15:23
Show Gist options
  • Select an option

  • Save kanghyojun/5928598 to your computer and use it in GitHub Desktop.

Select an option

Save kanghyojun/5928598 to your computer and use it in GitHub Desktop.
$(document).ready(function () {
$(".fixed_img_col li").each(function (h) {
var i = $(this).find("a").attr("href");
var j = (width != 180) ? "C320x180" : "C120x90";
var k = (width == 180) ? "" : "mq";
if (h % col == 0) $(this).addClass("odd");
var d = $(this).find(".thumb img");
var f = $(this).find(".thumb #str");
$.ajax({
url: i,
dataType: "html",
success: function (b) {
var a;
var e = 'http://cfile';
var g = '"';
if (b.match(e + "(.*?)" + g) != null) {
a = b.match(e + "(.*?)" + g)[0];
a = a.substring(0, a.length - 1);
d.removeClass("dno");
d.attr("src", a.replace('original', j).replace('image', j));
f.hide()
} else {
e = 'youtube.com/';
var c = b.indexOf(e);
if (c > 0) {
c = b.indexOf("/", c + 12) + 1;
var l = b.indexOf("?", c);
a = b.substring(c, l);
d.removeClass("dno");
d.attr("src", "http://i2.ytimg.com/vi/" + a + "/" + k + "default.jpg");
f.hide()
}
f.html("No Image")
}
}
})
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment