File: /home/dkhp464/public_html/wp-content/plugins/blur-pic/js/script.js
jQuery(function($) {
$(document).ready(function(){
$('#insert-my-media').click(open_media_window);
});
function open_media_window() {
if (this.window === undefined) {
this.window = wp.media({
title: 'Thêm hình 18+',
library: {type: 'image'},
multiple: false,
button: {text: 'Insert'}
});
var self = this; // Needed to retrieve our variable in the anonymous function below
this.window.on('select', function() {
var first = self.window.state().get('selection').first().toJSON();
console.log(first);
wp.media.editor.insert('<div class="wrap_op1">'+
'<img class="size-post-thumbnail aligncenter" src="'+first.url+'" alt="'+first.title+'" width="600" height="400" />'+
'<div class="op_img1">'+
'<div class="text">'+
'<p style="text-align: center;">Hình ảnh thật, cân nhắc khi xem!</p>'+
'<p style="text-align: center;"><a class="a_click1" href="#">Click vào xem</a></p>'+
'</div>'+
'</div>'+
'</div><p> </p>');
});
}
this.window.open();
return false;
}
/*--------------------- Hinh anh nhay cam ---------------------*/
jQuery(function($) {
$(".op_img").click(function() {
$(this).animate({
"opacity": 0
}, 500);
});
$(".a_click").click(function() {
$(this).parent().animate({
"opacity": 0
}, 500);
return false;
});
jQuery(".a_click1").click(function() {
jQuery(this).parent().parent().parent().animate({
"opacity": 0
});
return false;
});
jQuery('.text').hover(function() {
jQuery(this).parent().parent().animate({
"opacity": 1
})
}, function() {
jQuery(this).parent().parent().animate({
"opacity": 0.3
});
});
})
});