Posts

Showing posts with the label jQuery

Reintialize TinyMCE after jQuery Load

Bump into the problem of reintializing TinyMCE textbox after replacing the DOM with jQuery load. The Problem After saving a form on a page (with multiple forms), I did a jQuery.load() to replace the DOM of the particular section. Then I run the initialization function to reinitialize all DOMs, including TinyMCE. I realized TinyMCE contents is not saved after this. Solution: Initial attempt After Google-ed for a while, I found this solution from StackOverflow . tinymce.execCommand('mceRemoveControl', true, 'editor_id'); So, to use it, it would be... _init = function() { /* Some other initialization code here */ tinymce.execCommand('mceRemoveControl', true, 'editor_id'); tinyMCE.init({ /* TinyMCE options */ }); } Oh, wait... Some issues: My ' editor_id ' is dynamic...  I have multiple textboxes Solution: Second attempt. Easy. Just use jQuery.each() to loop through all the textbox and remove TinyMCE control from each o...

[jQuery] Mouseover Fade for all Children Element

Heres a very simple script for those who looking for jQuery script that Applies mouseover / mouseout fade, For all elements in a container. Note: Just need replace the  parent-class-to-apply-effect with the class of the parent container that you want to apply to. jQuery(document).ready(function() { jQuery.each(jQuery('.parent-class-to-apply-effect').children(), function() { jQuery(this).mouseover(function() { jQuery(this).fadeTo('slow', 0.8); }).mouseout(function() { jQuery(this).fadeTo("slow", 1.0); }); }); }); :)