我在页面中使用TinyMCE编辑器,但我需要使用JQuery获取值.
我完全迷失了如何做到这一点,我已经尝试使用各种id并试图获取值但它只是不会使用任何东西.
$( document ).ready( function() {
tinyMCE.init({
// General options
mode : "exact",
elements : "thisID",
// Skin options
skin : "o2k7",
skin_variant : "silver",
});
derp();
});
function derp() {
$('#go').click( function() {
// alert('derp');
x = $('#thisID_ifr').val(); //this is where i attempt to get the value of the textarea but its not working?!?
alert(x);
});
//
}
Run Code Online (Sandbox Code Playgroud) 我试图根据空闲/移动使背景改变颜色.
这是有效的,但我不能使用淡入淡出淡出它.
什么是淡化背景的最佳解决方案
$("body").css('background-color','#000');
$(document).ready(function () {
var idleState = false;
var idleTimer = null;
$('*').bind('mousemove click mouseup mousedown keydown keypress keyup submit change mouseenter scroll resize dblclick', function () {
clearTimeout(idleTimer);
if (idleState == true) {
$("body").css('background-color','#fff');
}
idleState = false;
idleTimer = setTimeout(function () {
$("body").css('background-color','#000');
idleState = true; }, 2000);
});
$("body").trigger("mousemove");
});
Run Code Online (Sandbox Code Playgroud) 有可能做这样的事情
$( "#till__tablepanel_table_"+tablenumber ).append( "<span>"+if (variable == 1) { writeHere }+"</span>" );
Run Code Online (Sandbox Code Playgroud)
我似乎无法让这个工作.示例:writeHere如果条件成立,我将如何?