1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-08 09:24:25 +03:00
ifhub.club/application/frontend/common/js/init.js
Mzhelskiy Maxim 9df6d48208 fix
2013-08-07 22:51:51 +07:00

57 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

jQuery(document).ready(function($) {
$('html').removeClass('no-js');
// Определение браузера
if ($.browser.opera) {
$('body').addClass('opera opera' + parseInt($.browser.version));
}
if ($.browser.mozilla) {
$('body').addClass('mozilla mozilla' + parseInt($.browser.version));
}
if ($.browser.webkit) {
$('body').addClass('webkit webkit' + parseInt($.browser.version));
}
if ($.browser.msie) {
$('body').addClass('ie');
if (parseInt($.browser.version) > 8) {
$('body').addClass('ie' + parseInt($.browser.version));
}
}
// Фикс бага с z-index у встроенных видео
$("iframe").each(function(){
var ifr_source = $(this).attr('src');
if(ifr_source) {
var wmode = "wmode=opaque";
if (ifr_source.indexOf('?') != -1)
$(this).attr('src',ifr_source+'&'+wmode);
else
$(this).attr('src',ifr_source+'?'+wmode);
}
});
/**
* Tag search
*/
$('.js-tag-search-form').submit(function(){
var val=$(this).find('.js-tag-search').val();
if (val) {
window.location = aRouter['tag']+encodeURIComponent(val)+'/';
}
return false;
});
/**
* IE
*/
// эмуляция placeholder'ов в IE
if ($('html').hasClass('oldie')) {
$('input[type=text], textarea').placeholder();
}
});