gif-video appear gamevn

This script display gifv by hover on url in thread hinh thu gian gamevn.

当前为 2015-05-04 提交的版本,查看 最新版本

// ==UserScript==
// @name         gif-video appear gamevn
// @namespace    https://greasyfork.org/en/users/9850-doctorwho
// @description This script display gifv by hover on url in thread hinh thu gian gamevn.
// @run-at      document-end
// @version     1.3.1
// @include     http://forum.gamevn.com/threads/hinh-thu-gian-version-62-2015-gamevn-chao-nam-moi-de-nghi-khong-an-box-50-nua.1169467/*
// ==/UserScript==

$("[id^='post-'] a").each(function() {
    var img, href;
    href = $(this).attr("href");
    var x = 1;
    if (/imgur.com/.test(href) && !(/<img/.test($(this).firstChild))) {
        $(this).mouseover(function(){
            img = href.split('/'); 
            href = img[img.length-1];
            img = $('<div><video preload="auto" autoplay="autoplay" muted="muted" loop="loop" webkit-playsinline=""><source src="http://i.imgur.com/'+href+'.webm" type="video/webm"></video></div>');
            if(x) $(this).after(img);
            x = 0;
        });
    }
});