How to Destroy CKEditor in small screen devices26 Dec 2014
The CKeditor fires an event
instanceReadyonce the instances are ready to be used.
So we need to create a listener which will listen for this event.
We will only execute the event handler if the browser window width is less than the some defined width for a small screen devices.
In Jquery the width of the browser window can be determined by
$.width()method by calling on
How to use this for Question2Answer websites
If you are a owner of a Question2Answer website and you wish to show the plain text editor to your users who is viewing the site on their mobile device, this would be the best way to go.
- Login into your website as Admin
- Navigate to Admin -> Layout
- Paste the above code in Custom HTML at bottom of every page: section
- You may change the value here given as per your requirement
destroyCKEditor(500);. Here the 500 is the minimum allowed width, below which all the CKEditor instances will be destroyed